aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt29
1 files changed, 17 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1912496..54b3f24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ project(zlib
7option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON) 7option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
8option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON) 8option(ZLIB_BUILD_SHARED "Enable building zlib shared library" ON)
9option(ZLIB_BUILD_STATIC "Enable building zlib static library" ON) 9option(ZLIB_BUILD_STATIC "Enable building zlib static library" ON)
10option(ZLIB_INSTALL_LIBRARIES "Enable installation of zlib" ON)
10 11
11if(WIN32) 12if(WIN32)
12 option(ZLIB_INSTALL_COMPAT_DLL "Install a copy as zlib1.dll" ON) 13 option(ZLIB_INSTALL_COMPAT_DLL "Install a copy as zlib1.dll" ON)
@@ -146,44 +147,48 @@ if(NOT CYGWIN AND ZLIB_BUILD_SHARED)
146 set_target_properties(zlib PROPERTIES VERSION ${zlib_VERSION}) 147 set_target_properties(zlib PROPERTIES VERSION ${zlib_VERSION})
147endif(NOT CYGWIN AND ZLIB_BUILD_SHARED) 148endif(NOT CYGWIN AND ZLIB_BUILD_SHARED)
148 149
149if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) 150if(ZLIB_INSTALL_LIBRARIES)
150 if(ZLIB_BUILD_SHARED) 151 if(ZLIB_BUILD_SHARED)
151 install(TARGETS zlib 152 install(TARGETS zlib
153 COMPONENT Runtime
152 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" 154 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
153 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" 155 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
154 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") 156 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
155 if(ZLIB_INSTALL_COMPAT_DLL) 157 if(ZLIB_INSTALL_COMPAT_DLL)
156 install(FILES $<TARGET_FILE:zlib> 158 install(FILES $<TARGET_FILE:zlib>
159 COMPONENT Runtime
157 RENAME zlib1.dll 160 RENAME zlib1.dll
158 DESTINATION "${CMAKE_INSTALL_BINDIR}") 161 DESTINATION "${CMAKE_INSTALL_BINDIR}")
159 endif(ZLIB_INSTALL_COMPAT_DLL) 162 endif(ZLIB_INSTALL_COMPAT_DLL)
160 163
161 if(MSVC) 164 if(MSVC)
162 install(FILES $<TARGET_PDB_FILE:zlib> 165 install(FILES $<TARGET_PDB_FILE:zlib>
166 COMPONENT Runtime
163 DESTINATION ${CMAKE_INSTALL_BINDIR} 167 DESTINATION ${CMAKE_INSTALL_BINDIR}
164 CONFIGURATIONS Debug OR RelWithDebInfo 168 CONFIGURATIONS Debug OR RelWithDebInfo
165 OPTIONAL 169 OPTIONAL
166 ) 170 )
167 endif(MSVC) 171 endif(MSVC)
168
169 endif(ZLIB_BUILD_SHARED) 172 endif(ZLIB_BUILD_SHARED)
170 173
171 if(ZLIB_BUILD_STATIC) 174 if(ZLIB_BUILD_STATIC)
172 install(TARGETS zlibstatic 175 install(TARGETS zlibstatic
176 COMPONENT Development
173 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" 177 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
174 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" 178 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
175 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") 179 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
176 endif(ZLIB_BUILD_STATIC) 180 endif(ZLIB_BUILD_STATIC)
177endif(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) 181
178if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL) 182 install(FILES ${ZLIB_PUBLIC_HDRS}
179 install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") 183 COMPONENT Development
180endif(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) 184 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
181if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) 185 FILES zlib.3
182 install(FILES zlib.3 DESTINATION "${CMAKE_INSTALL_MANDIR}/man3") 186 COMPONENT Development
183endif(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) 187 DESTINATION "${CMAKE_INSTALL_MANDIR}/man3"
184if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) 188 FILES ${ZLIB_PC}
185 install(FILES ${ZLIB_PC} DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 189 COMPONENT Development
186endif(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL) 190 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
191endif(ZLIB_INSTALL_LIBRARIES)
187 192
188#============================================================================ 193#============================================================================
189# Example binaries 194# Example binaries