diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,13 @@ ecm_find_qmlmodule(org.kde.kirigami 2.5) +find_package(SystemSettings QUIET) +set_package_properties(SystemSettings PROPERTIES + DESCRIPTION "Plasma's SystemSettings" + TYPE RUNTIME + PURPOSE "Absolutely required because the KInfoCenter binary is a symlink to it!" +) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS) diff --git a/cmake/FindSystemSettings.cmake b/cmake/FindSystemSettings.cmake new file mode 100644 --- /dev/null +++ b/cmake/FindSystemSettings.cmake @@ -0,0 +1,34 @@ +# - Find Plasma's SystemSettings +# This module defines the following variables: +# +# SystemSettings_FOUND - true if found +# SystemSettings_PATH - path to the bin (only when found) +# +# Copyright (c) 2020 Harald Sitter +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +find_program(SystemSettings_PATH "systemsettings5" + PATHS ${KDE_INSTALL_FULL_BINDIR} # We symlink by absolute path, so this is the only valid location! + NO_DEFAULT_PATH +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SystemSettings + FOUND_VAR SystemSettings_FOUND + REQUIRED_VARS SystemSettings_PATH +) +mark_as_advanced(SystemSettings_PATH)