summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorljfa <ljfa-ag@web.de>2015-09-22 16:21:17 +0200
committerljfa <ljfa-ag@web.de>2015-09-22 16:21:17 +0200
commit9511d3c46dd8a1ad2f1c45a973d69bd048a0c5bf (patch)
treec728231092ab8e90b8c0e3901f7a92fdcc0f5f47
parent682caa865d4a064b7fa1b46b02c6ffef1f3a7597 (diff)
downloadProject-Tick-9511d3c46dd8a1ad2f1c45a973d69bd048a0c5bf.tar.gz
Project-Tick-9511d3c46dd8a1ad2f1c45a973d69bd048a0c5bf.zip
Use target-specific CMake commands (thanks jandal)
-rw-r--r--CMakeLists.txt7
1 files 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)