summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-03 18:37:54 (GMT)
committerBrad King <brad.king@kitware.com>2014-04-03 19:02:49 (GMT)
commit2f1978632b709a9370b3cb1137375c05351d149c (patch)
tree85980710818211b8188709643e6714e8839feee9 /Utilities/cmlibarchive/CMakeLists.txt
parent23e4666cf57c31c719472debba83a43f54d351d8 (diff)
parent64713ae3ffddf6fbbfa7ea762c3d756cb245a066 (diff)
downloadCMake-2f1978632b709a9370b3cb1137375c05351d149c.zip
CMake-2f1978632b709a9370b3cb1137375c05351d149c.tar.gz
CMake-2f1978632b709a9370b3cb1137375c05351d149c.tar.bz2
Merge branch 'libarchive-upstream' into update-libarchive
Resolve conflicts in favor of the upstream side where possible. Resolve a logical conflict in archive_windows.h where the upstream port to Watcom was done slightly differently from ours.
Diffstat (limited to 'Utilities/cmlibarchive/CMakeLists.txt')
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt66
1 files changed, 43 insertions, 23 deletions
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 132bfeb..75a4fd5 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -32,7 +32,7 @@ SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}")
SET(LIBARCHIVE_VERSION_STRING "${VERSION}")
# INTERFACE_VERSION increments with every release
-# libarchive 2.7 == interface version 9 = 2 + 7
+# libarchive 2.7 == interface version 9 = 2 + 7
# libarchive 2.8 == interface version 10 = 2 + 8
# libarchive 2.9 == interface version 11 = 2 + 9
# libarchive 3.0 == interface version 12
@@ -69,9 +69,22 @@ include(CTest)
OPTION(ENABLE_NETTLE "Enable use of Nettle" ON)
OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
+OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON)
+OPTION(ENABLE_ZLIB "Enable the use of the system found ZLIB library if found" ON)
+OPTION(ENABLE_BZip2 "Enable the use of the system found BZip2 library if found" ON)
+OPTION(ENABLE_EXPAT "Enable the use of the system found EXPAT library if found" ON)
+OPTION(ENABLE_PCREPOSIX "Enable the use of the system found PCREPOSIX library if found" ON)
+OPTION(ENABLE_LibGCC "Enable the use of the system found LibGCC library if found" ON)
+
+OPTION(ENABLE_TAR "Enable tar building" ON)
+OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" FALSE)
+OPTION(ENABLE_CPIO "Enable cpio building" ON)
+OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" FALSE)
OPTION(ENABLE_XATTR "Enable extended attribute support" ON)
OPTION(ENABLE_ACL "Enable ACL support" ON)
OPTION(ENABLE_ICONV "Enable iconv support" ON)
+OPTION(ENABLE_TEST "Enable unit and regression tests" ON)
+OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE)
IF(WIN32)
IF(MSVC60)
@@ -190,7 +203,7 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}")
#--- zconf.h.orig 2005-07-21 00:40:26.000000000
#+++ zconf.h 2009-01-19 11:39:10.093750000
#@@ -286,7 +286,7 @@
- #
+ #
# #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */
# # include <sys/types.h> /* for off_t */
#-# include <unistd.h> /* for SEEK_* and off_t */
@@ -204,7 +217,11 @@ SET(ADDITIONAL_LIBS "")
#
# Find ZLIB
#
-FIND_PACKAGE(ZLIB)
+IF(ENABLE_ZLIB)
+ FIND_PACKAGE(ZLIB)
+ELSE()
+ SET(ZLIB_FOUND FALSE) # Override cached value
+ENDIF()
IF(ZLIB_FOUND)
SET(HAVE_LIBZ 1)
SET(HAVE_ZLIB_H 1)
@@ -239,7 +256,11 @@ ENDIF(ZLIB_FOUND)
#
# Find BZip2
#
-FIND_PACKAGE(BZip2)
+IF(ENABLE_BZip2)
+ FIND_PACKAGE(BZip2)
+ELSE()
+ SET(BZIP2_FOUND FALSE) # Override cached value
+ENDIF()
IF(BZIP2_FOUND)
SET(HAVE_LIBBZ2 1)
SET(HAVE_BZLIB_H 1)
@@ -263,7 +284,13 @@ IF(0) # CMake does not need LZMA or LZO2 support in libarchive
#
# Find LZMA
#
-FIND_PACKAGE(LZMA)
+IF(ENABLE_LZMA)
+ FIND_PACKAGE(LZMA)
+ELSE()
+ SET(LZMA_FOUND FALSE) # Override cached value
+ SET(LZMADEC_FOUND FALSE) # Override cached value
+ENDIF()
+
IF(LZMA_FOUND)
SET(HAVE_LIBLZMA 1)
SET(HAVE_LZMA_H 1)
@@ -283,6 +310,8 @@ ELSEIF(LZMADEC_FOUND)
SET(HAVE_LZMADEC_H 1)
INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES})
+ELSE(LZMA_FOUND)
+# LZMA not found and will not be used.
ENDIF(LZMA_FOUND)
#
# Find LZO2
@@ -510,16 +539,10 @@ main(int argc, char **argv)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}")
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}")
- IF(CMAKE_REQUIRED_LINKER_FLAGS)
- SET(CHECK_CRYPTO_ADD_LINKER_FLAGS
- "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
- ELSE(CMAKE_REQUIRED_LINKER_FLAGS)
- SET(CHECK_CRYPTO_ADD_LINKER_FLAGS)
- ENDIF(CMAKE_REQUIRED_LINKER_FLAGS)
TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c
- CMAKE_FLAGS ${CHECK_CRYPTO_ADD_LINKER_FLAGS}
+ CMAKE_FLAGS
"${TRY_CRYPTO_REQUIRED_LIBS}"
"${TRY_CRYPTO_REQUIRED_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
@@ -604,16 +627,10 @@ main(int argc, char **argv)
FILE(WRITE "${SOURCE_FILE}" "${SOURCE}")
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN")
- IF(CMAKE_REQUIRED_LINKER_FLAGS)
- SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS
- "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
- ELSE(CMAKE_REQUIRED_LINKER_FLAGS)
- SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS)
- ENDIF(CMAKE_REQUIRED_LINKER_FLAGS)
TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN
${CMAKE_BINARY_DIR}
${SOURCE_FILE}
- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" ${CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS}
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive"
OUTPUT_VARIABLE OUTPUT)
IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
@@ -1030,13 +1047,13 @@ CHECK_TYPE_SIZE("unsigned long long" SIZE_OF_UNSIGNED_LONG_LONG)
CHECK_TYPE_SIZE("__int64" __INT64)
CHECK_TYPE_SIZE("unsigned __int64" UNSIGNED___INT64)
-CHECK_TYPE_SIZE(int16_t INT16_T)
+CHECK_TYPE_SIZE(int16_t INT16_T)
CHECK_TYPE_SIZE(int32_t INT32_T)
CHECK_TYPE_SIZE(int64_t INT64_T)
CHECK_TYPE_SIZE(intmax_t INTMAX_T)
-CHECK_TYPE_SIZE(uint8_t UINT8_T)
-CHECK_TYPE_SIZE(uint16_t UINT16_T)
-CHECK_TYPE_SIZE(uint32_t UINT32_T)
+CHECK_TYPE_SIZE(uint8_t UINT8_T)
+CHECK_TYPE_SIZE(uint16_t UINT16_T)
+CHECK_TYPE_SIZE(uint32_t UINT32_T)
CHECK_TYPE_SIZE(uint64_t UINT64_T)
CHECK_TYPE_SIZE(uintmax_t UINTMAX_T)
@@ -1279,6 +1296,9 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+# Handle generation of the libarchive.pc file for pkg-config
+INCLUDE(CreatePkgConfigFile)
+
#
# Register installation of PDF documents.
#