From f856e9865c82135074efd26270861b40e3578e7f Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 9 Feb 2020 04:47:13 -0800 Subject: [PATCH] CMakeLists.txt: download submodules if needed Download git submodules if the CMakeLists.txt files for the configparser or cppgtfs directories are not present. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbaf775..86c68e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,14 @@ else() set(VERSION_GIT_FULL "${VERSION_GIT}-${VERSION_GIT_IS_DIRTY}") endif() +# Download submodules if needed + +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/src/configparser/CMakeLists.txt OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/cppgtfs/CMakeLists.txt) + execute_process( + COMMAND git submodule update --init --recursive + ) +endif() + add_subdirectory(src) # tests