diff options
| author | Vollstrecker <werner@vollstreckernet.de> | 2024-12-02 15:11:31 +0100 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2025-01-31 19:59:10 -0800 |
| commit | f7ab6e43732bc68b38ef5db5feda27105d954b5b (patch) | |
| tree | 99fb2a9dba676096775398944dda236ec8450b55 | |
| parent | f0175c69e216545ff543b1f46870d1c1a27aa5f0 (diff) | |
| download | zlib-f7ab6e43732bc68b38ef5db5feda27105d954b5b.tar.gz zlib-f7ab6e43732bc68b38ef5db5feda27105d954b5b.tar.bz2 zlib-f7ab6e43732bc68b38ef5db5feda27105d954b5b.zip | |
CMake: Add aliases to match the export names.
| -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) |
