diff --git a/CMakeLists.txt b/CMakeLists.txt index f79d173a..030c26a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,9 +147,16 @@ if (BUILD_CUDA_LIB) endif(CUDA_FOUND) endif(BUILD_CUDA_LIB) -find_package(PkgConfig REQUIRED) -pkg_check_modules(LZ4 REQUIRED liblz4) -include_directories(${LZ4_INCLUDE_DIRS}) +find_package(lz4 CONFIG) +if(lz4_DIR) + include_directories(${lz4_DIR}/../../../include) + link_directories(${lz4_DIR}/../../../lib) + link_libraries(lz4) +else(lz4_DIR) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LZ4 REQUIRED liblz4) + include_directories(${LZ4_INCLUDE_DIRS}) +endif(lz4_DIR) #set the C/C++ include path to the "include" directory include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src/cpp)