summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-16 08:06:23 -0500
committerBrad King <brad.king@kitware.com>2022-02-17 07:28:09 -0500
commitbe9ebc104a2cfe74dec296624ddb66fe7a56949f (patch)
tree1bea9483e3d71d9786f7dc658d77115e70301c85 /CMakeLists.txt
parent4a7a5718c62ad639097a327bd08a85cdf0b35ce1 (diff)
downloadcmake-be9ebc104a2cfe74dec296624ddb66fe7a56949f.tar.gz
libarchive: Simplify code selecting CMake-specific build options
Reduce differences from upstream libarchive `CMakeLists.txt` code. Remove modifications inside code we disable anyway.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt54
1 files changed, 35 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ffb93b6122..20389583da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -606,25 +606,41 @@ macro (CMAKE_BUILD_UTILITIES)
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
add_definitions(-DLIBARCHIVE_STATIC)
- set(ENABLE_MBEDTLS OFF CACHE INTERNAL "Enable use of mbed TLS")
- set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
- set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
- set(ENABLE_LIBB2 OFF CACHE INTERNAL "Enable the use of the system LIBB2 library if found")
- set(ENABLE_LZMA ON CACHE INTERNAL "Enable the use of the system LZMA library if found")
- set(ENABLE_LZ4 OFF CACHE INTERNAL "Enable the use of the system LZ4 library if found")
- set(ENABLE_LZO OFF CACHE INTERNAL "Enable the use of the system LZO library if found")
- set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system ZLIB library if found")
- set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system BZip2 library if found")
- set(ENABLE_ZSTD ON CACHE INTERNAL "Enable the use of the system zstd library if found")
- set(ENABLE_LIBXML2 OFF CACHE INTERNAL "Enable the use of the system libxml2 library if found")
- set(ENABLE_EXPAT OFF CACHE INTERNAL "Enable the use of the system EXPAT library if found")
- set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "Enable the use of the system PCREPOSIX library if found")
- set(ENABLE_LibGCC OFF CACHE INTERNAL "Enable the use of the system LibGCC library if found")
- set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
- set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
- set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
- set(ENABLE_CNG OFF CACHE INTERNAL "Enable the use of CNG(Crypto Next Generation)")
- SET(POSIX_REGEX_LIB "" CACHE INTERNAL "Choose what library should provide POSIX regular expression support")
+ # 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")
+ if(DEFINED CMAKE_USE_OPENSSL)
+ set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "libarchive: 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(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)")
add_subdirectory(Utilities/cmlibarchive)
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})