summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorljfa <ljfa-ag@web.de>2015-09-22 11:12:25 +0200
committerljfa <ljfa-ag@web.de>2015-09-22 11:12:25 +0200
commitc178c3055257d1e0ff63229568eb507486d8ad36 (patch)
tree9177d7f002693d2119e0c0d10c161f3a1206c810
parentfe4d1dca6a44e9a079806dc27b7ddb0a558ee36a (diff)
downloadProject-Tick-c178c3055257d1e0ff63229568eb507486d8ad36.tar.gz
Project-Tick-c178c3055257d1e0ff63229568eb507486d8ad36.zip
Add option for building shared library (#7)
No export headers yet though
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30441d77d0..6a5c651d78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,8 @@ project(libnbt++
add_definitions(-std=c++11)
include_directories(include)
-add_library(nbt++ STATIC
+
+set(NBT_SOURCES
src/endian_str.cpp
src/tag.cpp
src/tag_array.cpp
@@ -21,9 +22,13 @@ add_library(nbt++ STATIC
src/text/json_formatter.cpp)
+add_library(nbt++ ${NBT_SOURCES})
+target_link_libraries(nbt++ z)
+
find_package(ZLIB REQUIRED)
find_package(CxxTest)
+option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(NBT_BUILD_TESTS "Build the unit tests. Requires CxxTest." ${CXXTEST_FOUND})
if(NBT_BUILD_TESTS)