summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-05 08:09:16 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-12 17:51:52 +0200
commit5ea5a7f7e79d78920fa76527fadfbec0c87f24c8 (patch)
tree72d4b611d659051e3ab33d1b3037d4b1fe7544b2
parent79fa256eb2e5b5bacf4b15ef9dae1d738b2c4669 (diff)
downloadmariadb-git-5ea5a7f7e79d78920fa76527fadfbec0c87f24c8.tar.gz
auto-clone C/C, if possible
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/mariadb_connector_c.cmake14
-rw-r--r--sql/CMakeLists.txt6
3 files changed, 19 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 055be07025d..b51b2965c78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,11 @@ FOREACH(_base
ENDIF()
ENDFOREACH()
+FOREACH(tool gtar tar git)
+ STRING(TOUPPER ${tool} TOOL)
+ FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
+ MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
+ENDFOREACH()
# Following autotools tradition, add preprocessor definitions
# specified in environment variable CPPFLAGS
diff --git a/cmake/mariadb_connector_c.cmake b/cmake/mariadb_connector_c.cmake
index c55dc03830d..cd45ab1a457 100644
--- a/cmake/mariadb_connector_c.cmake
+++ b/cmake/mariadb_connector_c.cmake
@@ -1,3 +1,17 @@
+IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt AND GIT_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule init
+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
+ EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update
+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
+ENDIF()
+IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
+ MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
+ git submodule init
+ git submodule update
+Then restart the build.
+")
+ENDIF()
+
SET(OPT CONC_)
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index e6ccd8938df..3de4ff9abd1 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -320,12 +320,6 @@ IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
ENDIF()
ENDIF()
-FOREACH(tool gtar tar git)
- STRING(TOUPPER ${tool} TOOL)
- FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
- MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
-ENDFOREACH()
-
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in
${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY)