2016-01-24 13:26:42 -05:00
|
|
|
INCLUDE(FindPkgConfig)
|
|
|
|
PKG_CHECK_MODULES(PC_LZ4 "liblz4")
|
|
|
|
|
|
|
|
FIND_PATH(LZ4_INCLUDE_DIRS
|
|
|
|
NAMES lz4.h
|
|
|
|
HINTS ${PC_LZ4_INCLUDE_DIR}
|
2019-07-25 20:04:42 -04:00
|
|
|
${CMAKE_INSTALL_PREFIX}/include
|
|
|
|
${LIBLZ4_INSTALL_PREFIX}/include
|
|
|
|
PATHS /usr/local/include
|
|
|
|
/usr/include
|
2016-01-24 13:26:42 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
FIND_LIBRARY(LZ4_LIBRARIES
|
|
|
|
NAMES lz4 liblz4
|
|
|
|
HINTS ${PC_LZ4_LIBDIR}
|
2019-07-25 20:04:42 -04:00
|
|
|
${CMAKE_INSTALL_PREFIX}/lib
|
|
|
|
${CMAKE_INSTALL_PREFIX}/lib64
|
|
|
|
PATHS ${LZ4_INCLUDE_DIRS}/../lib
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
2016-01-24 13:26:42 -05:00
|
|
|
)
|
|
|
|
|
2016-11-21 11:48:30 -05:00
|
|
|
if (LZ4_LIBRARIES AND LZ4_INCLUDE_DIRS)
|
|
|
|
set(LIBLZ4_FOUND TRUE CACHE INTERNAL "liblz4 found")
|
|
|
|
message(STATUS "Found liblz4: ${LZ4_INCLUDE_DIRS}, ${LZ4_LIBRARIES}")
|
|
|
|
else (LZ4_LIBRARIES AND LZ4_INCLUDE_DIRS)
|
|
|
|
set(LIBLZ4_FOUND FALSE CACHE INTERNAL "liblz4 found")
|
|
|
|
message(STATUS "liblz4 not found")
|
|
|
|
endif (LZ4_LIBRARIES AND LZ4_INCLUDE_DIRS)
|
|
|
|
|
2016-01-24 13:26:42 -05:00
|
|
|
INCLUDE(FindPackageHandleStandardArgs)
|
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZ4 DEFAULT_MSG LZ4_LIBRARIES LZ4_INCLUDE_DIRS)
|
|
|
|
MARK_AS_ADVANCED(LZ4_LIBRARIES LZ4_INCLUDE_DIRS)
|