null+****@clear*****
null+****@clear*****
2012年 4月 16日 (月) 23:16:39 JST
Kouhei Sutou 2012-04-16 23:16:39 +0900 (Mon, 16 Apr 2012) New Revision: 60e5df7dba75ba370829f3fd9062f3f5ad62e44a Log: cmake: fix variable define order MYSQL_INCLUDE_DIRS should be defined before include_directories(). Modified files: CMakeLists.txt Modified: CMakeLists.txt (+23 -23) =================================================================== --- CMakeLists.txt 2012-04-16 23:11:27 +0900 (25450f7) +++ CMakeLists.txt 2012-04-16 23:16:39 +0900 (48972c6) @@ -38,6 +38,29 @@ read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/lib/libmrn_need_mysql_sources.am string(REGEX REPLACE "([^;]+)" "lib/\\1" LIBMRN_NEED_MYSQL_SOURCES "${LIBMRN_NEED_MYSQL_SOURCES}") +set(MYSQL_SOURCE_DIR "PATH" CACHE PATH "MySQL source directory") +set(MYSQL_INCLUDE_DIRS + "${MYSQL_SOURCE_DIR}/sql" + "${MYSQL_SOURCE_DIR}/include" + "${MYSQL_SOURCE_DIR}/regex" + "${MYSQL_SOURCE_DIR}" + CACHE INTERNAL "MySQL include directories") + +set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR} CACHE PATH "MySQL build directory") + +set(MYSQL_CONFIG "PATH" CACHE PATH "mysql-config command path") +find_path(MYSQL_CONFIG "${MYSQL_CONFIG}") + +macro(SET_MYSQL_CONFIG_VALUE OPTION VARIABLE) + execute_process(COMMAND "${MYSQL_CONFIG}" ${OPTION} + OUTPUT_VARIABLE MYSQL_CONFIG_OUTPUT) + string(STRIP ${MYSQL_CONFIG_OUTPUT} ${VARIABLE}) +endmacro() + +set_mysql_config_value("--plugindir" MYSQL_PLUGIN_DIR) +set_mysql_config_value("--cflags" MYSQL_CFLAGS) +set_mysql_config_value("--version" MYSQL_VERSION) + include(FindPkgConfig) pkg_check_modules(GROONGA REQUIRED "groonga >= 2.0.0") @@ -88,29 +111,6 @@ if(DISABLE_FAST_MUTEXES) COMPILE_DEFINITIONS "FORCE_FAST_MUTEX_DISABLED=1") endif() -set(MYSQL_SOURCE_DIR "PATH" CACHE PATH "MySQL source directory") -set(MYSQL_INCLUDE_DIRS - "${MYSQL_SOURCE_DIR}/sql" - "${MYSQL_SOURCE_DIR}/include" - "${MYSQL_SOURCE_DIR}/regex" - "${MYSQL_SOURCE_DIR}" - CACHE INTERNAL "MySQL include directories") - -set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR} CACHE PATH "MySQL build directory") - -set(MYSQL_CONFIG "PATH" CACHE PATH "mysql-config command path") -find_path(MYSQL_CONFIG "${MYSQL_CONFIG}") - -macro(SET_MYSQL_CONFIG_VALUE OPTION VARIABLE) - execute_process(COMMAND "${MYSQL_CONFIG}" ${OPTION} - OUTPUT_VARIABLE MYSQL_CONFIG_OUTPUT) - string(STRIP ${MYSQL_CONFIG_OUTPUT} ${VARIABLE}) -endmacro() - -set_mysql_config_value("--plugindir" MYSQL_PLUGIN_DIR) -set_mysql_config_value("--cflags" MYSQL_CFLAGS) -set_mysql_config_value("--version" MYSQL_VERSION) - set(DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser") install(TARGETS ha_mroonga DESTINATION "${MYSQL_PLUGIN_DIR}")