From d6b811fb8253ffa00bc36cba8b70b2b2f59eaf7c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Feb 2022 17:43:55 -0500 Subject: Require CMake 3.13+ to configure CMake itself In particular, guarantee that policy `CMP0077` has `NEW` behavior. This will be useful to hard-code options of third-party libraries without polluting our own cache. --- CMakeLists.txt | 2 +- Utilities/Doxygen/CMakeLists.txt | 2 +- Utilities/Sphinx/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2038958..547c32d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -cmake_minimum_required(VERSION 3.1...3.22 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.22 FATAL_ERROR) set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake) set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake) diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index d32947b..b712c27 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeDeveloperReference_STANDALONE 1) - cmake_minimum_required(VERSION 3.1...3.22 FATAL_ERROR) + cmake_minimum_required(VERSION 3.13...3.22 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index b8b244d..a2c7060 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT CMake_SOURCE_DIR) set(CMakeHelp_STANDALONE 1) - cmake_minimum_required(VERSION 3.1...3.22 FATAL_ERROR) + cmake_minimum_required(VERSION 3.13...3.22 FATAL_ERROR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) -- cgit v0.12 From 14eb8a6ab98618fcf8550e1da2a8ff07b1aa26dc Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Feb 2022 17:51:18 -0500 Subject: libarchive: Simplify hard-coded options for build within CMake Take advantage of policy CMP0077 NEW behavior to hard-code settings, defined by `option()` calls in upstream libarchive, without adding them to our cache. --- CMakeLists.txt | 59 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 547c32d..9de5338 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -606,38 +606,37 @@ macro (CMAKE_BUILD_UTILITIES) set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) add_definitions(-DLIBARCHIVE_STATIC) - # FIXME: Once CMake 3.13+ is required, drop CACHE and use CMP0077. - set(ENABLE_MBEDTLS OFF CACHE INTERNAL "libarchive: No mbed TLS") - set(ENABLE_NETTLE OFF CACHE INTERNAL "libarchive: No Nettle") + set(ENABLE_MBEDTLS OFF) + set(ENABLE_NETTLE OFF) if(DEFINED CMAKE_USE_OPENSSL) - set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "libarchive: Use OpenSSL?") + set(ENABLE_OPENSSL "${CMAKE_USE_OPENSSL}") else() - set(ENABLE_OPENSSL OFF CACHE INTERNAL "libarchive: Use OpenSSL?") - endif() - set(ENABLE_LIBB2 OFF CACHE INTERNAL "libarchive: No LIBB2") - set(ENABLE_LZ4 OFF CACHE INTERNAL "libarchive: No LZ4") - set(ENABLE_LZO OFF CACHE INTERNAL "libarchive: No LZO") - set(ENABLE_LZMA ON CACHE INTERNAL "libarchive: Use LZMA") - set(ENABLE_ZSTD ON CACHE INTERNAL "libarchive: Use ZSTD") - set(ENABLE_ZLIB ON CACHE INTERNAL "libarchive: Use ZLIB") - set(ENABLE_BZip2 ON CACHE INTERNAL "libarchive: Use BZip2") - set(ENABLE_LIBXML2 OFF CACHE INTERNAL "libarchive: No LibXML2") - set(ENABLE_EXPAT OFF CACHE INTERNAL "libarchive: No Expat") - set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "libarchive: No PCREPOSIX") - set(ENABLE_LibGCC OFF CACHE INTERNAL "libarchive: No LibGCC") - set(ENABLE_CNG OFF CACHE INTERNAL "libarchive: No CNG") - set(ENABLE_TAR OFF CACHE INTERNAL "libarchive: No tar command-line tool") - set(ENABLE_TAR_SHARED OFF CACHE INTERNAL "libarchive: No tar command-line tool") - set(ENABLE_CPIO OFF CACHE INTERNAL "libarchive: No cpio command-line tool") - set(ENABLE_CPIO_SHARED OFF CACHE INTERNAL "libarchive: No cpio command-line tool") - set(ENABLE_CAT OFF CACHE INTERNAL "libarchive: No cat command-line tool") - set(ENABLE_CAT_SHARED OFF CACHE INTERNAL "libarchive: No cat command-line tool") - set(ENABLE_XATTR OFF CACHE INTERNAL "libarchive: No extended attribute support") - set(ENABLE_ACL OFF CACHE INTERNAL "libarchive: No ACL support") - set(ENABLE_ICONV OFF CACHE INTERNAL "libarchive: No iconv support") - set(ENABLE_TEST OFF CACHE INTERNAL "libarchive: No tests") - set(ENABLE_COVERAGE OFF CACHE INTERNAL "libarchive: No coverage") - set(ENABLE_INSTALL OFF CACHE INTERNAL "libarchive: No installation") + set(ENABLE_OPENSSL OFF) + endif() + set(ENABLE_LIBB2 OFF) + set(ENABLE_LZ4 OFF) + set(ENABLE_LZO OFF) + set(ENABLE_LZMA ON) + set(ENABLE_ZSTD ON) + set(ENABLE_ZLIB ON) + set(ENABLE_BZip2 ON) + set(ENABLE_LIBXML2 OFF) + set(ENABLE_EXPAT OFF) + set(ENABLE_PCREPOSIX OFF) + set(ENABLE_LibGCC OFF) + set(ENABLE_CNG OFF) + set(ENABLE_TAR OFF) + set(ENABLE_TAR_SHARED OFF) + set(ENABLE_CPIO OFF) + set(ENABLE_CPIO_SHARED OFF) + set(ENABLE_CAT OFF) + set(ENABLE_CAT_SHARED OFF) + set(ENABLE_XATTR OFF) + set(ENABLE_ACL OFF) + set(ENABLE_ICONV OFF) + set(ENABLE_TEST OFF) + set(ENABLE_COVERAGE OFF) + set(ENABLE_INSTALL OFF) set(POSIX_REGEX_LIB "" CACHE INTERNAL "libarchive: No POSIX regular expression support") set(ENABLE_SAFESEH "" CACHE INTERNAL "libarchive: No /SAFESEH linker flag") set(WINDOWS_VERSION "WIN7" CACHE INTERNAL "libarchive: Set Windows version to use (Windows only)") -- cgit v0.12