summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-10-30 17:10:56 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-10-30 17:10:56 (GMT)
commitfb51d98562a26b6dcde7d3597938a0b707b6b881 (patch)
treeb42fbfb6b27b7a9e2d5068601f61d80e7033dc79 /CMakeLists.txt
parent0615218bdf3e240e44e539f9eed6c1cf9fbff2d4 (diff)
downloadCMake-fb51d98562a26b6dcde7d3597938a0b707b6b881.zip
CMake-fb51d98562a26b6dcde7d3597938a0b707b6b881.tar.gz
CMake-fb51d98562a26b6dcde7d3597938a0b707b6b881.tar.bz2
Switch to using libarchive from libtar for cpack and cmake -E tar
This allows for a built in bzip and zip capability, so external tools will not be needed for these packagers. The cmake -E tar xf should be able to handle all compression types now as well.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt35
1 files changed, 20 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7223c90..3306011 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,11 +66,6 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON)
- # There is currently no option for system tar because the upstream
- # libtar does not have our modifications to allow reentrant
- # object-oriented use of the library.
- # OPTION(CMAKE_USE_SYSTEM_TAR "Use system-installed tar" OFF)
-
# Mention to the user what system libraries are being used.
FOREACH(util CURL EXPAT XMLRPC ZLIB)
IF(CMAKE_USE_SYSTEM_${util})
@@ -239,21 +234,31 @@ MACRO (CMAKE_BUILD_UTILITIES)
ENDIF(CMAKE_USE_SYSTEM_CURL)
#---------------------------------------------------------------------
- # Build Tar library for CTest.
- SET(CMTAR_ZLIB_HEADER ${CMAKE_ZLIB_HEADER})
- SET(CMTAR_ZLIB_LIBRARIES ${CMAKE_ZLIB_LIBRARIES})
- SET(CMTAR_ZLIB_INCLUDE_DIRS ${CMAKE_ZLIB_INCLUDES})
- SET(CMAKE_TAR_INCLUDES ${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmtar)
- SET(CMAKE_TAR_LIBRARIES cmtar)
- SUBDIRS(Utilities/cmtar)
-
- #---------------------------------------------------------------------
# Build Compress library for CTest.
SET(CMAKE_COMPRESS_INCLUDES
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
SUBDIRS(Utilities/cmcompress)
-
+ IF(CMAKE_USE_SYSTEM_BZIP2)
+ FIND_PACKAGE(BZip2)
+ ELSE()
+ SET(BZIP2_INCLUDE_DIR
+ "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
+ SET(BZIP2_LIBRARIES cmbzip2)
+ SUBDIRS(Utilities/cmbzip2)
+ ENDIF()
+ IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
+ FIND_PACKAGE(libarchive)
+ SET(CMAKE_TAR_LIBRARIES libarchive)
+ ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
+ SET(HAVE_LIBZ 1)
+ SET(HAVE_ZLIB_H 1)
+ SET(BUILD_ARCHIVE_WITHIN_CMAKE TRUE)
+ ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
+ SUBDIRS(Utilities/cmlibarchive)
+ SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
+ ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE)
+
#---------------------------------------------------------------------
# Build expat library for CMake and CTest.
IF(CMAKE_USE_SYSTEM_EXPAT)