Commit 30d35590 authored by Tor Didriksen's avatar Tor Didriksen

Bug#13713525 CREATE_INITIAL_DB.CMAKE IS FAILING ON WINDOWS, STILL "DEVENV" RETURNS 0

This bug depends on cmake version.

For cmake 2.6 (which is still in use for some pushbuild trees)
the main build would succeed, even if create_initial_db failed.

The problem was the chaining of commands in the CUSTOM_COMMAND
to produce 'initdb.dep'. It first invokes cmake to run mysqld,
then invokes 'touch' to create the file. Moving the 'touch'
command makes the error propagate properly for both cmake 2.6 and 2.8
parent 2943c813
...@@ -69,10 +69,13 @@ EXECUTE_PROCESS( ...@@ -69,10 +69,13 @@ EXECUTE_PROCESS(
COMMAND "@CMAKE_COMMAND@" -E echo Executing ${BOOTSTRAP_COMMAND} COMMAND "@CMAKE_COMMAND@" -E echo Executing ${BOOTSTRAP_COMMAND}
) )
EXECUTE_PROCESS ( EXECUTE_PROCESS (
COMMAND "@CMAKE_COMMAND@" -E echo input file bootstrap.sql, current directory ${CWD} COMMAND "@CMAKE_COMMAND@" -E
echo input file bootstrap.sql, current directory ${CWD}
) )
EXECUTE_PROCESS ( EXECUTE_PROCESS (
COMMAND ${BOOTSTRAP_COMMAND} INPUT_FILE bootstrap.sql OUTPUT_VARIABLE OUT COMMAND ${BOOTSTRAP_COMMAND}
INPUT_FILE bootstrap.sql
OUTPUT_VARIABLE OUT
ERROR_VARIABLE ERR ERROR_VARIABLE ERR
RESULT_VARIABLE RESULT RESULT_VARIABLE RESULT
) )
...@@ -81,3 +84,6 @@ IF(NOT RESULT EQUAL 0) ...@@ -81,3 +84,6 @@ IF(NOT RESULT EQUAL 0)
MESSAGE(FATAL_ERROR "Could not create initial database \n ${OUT} \n ${ERR}") MESSAGE(FATAL_ERROR "Could not create initial database \n ${OUT} \n ${ERR}")
ENDIF() ENDIF()
EXECUTE_PROCESS (
COMMAND "@CMAKE_COMMAND@" -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
)
...@@ -291,15 +291,17 @@ IF(WIN32 AND MYSQLD_EXECUTABLE) ...@@ -291,15 +291,17 @@ IF(WIN32 AND MYSQLD_EXECUTABLE)
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
DEPENDS mysqld DEPENDS mysqld
) )
ADD_CUSTOM_TARGET(initial_database ADD_CUSTOM_TARGET(initial_database
ALL ALL
DEPENDS initdb.dep DEPENDS initdb.dep
) )
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data DESTINATION . INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
COMPONENT DataFiles PATTERN "initdb.dep" EXCLUDE PATTERN "bootstrap.sql" EXCLUDE) DESTINATION .
COMPONENT DataFiles
PATTERN "initdb.dep" EXCLUDE
PATTERN "bootstrap.sql" EXCLUDE)
ELSE() ELSE()
# Not windows or cross compiling, just install an empty directory # Not windows or cross compiling, just install an empty directory
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles) INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
......
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