diff options
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ad73cf495..9151ff786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -19,6 +19,21 @@ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) | |||
| 19 | DESTINATION ${CMAKE_SOURCE_DIR}/.git/hooks) | 19 | DESTINATION ${CMAKE_SOURCE_DIR}/.git/hooks) |
| 20 | endif() | 20 | endif() |
| 21 | 21 | ||
| 22 | # Sanity check : Check that all submodules are present | ||
| 23 | # ======================================================================= | ||
| 24 | |||
| 25 | function(check_submodules_present) | ||
| 26 | file(READ "${CMAKE_SOURCE_DIR}/.gitmodules" gitmodules) | ||
| 27 | string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules}) | ||
| 28 | foreach(module ${gitmodules}) | ||
| 29 | string(REGEX REPLACE "path *= *" "" module ${module}) | ||
| 30 | if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git") | ||
| 31 | message(SEND_ERROR "Git submodule ${module} not found." | ||
| 32 | "Please run: git submodule update --init --recursive") | ||
| 33 | endif() | ||
| 34 | endforeach() | ||
| 35 | endfunction() | ||
| 36 | check_submodules_present() | ||
| 22 | 37 | ||
| 23 | # Detect current compilation architecture and create standard definitions | 38 | # Detect current compilation architecture and create standard definitions |
| 24 | # ======================================================================= | 39 | # ======================================================================= |