diff options
author | Brad King <brad.king@kitware.com> | 2014-07-29 12:52:08 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-07-29 12:52:08 (GMT) |
commit | 4d574ee3a1a8dcc54835d90d7eab55677deb4cfb (patch) | |
tree | ad01ad56e2f09ac3173d11bba18af79501b7df27 /CMakeLists.txt | |
parent | b6acd96f7fbe4df80e3735b101271cb801ba375a (diff) | |
parent | 65a0ea456d5d92644fe67bbbcbe973df3f111822 (diff) | |
download | CMake-4d574ee3a1a8dcc54835d90d7eab55677deb4cfb.zip CMake-4d574ee3a1a8dcc54835d90d7eab55677deb4cfb.tar.gz CMake-4d574ee3a1a8dcc54835d90d7eab55677deb4cfb.tar.bz2 |
Merge topic 'add-liblzma'
65a0ea45 Help: Add notes for topic 'add-liblzma'
8436d181 CMake: Enable use of liblzma in libarchive (#14504)
73eab246 liblzma: Avoid defining a 'restrict' macro
90e7a4d4 liblzma: Disable warnings to avoid changing 3rd party code
c20b4502 liblzma: Port to VS 6, 7.0
7a92eddb liblzma: Port from C99 to C89/90
b2a07ca4 liblzma: Add CMake build system
d44ad161 liblzma: Remove unused Makefile.* files
a53caea3 liblzma: Add README-CMake.txt
133d42fe Merge branch 'liblzma-upstream' into add-liblzma
c289e634 liblzma 5.0.5-gb69900ed (reduced)
8510533f liblzma: Add .gitattributes to ignore whitespace checks
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e210f74..54aad83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) # Allow the user to enable/disable all system utility library options by # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}. - set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB) + set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE LIBLZMA ZLIB) foreach(util ${UTILITIES}) if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) @@ -93,6 +93,8 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) "${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON) CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2" "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) + CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_LIBLZMA "Use system-installed liblzma" + "${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) # Mention to the user what system libraries are being used. foreach(util ${UTILITIES}) @@ -301,6 +303,23 @@ macro (CMAKE_BUILD_UTILITIES) endif() #--------------------------------------------------------------------- + # Build or use system liblzma for libarchive. + if(CMAKE_USE_SYSTEM_LIBLZMA) + find_package(LibLZMA) + if(NOT LIBLZMA_FOUND) + message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!") + endif() + set(LZMA_INCLUDE_DIR ${LIBLZMA_INCLUDE_DIRS}) + set(LZMA_LIBRARY ${LIBLZMA_LIBRARIES}) + else() + add_subdirectory(Utilities/cmliblzma) + CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty") + set(LZMA_INCLUDE_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api") + set(LZMA_LIBRARY cmliblzma) + endif() + + #--------------------------------------------------------------------- # Build or use system libarchive for CMake and CTest. if(CMAKE_USE_SYSTEM_LIBARCHIVE) find_package(LibArchive) @@ -315,7 +334,7 @@ macro (CMAKE_BUILD_UTILITIES) add_definitions(-DLIBARCHIVE_STATIC) set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") - set(ENABLE_LZMA OFF CACHE INTERNAL "Enable the use of the system found LZMA library if found") + set(ENABLE_LZMA ON CACHE INTERNAL "Enable the use of the system found LZMA library if found") set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system found ZLIB library if found") set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system found BZip2 library if found") set(ENABLE_EXPAT OFF CACHE INTERNAL "Enable the use of the system found EXPAT library if found") |