aboutsummaryrefslogtreecommitdiff
path: root/zlibConfig.cmake.in
diff options
context:
space:
mode:
authorVollstrecker <werner@vollstreckernet.de>2024-12-31 12:55:38 +0100
committerMark Adler <madler@alumni.caltech.edu>2025-01-31 20:02:26 -0800
commitabf7487d6c3dd12dde50bd54489cfc99cef59770 (patch)
tree1c5add290415cec005c5559cd4c5fd78b86f6e94 /zlibConfig.cmake.in
parente843c631d6c677bb8585c31b0b960d281cfc42bc (diff)
downloadzlib-abf7487d6c3dd12dde50bd54489cfc99cef59770.tar.gz
zlib-abf7487d6c3dd12dde50bd54489cfc99cef59770.tar.bz2
zlib-abf7487d6c3dd12dde50bd54489cfc99cef59770.zip
CMake: Add components selection.
Diffstat (limited to '')
-rw-r--r--zlibConfig.cmake.in27
1 files changed, 25 insertions, 2 deletions
diff --git a/zlibConfig.cmake.in b/zlibConfig.cmake.in
index 8e64b6f..d7a849b 100644
--- a/zlibConfig.cmake.in
+++ b/zlibConfig.cmake.in
@@ -1,3 +1,26 @@
1set(zlib_VERSION @zlib_VERSION@)
2@PACKAGE_INIT@ 1@PACKAGE_INIT@
3INCLUDE (${CMAKE_CURRENT_LIST_DIR}/ZLIB.cmake) 2
3set(_ZLIB_supported_components "")
4
5if(@ZLIB_BUILD_SHARED@)
6 list(APPEND _ZLIB_supported_components shared)
7endif(@ZLIB_BUILD_SHARED@)
8
9if(@ZLIB_BUILD_STATIC@)
10 list(APPEND _ZLIB_supported_components static)
11endif(@ZLIB_BUILD_STATIC@)
12
13if(ZLIB_FIND_COMPONENTS)
14 foreach(_comp ${ZLIB_FIND_COMPONENTS})
15 if (NOT _comp IN_LIST _ZLIB_supported_components)
16 set(ZLIB_FOUND False)
17 set(ZLIB_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
18 endif(NOT _comp IN_LIST _ZLIB_supported_components)
19
20 include("${CMAKE_CURRENT_LIST_DIR}/ZLIB-${_comp}.cmake")
21 endforeach(_comp ${ZLIB_FIND_COMPONENTS})
22else(ZLIB_FIND_COMPONENTS)
23 foreach(_component_config IN LISTS _ZLIB_supported_components)
24 include("${CMAKE_CURRENT_LIST_DIR}/ZLIB-${_component_config}.cmake")
25 endforeach(_component_config IN LISTS _ZLIB_supported_components)
26endif(ZLIB_FIND_COMPONENTS)