diff options
| author | Vollstrecker <werner@vollstreckernet.de> | 2026-01-03 10:53:14 +0100 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2026-01-12 11:08:59 -0800 |
| commit | 39728a2b005fa549307943a3ed00afa878ab9a65 (patch) | |
| tree | 1aec587a98b62826c918351c682900abd9896058 /contrib/iostream3 | |
| parent | 53af7b07e530807daf6ddc55b479c19a128c3870 (diff) | |
| download | zlib-39728a2b005fa549307943a3ed00afa878ab9a65.tar.gz zlib-39728a2b005fa549307943a3ed00afa878ab9a65.tar.bz2 zlib-39728a2b005fa549307943a3ed00afa878ab9a65.zip | |
CMake: Add install and exports.
Diffstat (limited to 'contrib/iostream3')
| -rw-r--r-- | contrib/iostream3/CMakeLists.txt | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/contrib/iostream3/CMakeLists.txt b/contrib/iostream3/CMakeLists.txt index 3426a58e..01bc279f 100644 --- a/contrib/iostream3/CMakeLists.txt +++ b/contrib/iostream3/CMakeLists.txt | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.12...3.31) | 1 | cmake_minimum_required(VERSION 3.12...3.31) |
| 2 | 2 | ||
| 3 | project( | 3 | project( |
| 4 | iostreamsV3 | 4 | iostreamV3 |
| 5 | VERSION 1.0.0 | 5 | VERSION 1.0.0 |
| 6 | LANGUAGES CXX | 6 | LANGUAGES CXX |
| 7 | DESCRIPTION "A library for using C++ IOStreams with zlib V3" | 7 | DESCRIPTION "A library for using C++ IOStreams with zlib V3" |
| @@ -10,6 +10,10 @@ project( | |||
| 10 | option(ZLIB_IOSTREAM3_BUILD_SHARED "Enable building blast shared library" ON) | 10 | option(ZLIB_IOSTREAM3_BUILD_SHARED "Enable building blast shared library" ON) |
| 11 | option(ZLIB_IOSTREAM3_BUILD_STATIC "Enable building blast static library" ON) | 11 | option(ZLIB_IOSTREAM3_BUILD_STATIC "Enable building blast static library" ON) |
| 12 | option(ZLIB_IOSTREAM3_BUILD_TESTING "Enable building tests for blast" ON) | 12 | option(ZLIB_IOSTREAM3_BUILD_TESTING "Enable building tests for blast" ON) |
| 13 | option(ZLIB_IOSTREAM3_INSTALL "Enable installation of iostream" ON) | ||
| 14 | |||
| 15 | include(GNUInstallDirs) | ||
| 16 | include(CMakePackageConfigHelpers) | ||
| 13 | 17 | ||
| 14 | if(NOT DEFINED ZLIB_BUILD_IOSTREAM3) | 18 | if(NOT DEFINED ZLIB_BUILD_IOSTREAM3) |
| 15 | if(ZLIB_IOSTREAM3_BUILD_SHARED) | 19 | if(ZLIB_IOSTREAM3_BUILD_SHARED) |
| @@ -88,3 +92,58 @@ if(ZLIB_IOSTREAM3_BUILD_TESTING) | |||
| 88 | PROPERTIES | 92 | PROPERTIES |
| 89 | FIXTURES_CLEANUP zlib_iostream3_cleanup) | 93 | FIXTURES_CLEANUP zlib_iostream3_cleanup) |
| 90 | endif(ZLIB_IOSTREAM3_BUILD_TESTING) | 94 | endif(ZLIB_IOSTREAM3_BUILD_TESTING) |
| 95 | |||
| 96 | if(ZLIB_IOSTREAM3_INSTALL) | ||
| 97 | if(ZLIB_IOSTREAM3_BUILD_SHARED) | ||
| 98 | install( | ||
| 99 | TARGETS zlib_iostream3_iostreamv3 | ||
| 100 | COMPONENT Runtime | ||
| 101 | EXPORT zlibiostream3SharedExport | ||
| 102 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||
| 103 | install( | ||
| 104 | EXPORT zlibiostream3SharedExport | ||
| 105 | FILE iostreamv3-shared.cmake | ||
| 106 | NAMESPACE IOSTREAMV3:: | ||
| 107 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3) | ||
| 108 | |||
| 109 | if(MSVC) | ||
| 110 | install( | ||
| 111 | FILES $<TARGET_PDB_FILE:zlib_iostream3_iostream3> | ||
| 112 | COMPONENT Development | ||
| 113 | DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| 114 | CONFIGURATIONS Debug OR RelWithDebInfo | ||
| 115 | OPTIONAL) | ||
| 116 | endif(MSVC) | ||
| 117 | endif(ZLIB_IOSTREAM3_BUILD_SHARED) | ||
| 118 | |||
| 119 | if(ZLIB_IOSTREAM3_BUILD_STATIC) | ||
| 120 | install( | ||
| 121 | TARGETS zlib_iostream3_iostreamv3Static | ||
| 122 | COMPONENT Development | ||
| 123 | EXPORT iostream3StaticExport | ||
| 124 | ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") | ||
| 125 | install( | ||
| 126 | EXPORT iostream3StaticExport | ||
| 127 | FILE iostreamv3-static.cmake | ||
| 128 | NAMESPACE IOSTREAMV3:: | ||
| 129 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3) | ||
| 130 | endif(ZLIB_IOSTREAM3_BUILD_STATIC) | ||
| 131 | |||
| 132 | configure_package_config_file( | ||
| 133 | ${iostreamV3_SOURCE_DIR}/iostream3Config.cmake.in | ||
| 134 | ${iostreamV3_BINARY_DIR}/iostreamv3Config.cmake | ||
| 135 | INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3) | ||
| 136 | |||
| 137 | write_basic_package_version_file( | ||
| 138 | "${iostreamV3_BINARY_DIR}/iostreamv3ConfigVersion.cmake" | ||
| 139 | VERSION "${iostream3_VERSION}" | ||
| 140 | COMPATIBILITY AnyNewerVersion) | ||
| 141 | |||
| 142 | install(FILES ${iostreamV3_BINARY_DIR}/iostreamv3Config.cmake | ||
| 143 | ${iostreamV3_BINARY_DIR}/iostreamv3ConfigVersion.cmake | ||
| 144 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/iostreamv3) | ||
| 145 | install( | ||
| 146 | FILES zfstream.h | ||
| 147 | COMPONENT Development | ||
| 148 | DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | ||
| 149 | endif(ZLIB_IOSTREAM3_INSTALL) | ||
