From 9511d3c46dd8a1ad2f1c45a973d69bd048a0c5bf Mon Sep 17 00:00:00 2001 From: ljfa Date: Tue, 22 Sep 2015 16:21:17 +0200 Subject: Use target-specific CMake commands (thanks jandal) --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad05cb74a3..12f816d285 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,7 @@ include(GenerateExportHeader) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) -add_definitions(-std=c++11) -include_directories(include ${CMAKE_CURRENT_BINARY_DIR}) +find_package(ZLIB REQUIRED) set(NBT_SOURCES src/endian_str.cpp @@ -27,11 +26,11 @@ set(NBT_SOURCES src/text/json_formatter.cpp) add_library(nbt++ ${NBT_SOURCES}) +target_include_directories(nbt++ PUBLIC include ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(nbt++ z) +target_compile_options(nbt++ PUBLIC -std=c++11) generate_export_header(nbt++ BASE_NAME nbt) -find_package(ZLIB REQUIRED) - option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(NBT_BUILD_TESTS "Build the unit tests. Requires CxxTest." ON) -- cgit 0.0.5-2-1-g0f52