diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,8 +254,7 @@ PURPOSE "Needed for KWin's QPA plugin." ) find_package(Fontconfig REQUIRED) -set_package_properties(Fontconfig PROPERTIES DESCRIPTION "Font access configuration library" - URL "http://www.freedesktop.org/wiki/Software/fontconfig" +set_package_properties(Fontconfig PROPERTIES TYPE REQUIRED PURPOSE "Needed for KWin's QPA plugin." ) diff --git a/cmake/modules/FindFontconfig.cmake b/cmake/modules/FindFontconfig.cmake --- a/cmake/modules/FindFontconfig.cmake +++ b/cmake/modules/FindFontconfig.cmake @@ -1,16 +1,51 @@ -# - Try to find the Fontconfig -# Once done this will define +#.rst: +# FindFontconfig +# -------------- # -# FONTCONFIG_FOUND - system has Fontconfig -# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers -# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG -# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG +# Try to find Fontconfig. +# Once done this will define the following variables: +# +# ``FONTCONFIG_FOUND`` +# True if Fontconfig is available +# ``FONTCONFIG_INCLUDE_DIR`` +# The include directory to use for the Fontconfig headers +# ``FONTCONFIG_LIBRARIES`` +# The Fontconfig libraries for linking +# ``FONTCONFIG_DEFINITIONS`` +# Compiler switches required for using Fontconfig +# +# If ``FONTCONFIG_FOUND`` is True, it will also define the following +# imported target: +# +# ``Fontconfig::Fontconfig`` +#============================================================================= # Copyright (c) 2006,2007 Laurent Montel, +# Copyright (c) 2018 Volker Krause # -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - +# 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 copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE 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. +#============================================================================= if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) @@ -48,3 +83,17 @@ endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) +if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig) + add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED) + set_target_properties(Fontconfig::Fontconfig PROPERTIES + IMPORTED_LOCATION "${FONTCONFIG_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}" + INTERFACE_COMPILER_DEFINITIONS "${FONTCONFIG_DEFINITIONS}" + ) +endif() + +include(FeatureSummary) +set_package_properties(Fontconfig PROPERTIES + URL "https://www.fontconfig.org/" + DESCRIPTION "Fontconfig is a library for configuring and customizing font access." +) diff --git a/plugins/qpa/CMakeLists.txt b/plugins/qpa/CMakeLists.txt --- a/plugins/qpa/CMakeLists.txt +++ b/plugins/qpa/CMakeLists.txt @@ -29,7 +29,7 @@ kwin KF5::WaylandClient ${QT5PLATFORMSUPPORT_LIBS} - ${FONTCONFIG_LIBRARIES} + Fontconfig::Fontconfig ${FREETYPE_LIBRARIES} )