Commit 10cc8bbd authored by Jan Lindström's avatar Jan Lindström Committed by GitHub

Merge pull request #1181 from grooverdan/10.2-submodule-update

cmake/submodules: notify user about gitconfig for automatic update
parents 8a9cdc5f 43a7409b
...@@ -10,7 +10,12 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git") ...@@ -10,7 +10,12 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE cmake_update_submodules OUTPUT_VARIABLE cmake_update_submodules
RESULT_VARIABLE git_config_get_result) 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 automatically, set cmake.update-submodules to 'yes', or 'force' to update automatically:
${GIT_EXECUTABLE} config cmake.update-submodules yes")
ELSEIF(git_config_get_result EQUAL 128)
SET(update_result 0) SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force) ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE(STATUS "Updating submodules (forced)") MESSAGE(STATUS "Updating submodules (forced)")
...@@ -31,7 +36,6 @@ ENDIF() ...@@ -31,7 +36,6 @@ ENDIF()
IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt) IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
git submodule update --init ${GIT_EXECUTABLE} submodule update --init
Then restart the build. Then restart the build.${SUBMODULE_UPDATE_CONFIG_MESSAGE}")
")
ENDIF() ENDIF()
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