Commit 9d7ed94f authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

CMake cleanup - simplify create_initial_db.cmake

Also make initial_database optional target on non-Windows, as sometimes
it can be quite handy to bootstrap without MTR.
parent 574d8b29
......@@ -37,8 +37,6 @@ ENDFOREACH()
FILE(READ ${TOP_SRCDIR}/scripts/fill_help_tables.sql CONTENTS)
FILE(APPEND bootstrap.sql "${CONTENTS}")
FILE(REMOVE_RECURSE mysql performance_schema)
FILE(REMOVE ibdata1 ib_logfile0 ib_logfile1)
MAKE_DIRECTORY(mysql)
......@@ -46,13 +44,8 @@ SET(BOOTSTRAP_COMMAND
${MYSQLD_EXECUTABLE}
--no-defaults
--console
--bootstrap
--lc-messages-dir=${BINDIR}/share
--basedir=.
--bootstrap
--datadir=.
--default-storage-engine=MyISAM
--max_allowed_packet=8M
--net_buffer_length=32K
)
GET_FILENAME_COMPONENT(CWD . ABSOLUTE)
......
......@@ -433,16 +433,9 @@ ADD_CUSTOM_TARGET(distclean
VERBATIM
)
IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
# Copy db.opt into data/test/
SET(DBOPT_FILE ${CMAKE_SOURCE_DIR}/support-files/db.opt )
INSTALL(FILES ${DBOPT_FILE} DESTINATION data/test COMPONENT DataFiles)
# Install initial database on windows
IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
IF(MSVC_IDE OR CMAKE_GENERATOR MATCHES "Xcode")
# Install initial database (default on windows, optional target elsewhere)
IF(TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
IF(GENERATOR_IS_MULTI_CONFIG)
SET (CONFIG_PARAM -DCONFIG=${CMAKE_CFG_INTDIR})
ENDIF()
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data)
......@@ -461,15 +454,16 @@ IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
DEPENDS mysqld
)
IF(WIN32)
SET(ALL_ON_WINDOWS ALL)
ELSE()
SET(ALL_ON_WINDOWS)
ENDIF()
ADD_CUSTOM_TARGET(initial_database
ALL
${ALL_ON_WINDOWS}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
)
ELSE()
# Not windows or cross compiling, just install an empty directory
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
ENDIF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
ENDIF(INSTALL_LAYOUT STREQUAL "STANDALONE")
ENDIF()
IF(WIN32)
SET(my_bootstrap_sql ${CMAKE_CURRENT_BINARY_DIR}/my_bootstrap.sql)
......
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