diff --git a/CMakeLists.txt b/CMakeLists.txt index 960f9a734..53e989975 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,16 @@ find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core Gui Widgets LinguistTools S find_package( YAMLCPP 0.5.1 REQUIRED ) find_package( PolkitQt5-1 REQUIRED ) +# Find ECM once, and add it to the module search path; Calamares +# modules that need ECM can do +# find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE), +# no need to mess with the module path after. +set( ECM_VERSION 5.10.0 ) +find_package(ECM ${ECM_VERSION} NO_MODULE) +if( ECM_FOUND ) + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) +endif() + option( INSTALL_CONFIG "Install configuration files" ON ) option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF ) diff --git a/src/modules/interactiveterminal/CMakeLists.txt b/src/modules/interactiveterminal/CMakeLists.txt index 7b35fae0d..71f6bae14 100644 --- a/src/modules/interactiveterminal/CMakeLists.txt +++ b/src/modules/interactiveterminal/CMakeLists.txt @@ -1,5 +1,4 @@ -find_package(ECM 5.10.0 REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) +find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) include(KDEInstallDirs) include(GenerateExportHeader) diff --git a/src/modules/users/CMakeLists.txt b/src/modules/users/CMakeLists.txt index 074118d54..ebff9df8c 100644 --- a/src/modules/users/CMakeLists.txt +++ b/src/modules/users/CMakeLists.txt @@ -1,6 +1,5 @@ -find_package(ECM 5.10.0 NO_MODULE) +find_package(ECM ${ECM_VERSION} NO_MODULE) if( ECM_FOUND ) - set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) include( ECMAddTests ) endif()