Skip to content

Commit 17c3f14

Browse files
committed
cmake/submodules: notify user about gitconfig for automatic update
1 parent 8a9cdc5 commit 17c3f14

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cmake/submodules.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
1010
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
1111
OUTPUT_VARIABLE cmake_update_submodules
1212
RESULT_VARIABLE git_config_get_result)
13-
IF(git_config_get_result EQUAL 128 OR cmake_update_submodules MATCHES no)
13+
IF(cmake_update_submodules MATCHES no)
14+
SET(update_result 0)
15+
SET(SUBMODULE_UPDATE_CONFIG_MESSAGE
16+
"\n\nTo update submodules automaticly, set cmake.update-submodules to 'yes', or 'force' to update automaticly:
17+
${GIT_EXECUTABLE} config cmake.update-submodules yes")
18+
ELSEIF(git_config_get_result EQUAL 128)
1419
SET(update_result 0)
1520
ELSEIF (cmake_update_submodules MATCHES force)
1621
MESSAGE(STATUS "Updating submodules (forced)")
@@ -31,7 +36,6 @@ ENDIF()
3136

3237
IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
3338
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
34-
git submodule update --init
35-
Then restart the build.
36-
")
39+
${GIT_EXECUTABLE} submodule update --init
40+
Then restart the build.${SUBMODULE_UPDATE_CONFIG_MESSAGE}")
3741
ENDIF()

0 commit comments

Comments
 (0)