Add lz4 detection for CMake configuration.

This commit is contained in:
Michihiro NAKAJIMA committed 2014-07-06 13:40:53 +09:00
1 parent e58062c975
commit 07e5668348
2 files changed
+36

No files matched your search

+27
View File
@@ -466,6 +466,33 @@ IF(LZO2_FOUND)
ENDIF(LZO2_FOUND)
MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY)
#
# Find LZ4
#
IF (LZ4_INCLUDE_DIR)
# Already in cache, be silent
SET(LZ4_FIND_QUIETLY TRUE)
ENDIF (LZ4_INCLUDE_DIR)
FIND_PATH(LZ4_INCLUDE_DIR lz4.h)
FIND_LIBRARY(LZ4_LIBRARY NAMES lz4 liblz4)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR)
IF(LZ4_FOUND)
SET(HAVE_LIBLZ4 1)
SET(HAVE_LZ4_H 1)
CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
SET(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR})
CHECK_INCLUDE_FILES("lz4hc.h" HAVE_LZ4HC_H)
CMAKE_POP_CHECK_STATE() # Restore the state of the variables
INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${LZ4_LIBRARY})
#
# TODO: test for static library.
#
ENDIF(LZ4_FOUND)
MARK_AS_ADVANCED(CLEAR LZ4_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR LZ4_LIBRARY)
#
# Check headers
+9
View File
@@ -585,6 +585,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `gcc' library (-lgcc). */
#cmakedefine HAVE_LIBGCC 1
/* Define to 1 if you have the `lz4' library (-llz4). */
#cmakedefine HAVE_LIBLZ4 1
/* Define to 1 if you have the `lzma' library (-llzma). */
#cmakedefine HAVE_LIBLZMA 1
@@ -676,6 +679,12 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `lutimes' function. */
#cmakedefine HAVE_LUTIMES 1
/* Define to 1 if you have the <lz4hc.h> header file. */
#cmakedefine HAVE_LZ4HC_H 1
/* Define to 1 if you have the <lz4.h> header file. */
#cmakedefine HAVE_LZ4_H 1
/* Define to 1 if you have the <lzmadec.h> header file. */
#cmakedefine HAVE_LZMADEC_H 1