diff options
author | TheLastRar <TheLastRar@users.noreply.github.com> | 2022-10-27 22:31:51 +0100 |
---|---|---|
committer | TheLastRar <TheLastRar@users.noreply.github.com> | 2022-11-04 18:11:37 +0000 |
commit | e777c26a14ac4efb0c22557c38ec5cb9f1632368 (patch) | |
tree | 55376184b9749340187b5aa93d7e7df49d6fed51 /CMakeLists.txt | |
parent | 1d38248194d4633327c22c2220299ebb10d0c495 (diff) | |
download | PrismLauncher-e777c26a14ac4efb0c22557c38ec5cb9f1632368.tar.gz PrismLauncher-e777c26a14ac4efb0c22557c38ec5cb9f1632368.tar.bz2 PrismLauncher-e777c26a14ac4efb0c22557c38ec5cb9f1632368.zip |
CMake: Add fallback to bundled ECM
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 08727ae2..d9793485 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,8 +60,20 @@ endif() option(BUILD_TESTING "Build the testing tree." ON) -find_package(ECM REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH};${CMAKE_MODULE_PATH}") +find_package(ECM QUIET NO_MODULE) +if(NOT ECM_FOUND) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") + message(STATUS "Using bundled ECM") + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}") + else() + message(FATAL_ERROR + " Could not find ECM\n \n" + " Either install ECM using the system package manager or clone submodules\n" + " Submodules can be cloned with 'git submodule update --init --recursive'") + endif() +else() + set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH};${CMAKE_MODULE_PATH}") +endif() include(CTest) include(ECMAddTests) if(BUILD_TESTING) |