summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt36
1 files changed, 19 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 157097e..61188e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ project(zlib C)
9 9
10set(VERSION "1.3.0.1") 10set(VERSION "1.3.0.1")
11 11
12option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
12option(ZLIB_STATIC_LINK_CRT "Link the MSVC runtime library statically" OFF) 13option(ZLIB_STATIC_LINK_CRT "Link the MSVC runtime library statically" OFF)
13 14
14set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") 15set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
@@ -211,21 +212,22 @@ endif()
211#============================================================================ 212#============================================================================
212# Example binaries 213# Example binaries
213#============================================================================ 214#============================================================================
214 215if(ZLIB_BUILD_EXAMPLES)
215add_executable(example test/example.c) 216 add_executable(example test/example.c)
216target_link_libraries(example zlib) 217 target_link_libraries(example zlib)
217add_test(example example) 218 add_test(example example)
218 219
219add_executable(minigzip test/minigzip.c) 220 add_executable(minigzip test/minigzip.c)
220target_link_libraries(minigzip zlib) 221 target_link_libraries(minigzip zlib)
221 222
222if(HAVE_OFF64_T) 223 if(HAVE_OFF64_T)
223 add_executable(example64 test/example.c) 224 add_executable(example64 test/example.c)
224 target_link_libraries(example64 zlib) 225 target_link_libraries(example64 zlib)
225 set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") 226 set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
226 add_test(example64 example64) 227 add_test(example64 example64)
227 228
228 add_executable(minigzip64 test/minigzip.c) 229 add_executable(minigzip64 test/minigzip.c)
229 target_link_libraries(minigzip64 zlib) 230 target_link_libraries(minigzip64 zlib)
230 set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") 231 set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
232 endif()
231endif() 233endif()