From e62e8d83965f31782a0a938dd25f97059daf9f60 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 27 Mar 2019 10:23:47 -0400 Subject: [PATCH] Add a workspace sanity check Check to make sure that one source file in one of the git submodules is present. If not, throw a fatal error which explains what probably went wrong, and how to fix it: "Missing submodule(s), please 'git clone --recurse-submodules...'" Signed-off-by: Dave Barach --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4962760..cdedf19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/ set(USE_SYSTEM_BOOST OFF CACHE BOOL "Set to ON to use system boost libraries instead of building up to date boost libraries from source") set(USE_SYSTEM_CIMG ON CACHE BOOL "Set to OFF to use CImg library bundled in lib directory") +if (EXISTS "${PROJECT_SOURCE_DIR}/lib/cpp-subprocess/subprocess.hpp") +else() + message (FATAL_ERROR "Missing submodule(s), please 'git clone --recurse-submodules...'") +endif() + # support for ccache # call CMake with -DUSE_CCACHE=ON to make use of it set(USE_CCACHE ON CACHE BOOL "")