PROJECT(MySql) EXEC_PROGRAM(cscript.exe ${PROJECT_SOURCE_DIR}/win ARGS config-version.js ${PROJECT_SOURCE_DIR}/win/configure.data OUTPUT_VARIABLE out) STRING(REGEX REPLACE ".*DEFINITIONS@ *([^@]*)@.*" \\1 cfg_def ${out}) STRING(REGEX REPLACE ".*HANDLERTONS@ *([^@]*)@.*" \\1 handlertons ${out}) SEPARATE_ARGUMENTS(handlertons) STRING(REGEX REPLACE ".*DEPENDS@ *([^@]*)@.*" \\1 se_deps ${out}) SEPARATE_ARGUMENTS(se_deps) STRING(REGEX REPLACE ".*SUBDIRS@ *([^@]*)@.*" \\1 se_subdirs ${out}) SEPARATE_ARGUMENTS(se_subdirs) ADD_DEFINITIONS(${cfg_def}) # in some places we use DBUG_OFF SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D DBUG_OFF") IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") # replace /MDd with /MTd STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT}) STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT ${CMAKE_C_FLAGS_DEBUG_INIT}) STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) # remove support for Exception handling STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT}) ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") ADD_DEFINITIONS("-D_WINDOWS -D__WIN__") SUBDIRS(vio dbug strings regex mysys extra/yassl extra/yassl/taocrypt extra zlib storage/heap storage/myisam storage/myisammrg client sql server-tools/instance-manager libmysql tests ${se_subdirs})