summaryrefslogtreecommitdiff
path: root/sql/CMakeLists.txt
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2020-03-11 10:58:53 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2020-03-11 10:58:53 +0100
commit9d7ed94f6a526748eff29dae2939a3fd341f118b (patch)
tree186b3050ffeb859393d9753efa63a13f8c5ab122 /sql/CMakeLists.txt
parent574d8b29402f9826f73eeb54a3b9cc406268710c (diff)
downloadmariadb-git-9d7ed94f6a526748eff29dae2939a3fd341f118b.tar.gz
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.
Diffstat (limited to 'sql/CMakeLists.txt')
-rw-r--r--sql/CMakeLists.txt26
1 files changed, 10 insertions, 16 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index da046d0ec3a..d0a3e8a437a 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -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)