libarchive: Clean up configuration within CMake build

Require ZLIB but skip LZMA and XML support.  Mark ZLIB and ICONV cache
variables advanced.
This commit is contained in:
Brad King 2011-12-21 13:37:22 -05:00
parent b5dd9aa482
commit e00dbe86d9

View File

@ -164,9 +164,9 @@ IF(ZLIB_FOUND)
"#ifndef ZLIB_WINAPI\n#define ZLIB_WINAPI\n#endif\n#include <zlib.h>\nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" "#ifndef ZLIB_WINAPI\n#define ZLIB_WINAPI\n#endif\n#include <zlib.h>\nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }"
ZLIB_WINAPI) ZLIB_WINAPI)
ENDIF(WIN32 AND NOT CYGWIN) ENDIF(WIN32 AND NOT CYGWIN)
ELSE(ZLIB_FOUND)
MESSAGE(FATAL_ERROR "CMake requires zlib to be available to libarchive")
ENDIF(ZLIB_FOUND) ENDIF(ZLIB_FOUND)
MARK_AS_ADVANCED(CLEAR ZLIB_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY)
# #
# Find BZip2 # Find BZip2
# #
@ -179,6 +179,8 @@ IF(BZIP2_FOUND)
ENDIF(BZIP2_FOUND) ENDIF(BZIP2_FOUND)
MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARY) MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARY)
IF(0) # CMake does not need LZMA support in libarchive
# #
# Find LZMA # Find LZMA
# #
@ -194,6 +196,7 @@ ELSEIF(LZMADEC_FOUND)
INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES})
ENDIF(LZMA_FOUND) ENDIF(LZMA_FOUND)
ENDIF()
# #
# Check headers # Check headers
@ -517,6 +520,7 @@ ENDMACRO(CHECK_ICONV TRY_ICONV_CONST)
IF(ENABLE_ICONV) IF(ENABLE_ICONV)
FIND_PATH(ICONV_INCLUDE_DIR iconv.h) FIND_PATH(ICONV_INCLUDE_DIR iconv.h)
MARK_AS_ADVANCED(ICONV_INCLUDE_DIR)
IF(ICONV_INCLUDE_DIR) IF(ICONV_INCLUDE_DIR)
#SET(INCLUDES ${INCLUDES} "iconv.h") #SET(INCLUDES ${INCLUDES} "iconv.h")
SET(HAVE_ICONV_H 1) SET(HAVE_ICONV_H 1)
@ -566,6 +570,7 @@ ELSE(ENABLE_ICONV)
UNSET(LIBICONV_PATH CACHE) UNSET(LIBICONV_PATH CACHE)
ENDIF(ENABLE_ICONV) ENDIF(ENABLE_ICONV)
IF(0) # CMake does not need XML support in libarchive
# #
# Find Libxml2 # Find Libxml2
# #
@ -591,6 +596,7 @@ ELSE(LIBXML2_FOUND)
LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H) LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H)
ENDIF(EXPAT_FOUND) ENDIF(EXPAT_FOUND)
ENDIF(LIBXML2_FOUND) ENDIF(LIBXML2_FOUND)
ENDIF()
# #
# Check functions # Check functions