diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-10-09 22:08:06 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-10-09 22:08:06 (GMT) |
commit | a28b8f95bca8ac99c811fe24cd1e291330a1cd28 (patch) | |
tree | 8c338b83b54adffaedef124ca7ebad02fe1219e3 /CMakeLists.txt | |
parent | 66c6144cdafcae83fe4c36a4355a67aa69198809 (diff) | |
download | CMake-a28b8f95bca8ac99c811fe24cd1e291330a1cd28.zip CMake-a28b8f95bca8ac99c811fe24cd1e291330a1cd28.tar.gz CMake-a28b8f95bca8ac99c811fe24cd1e291330a1cd28.tar.bz2 |
Don't require libbz2 when using system libarchive
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b4a577c..92f641e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,14 +366,19 @@ macro (CMAKE_BUILD_UTILITIES) set(CMAKE_COMPRESS_LIBRARIES "cmcompress") add_subdirectory(Utilities/cmcompress) CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty") - if(CMAKE_USE_SYSTEM_BZIP2) - find_package(BZip2) - else() - set(BZIP2_INCLUDE_DIR - "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2") - set(BZIP2_LIBRARIES cmbzip2) - add_subdirectory(Utilities/cmbzip2) - CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") + + #--------------------------------------------------------------------- + # Build or use system libbz2 for libarchive. + if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE) + if(CMAKE_USE_SYSTEM_BZIP2) + find_package(BZip2) + else() + set(BZIP2_INCLUDE_DIR + "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2") + set(BZIP2_LIBRARIES cmbzip2) + add_subdirectory(Utilities/cmbzip2) + CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") + endif() endif() #--------------------------------------------------------------------- |