diff options
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b24374..7900962 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -94,6 +94,7 @@ if(ZLIB_BUILD_SHARED) | |||
94 | ${ZLIB_PUBLIC_HDRS} | 94 | ${ZLIB_PUBLIC_HDRS} |
95 | ${ZLIB_PRIVATE_HDRS} | 95 | ${ZLIB_PRIVATE_HDRS} |
96 | $<$<OR:$<BOOL:${WIN32}>,$<BOOL:${CYGWIN}>>:win32/zlib1.rc>) | 96 | $<$<OR:$<BOOL:${WIN32}>,$<BOOL:${CYGWIN}>>:win32/zlib1.rc>) |
97 | add_library(ZLIB::ZLIB ALIAS zlib) | ||
97 | target_include_directories(zlib PUBLIC | 98 | target_include_directories(zlib PUBLIC |
98 | $<BUILD_INTERFACE:${zlib_BINARY_DIR}> | 99 | $<BUILD_INTERFACE:${zlib_BINARY_DIR}> |
99 | $<BUILD_INTERFACE:${zlib_SOURCE_DIR}> | 100 | $<BUILD_INTERFACE:${zlib_SOURCE_DIR}> |
@@ -113,6 +114,7 @@ if(ZLIB_BUILD_SHARED) | |||
113 | # the DLL comes from the resource file win32/zlib1.rc | 114 | # the DLL comes from the resource file win32/zlib1.rc |
114 | set_target_properties(zlib PROPERTIES | 115 | set_target_properties(zlib PROPERTIES |
115 | DEFINE_SYMBOL ZLIB_DLL | 116 | DEFINE_SYMBOL ZLIB_DLL |
117 | EXPORT_NAME ZLIB | ||
116 | OUTPUT_NAME z | 118 | OUTPUT_NAME z |
117 | SOVERSION 1 | 119 | SOVERSION 1 |
118 | $<$<BOOL:NOT:$CYGWIN}>:VERSION ${zlib_VERSION}>) | 120 | $<$<BOOL:NOT:$CYGWIN}>:VERSION ${zlib_VERSION}>) |
@@ -128,6 +130,7 @@ if(ZLIB_BUILD_STATIC) | |||
128 | ${ZLIB_SRCS} | 130 | ${ZLIB_SRCS} |
129 | ${ZLIB_PUBLIC_HDRS} | 131 | ${ZLIB_PUBLIC_HDRS} |
130 | ${ZLIB_PRIVATE_HDRS}) | 132 | ${ZLIB_PRIVATE_HDRS}) |
133 | add_library(ZLIB::ZLIBSTATIC ALIAS zlibstatic) | ||
131 | target_include_directories(zlibstatic PUBLIC | 134 | target_include_directories(zlibstatic PUBLIC |
132 | $<BUILD_INTERFACE:${zlib_BINARY_DIR}> | 135 | $<BUILD_INTERFACE:${zlib_BINARY_DIR}> |
133 | $<BUILD_INTERFACE:${zlib_SOURCE_DIR}> | 136 | $<BUILD_INTERFACE:${zlib_SOURCE_DIR}> |
@@ -193,20 +196,20 @@ endif(ZLIB_INSTALL_LIBRARIES) | |||
193 | if(ZLIB_BUILD_TESTING) | 196 | if(ZLIB_BUILD_TESTING) |
194 | enable_testing() | 197 | enable_testing() |
195 | add_executable(zlib_example test/example.c) | 198 | add_executable(zlib_example test/example.c) |
196 | target_link_libraries(zlib_example zlib) | 199 | target_link_libraries(zlib_example ZLIB::ZLIB) |
197 | add_test(zlib_example zlib_example) | 200 | add_test(zlib_example zlib_example) |
198 | 201 | ||
199 | add_executable(minigzip test/minigzip.c) | 202 | add_executable(minigzip test/minigzip.c) |
200 | target_link_libraries(minigzip zlib) | 203 | target_link_libraries(minigzip ZLIB::ZLIB) |
201 | 204 | ||
202 | if(HAVE_OFF64_T) | 205 | if(HAVE_OFF64_T) |
203 | add_executable(zlib_example64 test/example.c) | 206 | add_executable(zlib_example64 test/example.c) |
204 | target_compile_definitions(zlib_example64 PRIVATE LARGEFILE64_SOURCE=1) | 207 | target_compile_definitions(zlib_example64 PRIVATE LARGEFILE64_SOURCE=1) |
205 | target_link_libraries(zlib_example64 zlib) | 208 | target_link_libraries(zlib_example64 ZLIB::ZLIB) |
206 | add_test(zlib_example64 zlib_example64) | 209 | add_test(zlib_example64 zlib_example64) |
207 | 210 | ||
208 | add_executable(minigzip64 test/minigzip.c) | 211 | add_executable(minigzip64 test/minigzip.c) |
209 | target_compile_definitions(minigzip64 PRIVATE LARGEFILE64_SOURCE=1) | 212 | target_compile_definitions(minigzip64 PRIVATE LARGEFILE64_SOURCE=1) |
210 | target_link_libraries(minigzip64 zlib) | 213 | target_link_libraries(minigzip64 ZLIB::ZLIB) |
211 | endif(HAVE_OFF64_T) | 214 | endif(HAVE_OFF64_T) |
212 | endif(ZLIB_BUILD_TESTING) | 215 | endif(ZLIB_BUILD_TESTING) |