diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-10-09 22:12:34 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-10-09 22:12:34 (GMT) |
commit | 7d45db99563c83a1a85722b1ee0f1fe10f8967d3 (patch) | |
tree | 5dcb76d8f5029d61278bc84b7dce89fe6a9063d4 /CMakeLists.txt | |
parent | a28b8f95bca8ac99c811fe24cd1e291330a1cd28 (diff) | |
download | CMake-7d45db99563c83a1a85722b1ee0f1fe10f8967d3.zip CMake-7d45db99563c83a1a85722b1ee0f1fe10f8967d3.tar.gz CMake-7d45db99563c83a1a85722b1ee0f1fe10f8967d3.tar.bz2 |
Don't require liblzma when using system libarchive
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 92f641e..827a19c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,19 +383,21 @@ macro (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # 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!") + if(NOT CMAKE_USE_SYSTEM_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() - 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() #--------------------------------------------------------------------- |