diff options
author | Vollstrecker <werner@vollstreckernet.de> | 2024-12-31 12:55:38 +0100 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2025-01-31 20:02:26 -0800 |
commit | abf7487d6c3dd12dde50bd54489cfc99cef59770 (patch) | |
tree | 1c5add290415cec005c5559cd4c5fd78b86f6e94 /zlibConfig.cmake.in | |
parent | e843c631d6c677bb8585c31b0b960d281cfc42bc (diff) | |
download | zlib-abf7487d6c3dd12dde50bd54489cfc99cef59770.tar.gz zlib-abf7487d6c3dd12dde50bd54489cfc99cef59770.tar.bz2 zlib-abf7487d6c3dd12dde50bd54489cfc99cef59770.zip |
CMake: Add components selection.
Diffstat (limited to '')
-rw-r--r-- | zlibConfig.cmake.in | 27 |
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 @@ | |||
1 | set(zlib_VERSION @zlib_VERSION@) | ||
2 | @PACKAGE_INIT@ | 1 | @PACKAGE_INIT@ |
3 | INCLUDE (${CMAKE_CURRENT_LIST_DIR}/ZLIB.cmake) | 2 | |
3 | set(_ZLIB_supported_components "") | ||
4 | |||
5 | if(@ZLIB_BUILD_SHARED@) | ||
6 | list(APPEND _ZLIB_supported_components shared) | ||
7 | endif(@ZLIB_BUILD_SHARED@) | ||
8 | |||
9 | if(@ZLIB_BUILD_STATIC@) | ||
10 | list(APPEND _ZLIB_supported_components static) | ||
11 | endif(@ZLIB_BUILD_STATIC@) | ||
12 | |||
13 | if(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}) | ||
22 | else(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) | ||
26 | endif(ZLIB_FIND_COMPONENTS) | ||