diff options
author | Christoph J. Thompson <cjsthompson@gmail.com> | 2012-03-11 10:19:06 +0100 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-03-11 10:16:12 -0700 |
commit | c1e84b258c462a88ea0398b45515781f0c583ecb (patch) | |
tree | 74e4ce037bde606f71edc3da8632bce3618b6879 | |
parent | cd71ef302123032aed0accade96efaca3e1f33dd (diff) | |
download | zlib-c1e84b258c462a88ea0398b45515781f0c583ecb.tar.gz zlib-c1e84b258c462a88ea0398b45515781f0c583ecb.tar.bz2 zlib-c1e84b258c462a88ea0398b45515781f0c583ecb.zip |
Include version symbols for cmake builds.
Add a version variable so it gets added to the pkg-config file.
-rw-r--r-- | CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 39d2104..2ee2dbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -3,6 +3,8 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) | |||
3 | 3 | ||
4 | project(zlib C) | 4 | project(zlib C) |
5 | 5 | ||
6 | set(VERSION "1.2.7") | ||
7 | |||
6 | set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") | 8 | set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") |
7 | set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") | 9 | set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") |
8 | set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") | 10 | set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") |
@@ -162,6 +164,7 @@ endif() | |||
162 | if(UNIX) | 164 | if(UNIX) |
163 | # On unix-like platforms the library is almost always called libz | 165 | # On unix-like platforms the library is almost always called libz |
164 | set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) | 166 | set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) |
167 | set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,zlib.map") | ||
165 | elseif(BUILD_SHARED_LIBS AND WIN32) | 168 | elseif(BUILD_SHARED_LIBS AND WIN32) |
166 | # Creates zlib1.dll when building shared library version | 169 | # Creates zlib1.dll when building shared library version |
167 | set_target_properties(zlib PROPERTIES SUFFIX "1.dll") | 170 | set_target_properties(zlib PROPERTIES SUFFIX "1.dll") |