diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-09 11:16:42 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-09 11:16:42 +0200 |
commit | 8fe9ef1bfb6264eab956c98e154891400ec9fe36 (patch) | |
tree | a792a01d188053d76dab2d5a010aae13525e897c | |
parent | 1f5add513316b9f7544fe61631f76d4a61cf586e (diff) |
CMake: Ensure the submodule is up to date
It remains to be seen if this is a sufficient safeguard.
IssueID #197
-rw-r--r-- | Depends.cmake | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Depends.cmake b/Depends.cmake index b4dacf7c..c379fc6d 100644 --- a/Depends.cmake +++ b/Depends.cmake | |||
@@ -7,7 +7,22 @@ if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) | |||
7 | set (INSTALL_THE_FOUNDATION YES) | 7 | set (INSTALL_THE_FOUNDATION YES) |
8 | find_package (the_Foundation REQUIRED) | 8 | find_package (the_Foundation REQUIRED) |
9 | else () | 9 | else () |
10 | set (INSTALL_THE_FOUNDATION NO) | 10 | if (EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/.git) |
11 | # the_Foundation is checked out as a submodule, make sure it's up to date. | ||
12 | find_package (Git) | ||
13 | if (GIT_FOUND) | ||
14 | execute_process ( | ||
15 | COMMAND ${GIT_EXECUTABLE} submodule update | ||
16 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
17 | OUTPUT_VARIABLE subout | ||
18 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
19 | ) | ||
20 | if (subout) | ||
21 | message (FATAL_ERROR "The 'lib/the_Foundation' submodule has been updated, please re-run CMake.\n") | ||
22 | endif () | ||
23 | endif () | ||
24 | endif () | ||
25 | set (INSTALL_THE_FOUNDATION OFF) | ||
11 | set (TFDN_STATIC_LIBRARY ON CACHE BOOL "") | 26 | set (TFDN_STATIC_LIBRARY ON CACHE BOOL "") |
12 | set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "") | 27 | set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "") |
13 | set (TFDN_ENABLE_TESTS OFF CACHE BOOL "") | 28 | set (TFDN_ENABLE_TESTS OFF CACHE BOOL "") |