[all] cmake: tell users to clone submodules when they haven't

This gives users a command to run that will automagically fix the submodule
situation, and should reduce the amount of support requests.
This commit is contained in:
Quantum 2021-08-18 18:02:33 -04:00 committed by Geoffrey McRae
parent 1021c9ce92
commit 5a906131eb
4 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,7 @@ project(looking-glass-client C CXX)
get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/") list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/")
include(CheckSubmodule)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(FeatureSummary) include(FeatureSummary)

View File

@ -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()

View File

@ -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) get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/") list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/")
include(CheckSubmodule)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(FeatureSummary) include(FeatureSummary)

View File

@ -4,6 +4,7 @@ project(looking-glass-obs C)
get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE) get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/.." ABSOLUTE)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/") list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/")
include(CheckSubmodule)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(FeatureSummary) include(FeatureSummary)