mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-24 18:32:49 -06:00
Merge pull request #2829 from MerryMage/check_submodules_present
CMakeLists: Check that all submodules are present
This commit is contained in:
commit
308292dfa1
1 changed files with 15 additions and 0 deletions
|
@ -19,6 +19,21 @@ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit)
|
||||||
DESTINATION ${CMAKE_SOURCE_DIR}/.git/hooks)
|
DESTINATION ${CMAKE_SOURCE_DIR}/.git/hooks)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Sanity check : Check that all submodules are present
|
||||||
|
# =======================================================================
|
||||||
|
|
||||||
|
function(check_submodules_present)
|
||||||
|
file(READ "${CMAKE_SOURCE_DIR}/.gitmodules" gitmodules)
|
||||||
|
string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
|
||||||
|
foreach(module ${gitmodules})
|
||||||
|
string(REGEX REPLACE "path *= *" "" module ${module})
|
||||||
|
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git")
|
||||||
|
message(SEND_ERROR "Git submodule ${module} not found."
|
||||||
|
"Please run: git submodule update --init --recursive")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
||||||
|
check_submodules_present()
|
||||||
|
|
||||||
# Detect current compilation architecture and create standard definitions
|
# Detect current compilation architecture and create standard definitions
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
|
|
Loading…
Reference in a new issue