From f856e9865c82135074efd26270861b40e3578e7f Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 9 Feb 2020 04:47:13 -0800 Subject: [PATCH 1/3] 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 From 6d2671900b82b1ad2719d68c6d577a7a9f5afa23 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Sun, 9 Feb 2020 04:52:18 -0800 Subject: [PATCH 2/3] also check for xml submodule --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86c68e7..c9ac6c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ 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) +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/src/configparser/CMakeLists.txt OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/cppgtfs/CMakeLists.txt OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/xml/pfxml.h) execute_process( COMMAND git submodule update --init --recursive ) From 3eb5c881fe345e58f771bedfdf5c81c3c39505c3 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Mon, 10 Feb 2020 07:10:46 -0800 Subject: [PATCH 3/3] Detect .git instead of CMakeLists.txt in submods --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9ac6c7..008bd55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,10 +70,10 @@ 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 OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/xml/pfxml.h) - execute_process( - COMMAND git submodule update --init --recursive - ) +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/src/configparser/.git OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/cppgtfs/.git OR NOT EXISTS ${CMAKE_SOURCE_DIR}/src/xml/.git) + execute_process( + COMMAND git submodule update --init --recursive + ) endif() add_subdirectory(src)