diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2014-07-13 20:23:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-29 12:45:36 (GMT) |
commit | 8436d18115a9d997fb92fc7a019da1f28646a2f8 (patch) | |
tree | 1ac085866699c54ccfca23361fc3a5e3c7e695da /Utilities/cmlibarchive/CMakeLists.txt | |
parent | 73eab246fbfad22bcc1b0bb5599f8e0cffb79c0d (diff) | |
download | CMake-8436d18115a9d997fb92fc7a019da1f28646a2f8.zip CMake-8436d18115a9d997fb92fc7a019da1f28646a2f8.tar.gz CMake-8436d18115a9d997fb92fc7a019da1f28646a2f8.tar.bz2 |
CMake: Enable use of liblzma in libarchive (#14504)
Build liblzma as part of CMake or find one on the system. Modify our
port of libarchive to use the liblzma configured for use with CMake.
Diffstat (limited to 'Utilities/cmlibarchive/CMakeLists.txt')
-rw-r--r-- | Utilities/cmlibarchive/CMakeLists.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 9b1533d..87a9c3f 100644 --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt @@ -275,7 +275,6 @@ IF(BZIP2_FOUND) ENDIF(BZIP2_FOUND) MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) -IF(0) # CMake does not need LZMA or LZO2 support in libarchive # # Find LZMA # @@ -291,15 +290,19 @@ IF(LZMA_FOUND) SET(HAVE_LZMA_H 1) INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES}) - # Test if a macro is needed for the library. - TRY_MACRO_FOR_LIBRARY( - "${LZMA_INCLUDE_DIR}" "${LZMA_LIBRARIES}" - COMPILES - "#include <lzma.h>\nint main() {return (int)lzma_version_number(); }" - "WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC") - IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + IF(CMAKE_USE_SYSTEM_LIBLZMA) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${LZMA_INCLUDE_DIR}" "${LZMA_LIBRARIES}" + COMPILES + "#include <lzma.h>\nint main() {return (int)lzma_version_number(); }" + "WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC") + IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + ADD_DEFINITIONS(-DLZMA_API_STATIC) + ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + ELSE() ADD_DEFINITIONS(-DLZMA_API_STATIC) - ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + ENDIF() ELSEIF(LZMADEC_FOUND) SET(HAVE_LIBLZMADEC 1) SET(HAVE_LZMADEC_H 1) @@ -308,6 +311,7 @@ ELSEIF(LZMADEC_FOUND) ELSE(LZMA_FOUND) # LZMA not found and will not be used. ENDIF(LZMA_FOUND) +IF(0) # CMake does not need LZO2 support in libarchive # # Find LZO2 # |