Commit a15d4127 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fixes for cmake2.8

parent 20b785c0
...@@ -19,16 +19,14 @@ SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@") ...@@ -19,16 +19,14 @@ SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
SET(MYSQLD_EXECUTABLE "@MYSQLD_EXECUTABLE@") SET(MYSQLD_EXECUTABLE "@MYSQLD_EXECUTABLE@")
SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@") SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
SET(WIN32 "@WIN32@") SET(WIN32 "@WIN32@")
SET ($ENV{VS_UNICODE_OUTPUT}) # Force Visual Studio to output to stdout
IF(CMAKE_CFG_INTDIR) IF(ENV{VS_UNICODE_OUTPUT})
IF(CONFIG) SET ($ENV{VS_UNICODE_OUTPUT})
MESSAGE(${CONFIG}) ENDIF()
#Resolve build configuration variables IF(CMAKE_CFG_INTDIR AND CONFIG)
STRING(REPLACE "${CMAKE_CFG_INTDIR}" ${CONFIG} MYSQLD_EXECUTABLE #Resolve build configuration variables
"${MYSQLD_EXECUTABLE}") STRING(REPLACE "${CMAKE_CFG_INTDIR}" ${CONFIG} MYSQLD_EXECUTABLE
ELSE() "${MYSQLD_EXECUTABLE}")
MESSAGE(FATAL_ERROR "Please provide CONFIG parameter to the script")
ENDIF()
ENDIF() ENDIF()
# Create bootstrapper SQL script # Create bootstrapper SQL script
...@@ -44,9 +42,8 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql ...@@ -44,9 +42,8 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql
ENDFOREACH() ENDFOREACH()
MAKE_DIRECTORY(data) FILE(REMOVE_RECURSE mysql)
FILE(REMOVE_RECURSE data/mysql) MAKE_DIRECTORY(mysql)
MAKE_DIRECTORY(data/mysql)
IF(WIN32) IF(WIN32)
SET(CONSOLE --console) SET(CONSOLE --console)
ENDIF() ENDIF()
......
...@@ -209,7 +209,8 @@ IF(WIN32) ...@@ -209,7 +209,8 @@ IF(WIN32)
ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN") ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN")
IF (MSVC_VERSION GREATER 1400) IF (MSVC_VERSION GREATER 1400)
# Speed up multiprocessor build # Speed up multiprocessor build
ADD_DEFINITIONS("/MP") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF() ENDIF()
# default to x86 platform. We'll check for X64 in a bit # default to x86 platform. We'll check for X64 in a bit
......
...@@ -76,13 +76,12 @@ SET(FIX_PRIVILEGES_SQL ...@@ -76,13 +76,12 @@ SET(FIX_PRIVILEGES_SQL
) )
# Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts) # Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts)
ADD_CUSTOM_COMMAND( FILE(WRITE ${FIX_PRIVILEGES_SQL} "")
OUTPUT ${FIX_PRIVILEGES_SQL} FOREACH(FILENAME ${FIX_PRIVS_IN})
COMMAND ${CMAKE_COMMAND} "-DIN=${FIX_PRIVS_IN}" "-DOUT=${FIX_PRIVILEGES_SQL}" FILE(READ "${FILENAME}" CONTENTS)
-P "${CMAKE_SOURCE_DIR}/cmake/cat.cmake" FILE(APPEND ${FIX_PRIVILEGES_SQL} "${CONTENTS}")
VERBATIM ENDFOREACH()
DEPENDS ${FIX_PRIVS_IN}
)
# Build mysql_fix_privilege_tables.c # Build mysql_fix_privilege_tables.c
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
...@@ -91,7 +90,7 @@ ADD_CUSTOM_COMMAND( ...@@ -91,7 +90,7 @@ ADD_CUSTOM_COMMAND(
mysql_fix_privilege_tables mysql_fix_privilege_tables
mysql_fix_privilege_tables.sql mysql_fix_privilege_tables.sql
mysql_fix_privilege_tables_sql.c mysql_fix_privilege_tables_sql.c
DEPENDS comp_sql ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql DEPENDS comp_sql
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
) )
......
...@@ -232,11 +232,14 @@ IF(WIN32 AND MYSQLD_EXECUTABLE) ...@@ -232,11 +232,14 @@ IF(WIN32 AND MYSQLD_EXECUTABLE)
@ONLY @ONLY
) )
IF(MSVC_IDE OR CMAKE_GENERATOR MATCHES "Xcode")
SET (CONFIG_PARAM -DCONFIG=${CMAKE_CFG_INTDIR})
ENDIF()
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data) MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/mysql/user.frm OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/data/mysql/user.frm
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-DCONFIG=${CMAKE_CFG_INTDIR} ${CONFIG_PARAM}
-P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
DEPENDS mysqld DEPENDS mysqld
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment