Kouhei Sutou
null+****@clear*****
Tue Nov 21 00:44:40 JST 2017
Kouhei Sutou 2017-11-21 00:44:40 +0900 (Tue, 21 Nov 2017) New Revision: 0f44df56ec333cce765276fd1de10149981c1151 https://github.com/groonga/groonga/commit/0f44df56ec333cce765276fd1de10149981c1151 Message: cmake: fix LZ4 and MessagePack detection https://github.com/MariaDB/server/commit/8b18a44fa7e5ddf6c8caee37de4f6112c64dfc87 > fix LZ4 detection on Mac OS X and FreeBSD. Cannot do > > pkg_check_modules(LIBLZ4 liblz4) > find_library(LIBLZ4_LIBS ... ) > > because find_library(X) does not do anything if X is defined (documented), > and pkg_check_modules(Y) sets Y_LIBS to "" (undocumented!) Reported by Sergei Golubchik. Thanks!!! Modified files: CMakeLists.txt Modified: CMakeLists.txt (+20 -8) =================================================================== --- CMakeLists.txt 2017-11-20 16:22:06 +0900 (b674ecf8b) +++ CMakeLists.txt 2017-11-21 00:44:40 +0900 (ccb83c0ea) @@ -384,12 +384,18 @@ if(NOT ${GRN_WITH_LZ4} STREQUAL "no") else() if(NOT DEFINED LIBLZ4_FOUND) pkg_check_modules(LIBLZ4 liblz4) + unset(LIBLZ4_LIBS CACHE) endif() if(LIBLZ4_FOUND) - find_library(LIBLZ4_LIBS - NAMES ${LIBLZ4_LIBRARIES} - PATHS ${LIBLZ4_LIBRARY_DIRS} - NO_DEFAULT_PATH) + if(${LIBLZ4_LIBRARY_DIRS}) + find_library(LIBLZ4_LIBS + NAMES ${LIBLZ4_LIBRARIES} + PATHS ${LIBLZ4_LIBRARY_DIRS} + NO_DEFAULT_PATH) + else() + find_library(LIBLZ4_LIBS + NAMES ${LIBLZ4_LIBRARIES}) + endif() set(GRN_WITH_LZ4 TRUE) else() if(${GRN_WITH_LZ4} STREQUAL "yes") @@ -570,12 +576,18 @@ if(NOT ${GRN_WITH_MESSAGE_PACK} STREQUAL "no") else() if(NOT DEFINED MESSAGE_PACK_FOUND) pkg_check_modules(MESSAGE_PACK msgpack) + unset(MESSAGE_PACK_LIBS CACHE) endif() if(MESSAGE_PACK_FOUND) - find_library(MESSAGE_PACK_LIBS - NAMES ${MESSAGE_PACK_LIBRARIES} - PATHS ${MESSAGE_PACK_LIBRARY_DIRS} - NO_DEFAULT_PATH) + if(${MESSAGE_PACK_LIBRARY_DIRS}) + find_library(MESSAGE_PACK_LIBS + NAMES ${MESSAGE_PACK_LIBRARIES} + PATHS ${MESSAGE_PACK_LIBRARY_DIRS} + NO_DEFAULT_PATH) + else() + find_library(MESSAGE_PACK_LIBS + NAMES ${MESSAGE_PACK_LIBRARIES}) + endif() set(GRN_WITH_MESSAGE_PACK TRUE) else() if("${GRN_WITH_MESSAGE_PACK}" STREQUAL "yes" OR -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171121/81fa3507/attachment-0001.htm