summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/mroonga/vendor/groonga/CMakeLists.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt
index e27070f9e0c..ee526646c09 100644
--- a/storage/mroonga/vendor/groonga/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/CMakeLists.txt
@@ -361,10 +361,18 @@ if(NOT ${GRN_WITH_LZ4} STREQUAL "no")
pkg_check_modules(LIBLZ4 liblz4)
endif()
if(LIBLZ4_FOUND)
+ # According to CMake documentation, this is the recommended way to force
+ # looking in LIBRARY_DIRS first and in regular system paths otherwise.
+ #
+ # pkg_check_modules does not guarantee that LIBLZ4_LIBRARY_DIRS will be
+ # set. If it's not set we won't find the library without looking through
+ # the regular system paths.
find_library(LZ4_LIBS
- NAMES ${LIBLZ4_LIBRARIES}
- PATHS ${LIBLZ4_LIBRARY_DIRS}
- NO_DEFAULT_PATH)
+ NAMES ${LIBLZ4_LIBRARIES}
+ PATHS ${LIBLZ4_LIBRARY_DIRS}
+ NO_DEFAULT_PATH)
+ find_library(LZ4_LIBS
+ NAMES ${LIBLZ4_LIBRARIES})
set(GRN_WITH_LZ4 TRUE)
else()
if(${GRN_WITH_LZ4} STREQUAL "yes")