null+****@clear*****
null+****@clear*****
2012年 5月 20日 (日) 16:31:55 JST
Kouhei Sutou 2012-05-20 16:31:55 +0900 (Sun, 20 May 2012) New Revision: 2420c623c02489b781c4601abb4079c7f48dcdba Log: cmake: check -DMYSQL_CFLAGS instead of -DMYSQL_CONFIG Modified files: CMakeLists.txt Modified: CMakeLists.txt (+8 -8) =================================================================== --- CMakeLists.txt 2012-05-20 16:26:54 +0900 (6b16124) +++ CMakeLists.txt 2012-05-20 16:31:55 +0900 (df8ac90) @@ -56,16 +56,16 @@ 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}) + if(NOT ${VARIABLE}) + execute_process(COMMAND "${MYSQL_CONFIG}" ${OPTION} + OUTPUT_VARIABLE MYSQL_CONFIG_OUTPUT) + string(STRIP ${MYSQL_CONFIG_OUTPUT} ${VARIABLE}) + endif() endmacro() -if(MYSQL_CONFIG) - set_mysql_config_value("--plugindir" MYSQL_PLUGIN_DIR) - set_mysql_config_value("--cflags" MYSQL_CFLAGS) - set_mysql_config_value("--version" MYSQL_VERSION) -endif() +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 >= ${REQUIRED_GROONGA_VERSION}")