summaryrefslogtreecommitdiff
path: root/cmake/submodules.cmake
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.ibm.com>2019-02-13 09:03:12 +1100
committerDaniel Black <daniel@linux.ibm.com>2019-02-13 11:26:08 +1100
commit17c3f147f82ca6f0ea45fa3807e4e770659fbba6 (patch)
treeeb4939bcd1129872c138f26e5c3c5bb2291d3a2d /cmake/submodules.cmake
parent8a9cdc5f44b14466e79630778c5e76d941d28435 (diff)
downloadmariadb-git-17c3f147f82ca6f0ea45fa3807e4e770659fbba6.tar.gz
cmake/submodules: notify user about gitconfig for automatic update
Diffstat (limited to 'cmake/submodules.cmake')
-rw-r--r--cmake/submodules.cmake12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake
index 4181f4cd01e..6e019674c1f 100644
--- a/cmake/submodules.cmake
+++ b/cmake/submodules.cmake
@@ -10,7 +10,12 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE cmake_update_submodules
RESULT_VARIABLE git_config_get_result)
- IF(git_config_get_result EQUAL 128 OR cmake_update_submodules MATCHES no)
+ IF(cmake_update_submodules MATCHES no)
+ SET(update_result 0)
+ SET(SUBMODULE_UPDATE_CONFIG_MESSAGE
+"\n\nTo update submodules automaticly, set cmake.update-submodules to 'yes', or 'force' to update automaticly:
+ ${GIT_EXECUTABLE} config cmake.update-submodules yes")
+ ELSEIF(git_config_get_result EQUAL 128)
SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE(STATUS "Updating submodules (forced)")
@@ -31,7 +36,6 @@ ENDIF()
IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
- git submodule update --init
-Then restart the build.
-")
+ ${GIT_EXECUTABLE} submodule update --init
+Then restart the build.${SUBMODULE_UPDATE_CONFIG_MESSAGE}")
ENDIF()