From 52f2161c35d84b921681649d2a1e4f49c8d7a914 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 7 Jun 2018 14:17:43 +0200 Subject: [PATCH] CMake: make polkit-qt5-1 optional - This is only found in order to know where polkit files should be installed. In distro's that don't use polkit, may as well make it entirely optional. --- CMakeLists.txt | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d4a24550..c33ad8e6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ cmake_minimum_required( VERSION 3.2 ) ### OPTIONS # option( INSTALL_CONFIG "Install configuration files" ON ) +option( INSTALL_POLKIT "Install Polkit configuration" ON ) option( BUILD_TESTING "Build the testing tree." ON ) option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." ON ) @@ -197,7 +198,18 @@ include( CMakeColors ) # find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core Gui Widgets LinguistTools Svg Quick QuickWidgets ) find_package( YAMLCPP ${YAMLCPP_VERSION} REQUIRED ) -find_package( PolkitQt5-1 REQUIRED ) +if( INSTALL_POLKIT ) + find_package( PolkitQt5-1 REQUIRED ) +else() + # Find it anyway, for dependencies-reporting + find_package( PolkitQt5-1 ) +endif() +set_package_properties( + PolkitQt5-1 PROPERTIES + DESCRIPTION "Qt5 support for Polkit" + URL "https://cgit.kde.org/polkit-qt-1.git" + PURPOSE "PolkitQt5-1 helps with installing Polkit configuration" +) # Find ECM once, and add it to the module search path; Calamares # modules that need ECM can do @@ -454,12 +466,14 @@ if( INSTALL_CONFIG ) ) endif() -install( - FILES - com.github.calamares.calamares.policy - DESTINATION - "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}" -) +if( INSTALL_POLKIT ) + install( + FILES + com.github.calamares.calamares.policy + DESTINATION + "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}" + ) +endif() install( FILES