diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 3f7c9ef2..b29aec99 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -4,6 +4,7 @@ project(looking-glass-client C CXX) get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/") +include(CheckSubmodule) include(GNUInstallDirs) include(CheckCCompilerFlag) include(FeatureSummary) diff --git a/cmake/CheckSubmodule.cmake b/cmake/CheckSubmodule.cmake new file mode 100644 index 00000000..75490b14 --- /dev/null +++ b/cmake/CheckSubmodule.cmake @@ -0,0 +1,8 @@ +if (EXISTS "${PROJECT_TOP}/.git" AND ( + (NOT EXISTS "${PROJECT_TOP}/repos/cimgui/.git") OR + (NOT EXISTS "${PROJECT_TOP}/repos/LGMP/.git") OR + (NOT EXISTS "${PROJECT_TOP}/repos/PureSpice/.git") OR + (NOT EXISTS "${PROJECT_TOP}/repos/cimgui/imgui/.git") +)) + message(FATAL_ERROR "Submodules are not initialized. Run\n\tgit submodule update --init --recursive") +endif() diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index bc6f2db6..ab1a2a6c 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -7,6 +7,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG" CACHE STRING "compiler flag get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/") +include(CheckSubmodule) include(GNUInstallDirs) include(CheckCCompilerFlag) include(FeatureSummary) diff --git a/obs/CMakeLists.txt b/obs/CMakeLists.txt index 1b740654..28feeeed 100644 --- a/obs/CMakeLists.txt +++ b/obs/CMakeLists.txt @@ -4,6 +4,7 @@ project(looking-glass-obs C) get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/") +include(CheckSubmodule) include(GNUInstallDirs) include(CheckCCompilerFlag) include(FeatureSummary)