Advance Wayland and KDE package bring-up

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-14 10:51:06 +01:00
parent 51f3c21121
commit cf12defd28
15214 changed files with 20594243 additions and 269 deletions
@@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/../modules/ECMFindModuleHelpers.cmake)
@@ -0,0 +1,69 @@
# SPDX-FileCopyrightText: 2019, 2021, 2023 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
Find7Zip
--------
Try to find 7-Zip.
If the 7-Zip executable is not in your PATH, you can provide
an alternative name or full path location with the ``7Zip_EXECUTABLE``
variable.
This will define the following variables:
``7Zip_FOUND``
TRUE if 7-Zip is available
``7Zip_EXECUTABLE``
Path to 7-Zip executable
If ``7Zip_FOUND`` is TRUE, it will also define the following imported
target:
``7Zip::7Zip``
Path to 7-Zip executable
.. note::
It will see to only find the original 7-Zip, not one of the p7zip forks.
Since 5.113.0.
#]=======================================================================]
if(WIN32)
find_program(7Zip_EXECUTABLE NAMES 7z 7za)
else()
# Some p7zip used to be a fork for Linux of older 7-Zip,
# just supporting the 7z format, and occupied the 7z binary name.
# When 7-Zip got its official Linux support, it chose 7zz to not conflict,
# given it also has another set of arguments.
# Later p7zip was forked once more into some p7zip-zstd, using a newer copy of 7-Zip,
# supporting more than 7z format, therefore also many of the arguments known from 7-Zip.
# Being a different project though and now a real fork due to 7-Zip supporting Linux,
# we try to only find the original here, so consumers can rely on the original 7-Zip documentation.
find_program(7Zip_EXECUTABLE NAMES 7zz)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(7Zip
FOUND_VAR
7Zip_FOUND
REQUIRED_VARS
7Zip_EXECUTABLE
)
mark_as_advanced(7Zip_EXECUTABLE)
if(NOT TARGET 7Zip::7Zip AND 7Zip_FOUND)
add_executable(7Zip::7Zip IMPORTED)
set_target_properties(7Zip::7Zip PROPERTIES
IMPORTED_LOCATION "${7Zip_EXECUTABLE}"
)
endif()
include(FeatureSummary)
set_package_properties(7Zip PROPERTIES
URL "https://www.7-zip.org/"
DESCRIPTION "Data (de)compression program"
)
@@ -0,0 +1,59 @@
# SPDX-FileCopyrightText: 2019, 2021 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
Find7z
------
Try to find 7z.
If the 7z executable is not in your PATH, you can provide
an alternative name or full path location with the ``7z_EXECUTABLE``
variable.
This will define the following variables:
``7z_FOUND``
TRUE if 7z is available
``7z_EXECUTABLE``
Path to 7z executable
If ``7z_FOUND`` is TRUE, it will also define the following imported
target:
``7z::7z``
Path to 7z executable
.. note::
Only works on Windows.
Deprecated: since 5.113, use :find-module:`Find7Zip`.
Since 5.85.0.
#]=======================================================================]
find_program(7z_EXECUTABLE NAMES 7z.exe 7za.exe)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(7z
FOUND_VAR
7z_FOUND
REQUIRED_VARS
7z_EXECUTABLE
)
mark_as_advanced(7z_EXECUTABLE)
if(NOT TARGET 7z::7z AND 7z_FOUND)
add_executable(7z::7z IMPORTED)
set_target_properties(7z::7z PROPERTIES
IMPORTED_LOCATION "${7z_EXECUTABLE}"
)
endif()
include(FeatureSummary)
set_package_properties(7z PROPERTIES
URL "https://www.7-zip.org/"
DESCRIPTION "Data (de)compression program"
)
@@ -0,0 +1,89 @@
# SPDX-FileCopyrightText: 2012 Raphael Kubo da Costa <rakuco@FreeBSD.org>
# SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindCanberra
------------
Try to find Canberra event sound library.
This will define the following variables:
``Canberra_FOUND``
True if (the requested version of) Canberra is available
``Canberra_VERSION``
The version of Canberra
``Canberra_LIBRARIES``
The libraries of Canberra for use with target_link_libraries()
``Canberra_INCLUDE_DIRS``
The include dirs of Canberra for use with target_include_directories()
If ``Canberra_FOUND`` is TRUE, it will also define the following imported
target:
``Canberra::Canberra``
The Canberra library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since 5.56.0.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Canberra QUIET IMPORTED_TARGET libcanberra)
find_library(Canberra_LIBRARIES
NAMES canberra
HINTS ${PC_Canberra_LIBRARY_DIRS}
)
find_path(Canberra_INCLUDE_DIRS
NAMES canberra.h
HINTS ${PC_Canberra_INCLUDE_DIRS}
)
set(Canberra_VERSION ${PC_Canberra_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Canberra
FOUND_VAR
Canberra_FOUND
REQUIRED_VARS
Canberra_LIBRARIES
Canberra_INCLUDE_DIRS
VERSION_VAR
Canberra_VERSION
)
if(Canberra_FOUND AND NOT TARGET Canberra::Canberra)
add_library(Canberra::Canberra UNKNOWN IMPORTED)
set_target_properties(Canberra::Canberra PROPERTIES
IMPORTED_LOCATION "${Canberra_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${PC_Canberra_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${Canberra_INCLUDE_DIRS}"
)
if (TARGET PkgConfig::PC_Canberra)
target_link_libraries(Canberra::Canberra INTERFACE PkgConfig::PC_Canberra)
endif()
endif()
mark_as_advanced(Canberra_LIBRARIES Canberra_INCLUDE_DIRS Canberra_VERSION)
include(FeatureSummary)
set_package_properties(Canberra PROPERTIES
DESCRIPTION "Event sound library"
URL "https://0pointer.de/lennart/projects/libcanberra"
)
# Compatibility variables. In a previous life FindCanberra lived
# in a number of different repos: don't break them if they use ECM but have not
# been updated for this finder.
set(CANBERRA_FOUND ${Canberra_FOUND})
set(CANBERRA_VERSION ${Canberra_VERSION})
set(CANBERRA_LIBRARIES ${Canberra_LIBRARIES})
set(CANBERRA_INCLUDE_DIRS ${Canberra_INCLUDE_DIRS})
mark_as_advanced(CANBERRA_VERSION CANBERRA_LIBRARIES CANBERRA_INCLUDE_DIRS)
@@ -0,0 +1,151 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindEGL
-------
Try to find EGL.
This will define the following variables:
``EGL_FOUND``
True if (the requested version of) EGL is available
``EGL_VERSION``
The version of EGL; note that this is the API version defined in the
headers, rather than the version of the implementation (eg: Mesa)
``EGL_LIBRARIES``
This can be passed to target_link_libraries() instead of the ``EGL::EGL``
target
``EGL_INCLUDE_DIRS``
This should be passed to target_include_directories() if the target is not
used for linking
``EGL_DEFINITIONS``
This should be passed to target_compile_options() if the target is not
used for linking
If ``EGL_FOUND`` is TRUE, it will also define the following imported target:
``EGL::EGL``
The EGL library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)
ecm_find_package_version_check(EGL)
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_EGL QUIET egl)
set(EGL_DEFINITIONS ${PKG_EGL_CFLAGS_OTHER})
find_path(EGL_INCLUDE_DIR
NAMES
EGL/egl.h
HINTS
${PKG_EGL_INCLUDE_DIRS}
)
find_library(EGL_LIBRARY
NAMES
EGL
libEGL
HINTS
${PKG_EGL_LIBRARY_DIRS}
)
# NB: We do *not* use the version information from pkg-config, as that
# is the implementation version (eg: the Mesa version)
if(EGL_INCLUDE_DIR)
# egl.h has defines of the form EGL_VERSION_x_y for each supported
# version; so the header for EGL 1.1 will define EGL_VERSION_1_0 and
# EGL_VERSION_1_1. Finding the highest supported version involves
# finding all these defines and selecting the highest numbered.
file(READ "${EGL_INCLUDE_DIR}/EGL/egl.h" _EGL_header_contents)
string(REGEX MATCHALL
"[ \t]EGL_VERSION_[0-9_]+"
_EGL_version_lines
"${_EGL_header_contents}"
)
unset(_EGL_header_contents)
foreach(_EGL_version_line ${_EGL_version_lines})
string(REGEX REPLACE
"[ \t]EGL_VERSION_([0-9_]+)"
"\\1"
_version_candidate
"${_EGL_version_line}"
)
string(REPLACE "_" "." _version_candidate "${_version_candidate}")
if(NOT DEFINED EGL_VERSION OR EGL_VERSION VERSION_LESS _version_candidate)
set(EGL_VERSION "${_version_candidate}")
endif()
endforeach()
unset(_EGL_version_lines)
endif()
cmake_push_check_state(RESET)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}")
list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}")
check_cxx_source_compiles("
#include <EGL/egl.h>
int main(int argc, char *argv[]) {
EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;
eglDestroyContext(dpy, ctx);
}" HAVE_EGL)
cmake_pop_check_state()
set(required_vars EGL_INCLUDE_DIR HAVE_EGL)
if(NOT EMSCRIPTEN)
list(APPEND required_vars EGL_LIBRARY)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL
FOUND_VAR
EGL_FOUND
REQUIRED_VARS
${required_vars}
VERSION_VAR
EGL_VERSION
)
if(EGL_FOUND AND NOT TARGET EGL::EGL)
if (EMSCRIPTEN)
add_library(EGL::EGL INTERFACE IMPORTED)
# Nothing further to be done, system include paths have headers and linkage is implicit.
else()
add_library(EGL::EGL UNKNOWN IMPORTED)
set_target_properties(EGL::EGL PROPERTIES
IMPORTED_LOCATION "${EGL_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${EGL_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}"
)
endif()
endif()
mark_as_advanced(EGL_LIBRARY EGL_INCLUDE_DIR HAVE_EGL)
# compatibility variables
set(EGL_LIBRARIES ${EGL_LIBRARY})
set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR})
set(EGL_VERSION_STRING ${EGL_VERSION})
include(FeatureSummary)
set_package_properties(EGL PROPERTIES
URL "https://www.khronos.org/egl/"
DESCRIPTION "A platform-agnostic mechanism for creating rendering surfaces for use with other graphics libraries, such as OpenGL|ES and OpenVG."
)
@@ -0,0 +1,151 @@
# SPDX-FileCopyrightText: 2008 Laurent Montel <montel@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindGLIB2
---------
Try to locate the GLib2 library.
If found, this will define the following variables:
``GLIB2_FOUND``
True if the GLib2 library is available
``GLIB2_INCLUDE_DIRS``
The GLib2 include directories
``GLIB2_LIBRARIES``
The GLib2 libraries for linking
``GLIB2_INCLUDE_DIR``
Deprecated, use ``GLIB2_INCLUDE_DIRS``
``GLIB2_LIBRARY``
Deprecated, use ``GLIB2_LIBRARIES``
If ``GLIB2_FOUND`` is TRUE, it will also define the following
imported target:
``GLIB2::GLIB2``
The GLIB2 library
``GLIB2::GTHREAD2``
The GThread2 library (since 6.7.0)
``GLIB2::GOBJECT``
The GObject library (since 6.7.0)
``GLIB2::GIO``
The GIO library (since 6.7.0)
Since 5.41.0.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_GLIB2 QUIET glib-2.0)
find_path(GLIB2_INCLUDE_DIRS
NAMES glib.h
HINTS ${PC_GLIB2_INCLUDEDIR}
PATH_SUFFIXES glib-2.0)
find_library(GLIB2_LIBRARIES
NAMES glib-2.0
HINTS ${PC_GLIB2_LIBDIR}
)
pkg_check_modules(PC_GTHREAD2 QUIET gthread-2.0)
find_library(GTHREAD2_LIBRARIES
NAMES gthread-2.0
HINTS ${PC_GTHREAD2_LIBDIR}
)
pkg_check_modules(PC_GOBJECT QUIET gobject-2.0)
find_path(GLIB2_GOBJECT_INCLUDE_DIRS
NAMES glib-object.h
HINTS ${PC_GOBJECT_INCLUDEDIR}
PATH_SUFFIXES glib-2.0)
find_library(GLIB2_GOBJECT_LIBRARIES
NAMES gobject-2.0
HINTS ${PC_GOBJECT_LIBDIR}
)
pkg_check_modules(PC_GIO QUIET gio-2.0)
find_path(GLIB2_GIO_INCLUDE_DIRS
NAMES gio/gio.h
HINTS ${PC_GIO_INCLUDEDIR}
PATH_SUFFIXES glib-2.0)
find_library(GLIB2_GIO_LIBRARIES
NAMES gio-2.0
HINTS ${PC_GIO_LIBDIR}
)
# search the glibconfig.h include dir under the same root where the library is found
get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)
find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
PATH_SUFFIXES glib-2.0/include
HINTS ${PC_GLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
# not sure if this include dir is optional or required
# for now it is optional
if(GLIB2_INTERNAL_INCLUDE_DIR)
list(APPEND GLIB2_INCLUDE_DIRS "${GLIB2_INTERNAL_INCLUDE_DIR}")
list(APPEND GLIB2_GOBJECT_INCLUDE_DIRS "${GLIB2_INTERNAL_INCLUDE_DIR}")
list(APPEND GLIB2_GIO_INCLUDE_DIRS "${GLIB2_INTERNAL_INCLUDE_DIR}")
endif()
# Deprecated synonyms
set(GLIB2_INCLUDE_DIR "${GLIB2_INCLUDE_DIRS}")
set(GLIB2_LIBRARY "${GLIB2_LIBRARIES}")
set(GLIB2_GOBJECT_INCLUDE_DIR "${GLIB2_GOBJECT_INCLUDE_DIRS}")
set(GLIB2_GOBJECT_LIBRARY "${GLIB2_GOBJECT_LIBRARIES}")
set(GLIB2_GIO_INCLUDE_DIR "${GLIB2_GIO_INCLUDE_DIRS}")
set(GLIB2_GIO_LIBRARY "${GLIB2_GIO_LIBRARIES}")
if(GLIB2_GOBJECT_LIBRARIES AND GLIB2_GOBJECT_INCLUDE_DIRS)
set(GLIB2_GOBJECT_FOUND TRUE)
endif()
if(GLIB2_GIO_LIBRARIES AND GLIB2_GIO_INCLUDE_DIRS)
set(GLIB2_GIO_FOUND TRUE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLIB2
REQUIRED_VARS GLIB2_LIBRARIES GTHREAD2_LIBRARIES GLIB2_INCLUDE_DIRS
HANDLE_COMPONENTS)
if(GLIB2_FOUND AND NOT TARGET GLIB2::GLIB2)
add_library(GLIB2::GLIB2 UNKNOWN IMPORTED)
set_target_properties(GLIB2::GLIB2 PROPERTIES
IMPORTED_LOCATION "${GLIB2_LIBRARIES}"
INTERFACE_LINK_LIBRARIES "${GTHREAD2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GLIB2_INCLUDE_DIRS}")
endif()
if(GLIB2_GOBJECT_FOUND AND NOT TARGET GLIB2::GOBJECT)
add_library(GLIB2::GOBJECT UNKNOWN IMPORTED)
set_target_properties(GLIB2::GOBJECT PROPERTIES
IMPORTED_LOCATION "${GLIB2_GOBJECT_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GLIB2_GOBJECT_INCLUDE_DIRS}")
endif()
if(GLIB2_GIO_FOUND AND NOT TARGET GLIB2::GIO)
add_library(GLIB2::GIO UNKNOWN IMPORTED)
set_target_properties(GLIB2::GIO PROPERTIES
IMPORTED_LOCATION "${GLIB2_GIO_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${GLIB2_GIO_INCLUDE_DIRS}")
endif()
mark_as_advanced(GLIB2_INCLUDE_DIRS GLIB2_INCLUDE_DIR
GLIB2_LIBRARIES GLIB2_LIBRARY
GLIB2_GOBJECT_INCLUDE_DIRS GLIB2_GOBJECT_INCLUDE_DIR
GLIB2_GOBJECT_LIBRARIES GLIB2_GOBJECT_LIBRARY
GLIB2_GIO_INCLUDE_DIRS GLIB2_GIO_INCLUDE_DIR
GLIB2_GIO_LIBRARIES GLIB2_GIO_LIBRARY)
include(FeatureSummary)
set_package_properties(GLIB2 PROPERTIES
URL "https://wiki.gnome.org/Projects/GLib"
DESCRIPTION "Event loop and utility library")
@@ -0,0 +1,133 @@
# SPDX-FileCopyrightText: 2016-2017 Pino Toscano <pino@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindGperf
-----------
Try to find GNU gperf.
If the gperf executable is not in your PATH, you can provide
an alternative name or full path location with the ``Gperf_EXECUTABLE``
variable.
This will define the following variables:
``Gperf_FOUND``
True if gperf is available.
``Gperf_EXECUTABLE``
The gperf executable.
``Gperf_VERSION``
The gperf version. (since 5.85)
If ``Gperf_FOUND`` is TRUE, it will also define the following imported
target:
``GPerf::Gperf``
The gperf executable.
and the following public function:
::
ecm_gperf_generate(<GperfInput> <OutputFile> <OutputVariable(|target (since 5.83))>
[GENERATION_FLAGS <flags>])
Run ``gperf`` on ``<GperfInput>`` to generate ``<OutputFile>``, adding it to
the ``<OutputVariable>`` variable which contains the source for the target
where ``<OutputFile>`` is going to be built or, since KF 5.83, if the given
argument is a target, to the list of private sources of that target. The
target must not be an alias. The optional ``GENERATION_FLAGS`` argument is
needed to pass extra parameters to ``gperf`` (note you cannot override that
way the output file).
A simple invocation would be:
.. code-block:: cmake
ecm_gperf_generate(simple.gperf ${CMAKE_CURRENT_BINARY_DIR}/simple.h MySources)
Since 5.35.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Gperf)
# Find gperf
find_program(Gperf_EXECUTABLE NAMES gperf)
if(Gperf_EXECUTABLE)
execute_process(COMMAND ${Gperf_EXECUTABLE} -v
OUTPUT_VARIABLE _version_string
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_version_string MATCHES "^GNU gperf ([-0-9\\.]+)")
set(Gperf_VERSION "${CMAKE_MATCH_1}")
endif()
unset(_version_string)
else()
set(Gperf_VERSION)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gperf
FOUND_VAR
Gperf_FOUND
REQUIRED_VARS
Gperf_EXECUTABLE
VERSION_VAR
Gperf_VERSION
)
mark_as_advanced(Gperf_EXECUTABLE)
if (Gperf_FOUND)
if (NOT TARGET GPerf::Gperf)
add_executable(GPerf::Gperf IMPORTED)
set_target_properties(GPerf::Gperf PROPERTIES
IMPORTED_LOCATION "${Gperf_EXECUTABLE}"
)
endif()
endif()
include(FeatureSummary)
set_package_properties(Gperf PROPERTIES
URL "https://www.gnu.org/software/gperf/"
DESCRIPTION "Perfect hash function generator"
)
function(ecm_gperf_generate input_file output_file _target_or_sources_var)
# Parse arguments
set(oneValueArgs GENERATION_FLAGS)
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_gperf_generate(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
if (TARGET ${_target_or_sources_var})
get_target_property(aliased_target ${_target_or_sources_var} ALIASED_TARGET)
if(aliased_target)
message(FATAL_ERROR "Target argument passed to ecm_gperf_generate must not be an alias: ${_target_or_sources_var}")
endif()
endif()
get_filename_component(_infile ${input_file} ABSOLUTE)
set(_extraopts "${ARGS_GENERATION_FLAGS}")
separate_arguments(_extraopts)
add_custom_command(OUTPUT ${output_file}
COMMAND ${Gperf_EXECUTABLE} ${_extraopts} --output-file=${output_file} ${_infile}
DEPENDS ${_infile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
set_property(SOURCE ${output_file} PROPERTY SKIP_AUTOMOC ON)
if (TARGET ${_target_or_sources_var})
target_sources(${_target_or_sources_var} PRIVATE ${output_file})
else()
set(${_target_or_sources_var} ${${_target_or_sources_var}} ${output_file} PARENT_SCOPE)
endif()
endfunction()
@@ -0,0 +1,100 @@
# SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindGradle
----------
Provides the ability to build Android AAR libraries using Gradle.
This relies on the Qt provided Gradle, so a Qt for Android installation
is required.
::
gradle_add_aar(<target>
BUIDLFILE build.gradle
NAME <aar-name>)
This builds an Android AAR library using the given ``build.gradle`` file.
::
gradle_install_aar(<target>
DESTINATION <dest>)
Installs a Android AAR library that has been created with ``gradle_add_aar``.
Since 5.76.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
include(FindPackageHandleStandardArgs)
find_package(Qt${QT_MAJOR_VERSION}Core REQUIRED)
set (Gradle_PRECOMMAND "")
if (NOT WIN32)
set(Gradle_EXECUTABLE ${CMAKE_BINARY_DIR}/gradle/gradlew)
# the gradlew script installed by Qt6 is not executable, so running it directly fails
if (QT_MAJOR_VERSION EQUAL "6")
set(Gradle_PRECOMMAND "sh")
endif()
else()
set(Gradle_EXECUTABLE ${CMAKE_BINARY_DIR}/gradle/gradlew.bat)
endif()
get_target_property(_qt_core_location Qt${QT_MAJOR_VERSION}::Core LOCATION)
get_filename_component(_qt_install_root ${_qt_core_location} DIRECTORY)
get_filename_component(_qt_install_root ${_qt_install_root}/../ ABSOLUTE)
set(_gradle_template_dir ${CMAKE_CURRENT_LIST_DIR})
add_custom_command(OUTPUT ${Gradle_EXECUTABLE}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/gradle
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_qt_install_root}/src/3rdparty/gradle ${CMAKE_BINARY_DIR}/gradle
)
add_custom_target(gradle DEPENDS ${Gradle_EXECUTABLE})
# Android Gradle plugin version (not the Gradle version!) used by Qt, for use in our own build.gradle files
file(READ ${_qt_install_root}/src/android/templates/build.gradle _build_grade_template)
string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+" Gradle_ANDROID_GRADLE_PLUGIN_VERSION ${_build_grade_template})
find_package_handle_standard_args(Gradle DEFAULT_MSG Gradle_EXECUTABLE)
function(gradle_add_aar target)
cmake_parse_arguments(ARG "" "BUILDFILE;NAME" "" ${ARGN})
set(_build_root ${CMAKE_CURRENT_BINARY_DIR}/gradle_build/${ARG_NAME})
configure_file(${_gradle_template_dir}/local.properties.cmake ${_build_root}/local.properties)
configure_file(${_gradle_template_dir}/settings.gradle.cmake ${_build_root}/settings.gradle)
configure_file(${ARG_BUILDFILE} ${_build_root}/build.gradle)
if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
set(_aar_suffix "-debug")
set(_aar_gradleCmd "assembleDebug")
else()
set(_aar_suffix "-release")
set(_aar_gradleCmd "assembleRelease")
endif()
file(GLOB_RECURSE _src_files CONFIGURE_DEPENDS "*")
add_custom_command(
OUTPUT ${_build_root}/build/outputs/aar/${ARG_NAME}${_aar_suffix}.aar
COMMAND ${Gradle_PRECOMMAND} ${Gradle_EXECUTABLE} ${_aar_gradleCmd}
# this allows make create-apk to work without installations for apps with AAR libs in the same repository
COMMAND ${CMAKE_COMMAND} -E copy ${_build_root}/build/outputs/aar/${ARG_NAME}${_aar_suffix}.aar ${CMAKE_BINARY_DIR}/jar/${ARG_NAME}.aar
DEPENDS ${Gradle_EXECUTABLE} ${_src_files}
DEPENDS gradle
WORKING_DIRECTORY ${_build_root}
)
add_custom_target(${target} ALL DEPENDS ${_build_root}/build/outputs/aar/${ARG_NAME}${_aar_suffix}.aar)
set_target_properties(${target} PROPERTIES LOCATION ${_build_root}/build/outputs/aar/${ARG_NAME}${_aar_suffix}.aar)
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${ARG_NAME})
endfunction()
function(gradle_install_aar target)
cmake_parse_arguments(ARG "" "DESTINATION" "" ${ARGN})
get_target_property(_loc ${target} LOCATION)
get_target_property(_name ${target} OUTPUT_NAME)
install(FILES ${_loc} DESTINATION ${ARG_DESTINATION} RENAME ${_name}.aar)
endfunction()
@@ -0,0 +1,58 @@
# SPDX-FileCopyrightText: 2017 Vincent Pinon <vpinon@kde.org>
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindIcoTool
-----------
Try to find icotool.
If the icotool executable is not in your PATH, you can provide
an alternative name or full path location with the ``IcoTool_EXECUTABLE``
variable.
This will define the following variables:
``IcoTool_FOUND``
True if icotool is available.
``IcoTool_EXECUTABLE``
The icotool executable.
If ``IcoTool_FOUND`` is TRUE, it will also define the following imported
target:
``IcoTool::IcoTool``
The icotool executable.
Since 5.49.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(IcoTool)
find_program(IcoTool_EXECUTABLE NAMES icotool)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IcoTool
FOUND_VAR
IcoTool_FOUND
REQUIRED_VARS
IcoTool_EXECUTABLE
)
mark_as_advanced(IcoTool_EXECUTABLE)
if (IcoTool_FOUND)
if (NOT TARGET IcoTool::IcoTool)
add_executable(IcoTool::IcoTool IMPORTED)
set_target_properties(IcoTool::IcoTool PROPERTIES
IMPORTED_LOCATION "${IcoTool_EXECUTABLE}"
)
endif()
endif()
include(FeatureSummary)
set_package_properties(IcoTool PROPERTIES
URL "https://www.nongnu.org/icoutils/"
DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file"
)
@@ -0,0 +1,66 @@
# SPDX-FileCopyrightText: 2016 Tobias C. Berner <tcberner@FreeBSD.org>
# SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
#
# SPDX-License-Identifier: BSD-2-Clause
#[=======================================================================[.rst:
FindInotify
--------------
Try to find inotify on this system. This finds:
- libinotify on Unix like systems, or
- the kernel's inotify on Linux systems.
This will define the following variables:
``Inotify_FOUND``
True if inotify is available
``Inotify_LIBRARIES``
This has to be passed to target_link_libraries()
``Inotify_INCLUDE_DIRS``
This has to be passed to target_include_directories()
On Linux and SunOS, the libraries and include directories are empty,
even though ``Inotify_FOUND`` may be set to TRUE. This is because
no special includes or libraries are needed. On other systems
these may be needed to use inotify.
Since 5.32.0.
#]=======================================================================]
find_path(Inotify_INCLUDE_DIRS sys/inotify.h)
if(Inotify_INCLUDE_DIRS)
# On Linux and SunOS, there is no library to link against, on the BSDs there is.
# On the BSD's, inotify is implemented through a library, libinotify.
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(Inotify_FOUND TRUE)
set(Inotify_LIBRARIES "")
set(Inotify_INCLUDE_DIRS "")
else()
find_library(Inotify_LIBRARIES NAMES inotify)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Inotify
FOUND_VAR
Inotify_FOUND
REQUIRED_VARS
Inotify_LIBRARIES
Inotify_INCLUDE_DIRS
)
mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS)
include(FeatureSummary)
set_package_properties(Inotify PROPERTIES
URL "https://github.com/libinotify-kqueue/"
DESCRIPTION "inotify API on the *BSD family of operating systems."
)
endif()
if(NOT TARGET Inotify::Inotify)
add_library(Inotify::Inotify INTERFACE IMPORTED)
set_property(TARGET Inotify::Inotify PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${Inotify_INCLUDE_DIRS}")
set_property(TARGET Inotify::Inotify PROPERTY INTERFACE_LINK_LIBRARIES "${Inotify_LIBRARIES}")
endif()
else()
set(Inotify_FOUND FALSE)
endif()
mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS)
@@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2016 Pino Toscano <pino@kde.org>
# SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindIsoCodes
------------
Try to find iso-codes data files.
Once done this will define:
``IsoCodes_FOUND``
Whether the system has iso-codes
``IsoCodes_PREFIX``
The location in which the iso-codes data files are found
``IsoCodes_DOMAINS``
The available domains provided by iso-codes
Since 5.80.0.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_iso_codes QUIET iso-codes)
set(IsoCodes_VERSION ${PKG_iso_codes_VERSION})
set(IsoCodes_PREFIX ${PKG_iso_codes_PREFIX})
pkg_get_variable(IsoCodes_DOMAINS iso-codes domains)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IsoCodes
FOUND_VAR IsoCodes_FOUND
REQUIRED_VARS IsoCodes_DOMAINS IsoCodes_PREFIX
VERSION_VAR IsoCodes_VERSION
)
include(FeatureSummary)
set_package_properties(IsoCodes PROPERTIES
URL "https://salsa.debian.org/iso-codes-team/iso-codes"
DESCRIPTION "Data about various ISO standards (e.g. country, language, language scripts, and currency names)"
)
@@ -0,0 +1,102 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2013 Stephen Kelly <steveire@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindKF5
-------
Find KDE Frameworks 5 with a single find_package() call.
This will use the package config files provided by the individual frameworks.
For example, if you wish to find KArchive, which presents itself to CMake as
KF5Archive (ie: you would do ``find_package(KF5Archive)`` to find it
directly), you can do
.. code-block:: cmake
find_package(KF5 COMPONENTS Archive)
If all the required components (those given in the COMPONENTS argument, but
not those given in the OPTIONAL_COMPONENTS argument) are found, ``KF5_FOUND``
will be set to true. Otherwise, it will be set to false.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(KF5)
if (NOT KF5_FIND_COMPONENTS)
set(KF5_NOT_FOUND_MESSAGE "The KF5 package requires at least one component")
set(KF5_FOUND False)
return()
endif()
set(_quiet_arg)
if (KF5_FIND_QUIETLY)
set(_quiet_arg QUIET)
endif()
set(_exact_arg)
if (KF5_FIND_EXACT)
set(_exact_arg EXACT)
endif()
include(FindPackageHandleStandardArgs)
include(FeatureSummary)
set(KF5_VERSION)
foreach(_module ${KF5_FIND_COMPONENTS})
find_package(KF5${_module} ${KF5_FIND_VERSION}
${_exact_arg} ${_quiet_arg}
CONFIG
)
# CMake >= 3.17 wants to be explicitly told we are fine with name mismatch here
set(_name_mismatched_arg)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
set(_name_mismatched_arg NAME_MISMATCHED)
endif()
find_package_handle_standard_args(KF5${_module} CONFIG_MODE ${_name_mismatched_arg})
if (KF5_FIND_REQUIRED AND KF5_FIND_REQUIRED_${_module})
# If the component was required, we tell FeatureSummary so that it
# will be displayed in the correct list. We do not use the REQUIRED
# argument of find_package() to allow all the missing frameworks
# to be listed at once (fphsa will error out at the end of this file
# anyway).
set_package_properties(KF5${_module} PROPERTIES TYPE REQUIRED)
endif()
# Component-based find modules are expected to set
# <module>_<component>_FOUND and <module>_<component>_VERSION variables,
# but the find_package calls above will have set KF5<component>_*
# variables.
set(KF5_${_module}_FOUND ${KF5${_module}_FOUND})
if(KF5${_module}_FOUND)
set(KF5_${_module}_VERSION ${KF5${_module}_VERSION})
# make KF5_VERSION the minimum found version
if(NOT KF5_VERSION OR KF5_VERSION VERSION_GREATER KF5${_module}_VERSION)
set(KF5_VERSION ${KF5${_module}_VERSION})
endif()
endif()
endforeach()
# Annoyingly, find_package_handle_standard_args requires you to provide
# REQUIRED_VARS even when using HANDLE_COMPONENTS, but all we actually
# care about is whether the required components were found. So we provide
# a dummy variable that is just set to something that will be printed
# on success.
set(_dummy_req_var "success")
find_package_handle_standard_args(KF5
FOUND_VAR
KF5_FOUND
REQUIRED_VARS
_dummy_req_var
VERSION_VAR
KF5_VERSION
HANDLE_COMPONENTS
)
@@ -0,0 +1,110 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2013 Stephen Kelly <steveire@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindKF6
-------
Find KDE Frameworks 6 with a single find_package() call.
This will use the package config files provided by the individual frameworks.
For example, if you wish to find KArchive, which presents itself to CMake as
KF6Archive (ie: you would do ``find_package(KF6Archive)`` to find it
directly), you can do
.. code-block:: cmake
find_package(KF6 COMPONENTS Archive)
If all the required components (those given in the COMPONENTS argument, but
not those given in the OPTIONAL_COMPONENTS argument) are found, ``KF6_FOUND``
will be set to true. Otherwise, it will be set to false.
Since 6.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(KF6)
if (NOT KF6_FIND_COMPONENTS)
set(KF6_NOT_FOUND_MESSAGE "The KF6 package requires at least one component")
set(KF6_FOUND False)
return()
endif()
set(_quiet_arg)
if (KF6_FIND_QUIETLY)
set(_quiet_arg QUIET)
endif()
set(_exact_arg)
if (KF6_FIND_EXACT)
set(_exact_arg EXACT)
endif()
include(FindPackageHandleStandardArgs)
include(FeatureSummary)
set(KF6_VERSION)
set(KF6_MISSING_REQUIRED_COMPONENTS)
foreach(_module ${KF6_FIND_COMPONENTS})
find_package(KF6${_module} ${KF6_FIND_VERSION}
${_exact_arg} ${_quiet_arg}
CONFIG
)
# CMake >= 3.17 wants to be explicitly told we are fine with name mismatch here
set(_name_mismatched_arg)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
set(_name_mismatched_arg NAME_MISMATCHED)
endif()
find_package_handle_standard_args(KF6${_module} CONFIG_MODE ${_name_mismatched_arg})
if (KF6_FIND_REQUIRED AND KF6_FIND_REQUIRED_${_module})
# If the component was required, we tell FeatureSummary so that it
# will be displayed in the correct list. We do not use the REQUIRED
# argument of find_package() to allow all the missing frameworks
# to be listed at once (fphsa will error out at the end of this file
# anyway).
set_package_properties(KF6${_module} PROPERTIES TYPE REQUIRED)
endif()
# Component-based find modules are expected to set
# <module>_<component>_FOUND and <module>_<component>_VERSION variables,
# but the find_package calls above will have set KF6<component>_*
# variables.
set(KF6_${_module}_FOUND ${KF6${_module}_FOUND})
if(KF6${_module}_FOUND)
set(KF6_${_module}_VERSION ${KF6${_module}_VERSION})
# make KF6_VERSION the minimum found version
if(NOT KF6_VERSION OR KF6_VERSION VERSION_GREATER KF6${_module}_VERSION)
set(KF6_VERSION ${KF6${_module}_VERSION})
endif()
elseif(KF6_FIND_REQUIRED_${_module})
list(APPEND KF6_MISSING_REQUIRED_COMPONENTS ${_module})
endif()
endforeach()
# Annoyingly, find_package_handle_standard_args requires you to provide
# REQUIRED_VARS even when using HANDLE_COMPONENTS, but all we actually
# care about is whether the required components were found. So we provide
# a dummy variable that is just set to something that will be printed
# on success.
set(_dummy_req_var "success")
list(JOIN KF6_MISSING_REQUIRED_COMPONENTS " " MISSING_COMPONENTS_STRING)
find_package_handle_standard_args(KF6
FOUND_VAR
KF6_FOUND
REQUIRED_VARS
_dummy_req_var
VERSION_VAR
KF6_VERSION
HANDLE_COMPONENTS
REASON_FAILURE_MESSAGE "Missing the following required components: ${MISSING_COMPONENTS_STRING}"
)
unset(MISSING_COMPONENTS_STRING)
unset(KF6_MISSING_REQUIRED_COMPONENTS)
@@ -0,0 +1,102 @@
# SPDX-FileCopyrightText: 2018 Christophe Giboudeaux <christophe@krop.fr>
# SPDX-FileCopyrightText: 2010 Alexander Neundorf <neundorf@kde.org>
# SPDX-FileCopyrightText: 2008 Gilles Caulier <caulier.gilles@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindLibExiv2
------------
Try to find the Exiv2 library.
This will define the following variables:
``LibExiv2_FOUND``
True if (the requested version of) Exiv2 is available
``LibExiv2_VERSION``
The version of Exiv2
``LibExiv2_INCLUDE_DIRS``
The include dirs of Exiv2 for use with target_include_directories()
``LibExiv2_LIBRARIES``
The Exiv2 library for use with target_link_libraries().
This can be passed to target_link_libraries() instead of
the ``LibExiv2::LibExiv2`` target
If ``LibExiv2_FOUND`` is TRUE, it will also define the following imported
target:
``LibExiv2::LibExiv2``
The Exiv2 library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since 5.53.0.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_EXIV2 QUIET exiv2)
find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
HINTS ${PC_EXIV2_INCLUDEDIR}
)
find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2
HINTS ${PC_EXIV2_LIBRARY_DIRS}
)
set(LibExiv2_VERSION ${PC_EXIV2_VERSION})
if(NOT LibExiv2_VERSION AND DEFINED LibExiv2_INCLUDE_DIRS)
# With exiv >= 0.27, the version #defines are in exv_conf.h instead of version.hpp
foreach(_exiv2_version_file "version.hpp" "exv_conf.h")
if(EXISTS "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}")
file(READ "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}" _exiv_version_file_content)
string(REGEX MATCH "#define EXIV2_MAJOR_VERSION[ ]+\\([0-9]+U?\\)" EXIV2_MAJOR_VERSION_MATCH ${_exiv_version_file_content})
string(REGEX MATCH "#define EXIV2_MINOR_VERSION[ ]+\\([0-9]+U?\\)" EXIV2_MINOR_VERSION_MATCH ${_exiv_version_file_content})
string(REGEX MATCH "#define EXIV2_PATCH_VERSION[ ]+\\([0-9]+U?\\)" EXIV2_PATCH_VERSION_MATCH ${_exiv_version_file_content})
if(EXIV2_MAJOR_VERSION_MATCH)
string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+\\(([0-9]*)U?\\)" "\\1" EXIV2_MAJOR_VERSION ${EXIV2_MAJOR_VERSION_MATCH})
string(REGEX REPLACE ".*_MINOR_VERSION[ ]+\\(([0-9]*)U?\\)" "\\1" EXIV2_MINOR_VERSION ${EXIV2_MINOR_VERSION_MATCH})
string(REGEX REPLACE ".*_PATCH_VERSION[ ]+\\(([0-9]*)U?\\)" "\\1" EXIV2_PATCH_VERSION ${EXIV2_PATCH_VERSION_MATCH})
endif()
endif()
endforeach()
set(LibExiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibExiv2
FOUND_VAR LibExiv2_FOUND
REQUIRED_VARS LibExiv2_LIBRARIES LibExiv2_INCLUDE_DIRS
VERSION_VAR LibExiv2_VERSION
)
mark_as_advanced(LibExiv2_INCLUDE_DIRS LibExiv2_LIBRARIES)
if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2)
add_library(LibExiv2::LibExiv2 UNKNOWN IMPORTED)
set_target_properties(LibExiv2::LibExiv2 PROPERTIES
IMPORTED_LOCATION "${LibExiv2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}"
)
if (LibExiv2_VERSION VERSION_LESS 0.28.0)
# exiv2 0.27 or older still uses std::auto_ptr, which is no longer available
# by default when using newer C++ versions
set_target_properties(LibExiv2::LibExiv2 PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR=1;_HAS_AUTO_PTR_ETC=1"
)
endif()
endif()
include(FeatureSummary)
set_package_properties(LibExiv2 PROPERTIES
URL "https://www.exiv2.org"
DESCRIPTION "Image metadata support"
)
@@ -0,0 +1,111 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
# SPDX-FileCopyrightText: 2014 Christoph Cullmann <cullmann@kde.org>
# SPDX-FileCopyrightText: 2023 Louis Moureaux <m_louis30@yahoo.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindLibGit2
-----------
Try to find libgit2 on a Unix system.
This will define the following variables:
``LIBGIT2_FOUND``
True if (the requested version of) libgit2 is available
``LIBGIT2_VERSION``
The version of libgit2
``LIBGIT2_LIBRARIES``
This can be passed to target_link_libraries() instead of the ``LibGit2::LibGit2``
target
``LIBGIT2_INCLUDE_DIRS``
This should be passed to target_include_directories() if the target is not
used for linking
``LIBGIT2_DEFINITIONS``
This should be passed to target_compile_options() if the target is not
used for linking
If ``LIBGIT2_FOUND`` is TRUE, it will also define the following imported target:
``LibGit2::LibGit2``
The libgit2 library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since 1.3.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(LibGit2)
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_GIT2 QUIET libgit2)
set(LIBGIT2_DEFINITIONS ${PKG_GIT2_CFLAGS_OTHER})
find_path(LIBGIT2_INCLUDE_DIR
NAMES
git2.h
HINTS
${PKG_GIT2_INCLUDE_DIRS}
)
find_library(LIBGIT2_LIBRARY
NAMES
git2
HINTS
${PKG_GIT2_LIBRARY_DIRS}
)
# get version from header, should work on windows, too
if(LIBGIT2_INCLUDE_DIR)
file(STRINGS "${LIBGIT2_INCLUDE_DIR}/git2/version.h" LIBGIT2_H REGEX "^#define LIBGIT2_VERSION +\"[^\"]*\"$")
string(REGEX REPLACE "^.*LIBGIT2_VERSION +\"([0-9]+).*$" "\\1" LIBGIT2_VERSION_MAJOR "${LIBGIT2_H}")
string(REGEX REPLACE "^.*LIBGIT2_VERSION +\"[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_MINOR "${LIBGIT2_H}")
string(REGEX REPLACE "^.*LIBGIT2_VERSION +\"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIBGIT2_VERSION_PATCH "${LIBGIT2_H}")
set(LIBGIT2_VERSION "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${LIBGIT2_VERSION_PATCH}")
set(LIBGIT2_MAJOR_VERSION "${LIBGIT2_VERSION_MAJOR}")
set(LIBGIT2_MINOR_VERSION "${LIBGIT2_VERSION_MINOR}")
set(LIBGIT2_PATCH_VERSION "${LIBGIT2_VERSION_PATCH}")
unset(LIBGIT2_H)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibGit2
FOUND_VAR
LIBGIT2_FOUND
REQUIRED_VARS
LIBGIT2_LIBRARY
LIBGIT2_INCLUDE_DIR
VERSION_VAR
LIBGIT2_VERSION
)
if(LIBGIT2_FOUND AND NOT TARGET LibGit2::LibGit2)
add_library(LibGit2::LibGit2 UNKNOWN IMPORTED)
set_target_properties(LibGit2::LibGit2 PROPERTIES
IMPORTED_LOCATION "${LIBGIT2_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${LIBGIT2_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBGIT2_INCLUDE_DIR}"
)
endif()
mark_as_advanced(LIBGIT2_LIBRARY LIBGIT2_INCLUDE_DIR)
set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARY})
set(LIBGIT2_INCLUDE_DIRS ${LIBGIT2_INCLUDE_DIR})
include(FeatureSummary)
set_package_properties(LibGit2 PROPERTIES
URL "https://libgit2.github.com/"
DESCRIPTION "A plain C library to interface with the git version control system."
)
@@ -0,0 +1,74 @@
# SPDX-FileCopyrightText: 2021 Ahmad Samir <a.samirh78@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindLibMount
------------
Try to find the libmount library (part of util-linux), once done this will define:
``LibMount_FOUND``
LibMount was found on the system.
``LibMount_INCLUDE_DIRS``
The libmount include directory.
``LibMount_LIBRARIES``
The libmount libraries.
``LibMount_VERSION``
The libmount version.
If ``LibMount_FOUND`` is TRUE, it will also define the following imported target:
``LibMount::LibMount``
The libmount library
Since 5.83.0
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBMOUNT QUIET IMPORTED_TARGET mount)
find_path(LibMount_INCLUDE_DIRS NAMES libmount.h PATH_SUFFIXES libmount HINTS ${PC_LIBMOUNT_INCLUDE_DIRS})
find_library(LibMount_LIBRARIES NAMES mount HINTS ${PC_LIBMOUNT_LIBRARY_DIRS})
set(LibMount_VERSION ${PC_LIBMOUNT_VERSION})
if(LibMount_INCLUDE_DIRS AND NOT LibMount_VERSION)
file(READ "${LibMount_INCLUDE_DIRS}/libmount.h" _LibMount_header_contents)
string(REGEX MATCHALL "#define[ \t]+LIBMOUNT_VERSION[ \t]+\"*[0-9.]+" _LibMount_version_line "${_LibMount_header_contents}")
unset(_LibMount_header_contents)
string(REGEX REPLACE ".*LIBMOUNT_VERSION[ \t]+\"*([0-9.]+)\"*" "\\1" _version "${_LibMount_version_line}")
set(LibMount_VERSION "${_version}")
unset(_LibMount_version_line)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibMount
FOUND_VAR LibMount_FOUND
REQUIRED_VARS LibMount_INCLUDE_DIRS LibMount_LIBRARIES
VERSION_VAR LibMount_VERSION
)
mark_as_advanced(LibMount_INCLUDE_DIRS LibMount_LIBRARIES)
if(LibMount_FOUND AND NOT TARGET LibMount::LibMount)
add_library(LibMount::LibMount UNKNOWN IMPORTED)
set_target_properties(LibMount::LibMount PROPERTIES
IMPORTED_LOCATION "${LibMount_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LibMount_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${PC_LIBMOUNT_CFLAGS_OTHER}"
)
if (TARGET PkgConfig::PC_LIBMOUNT)
target_link_libraries(LibMount::LibMount INTERFACE PkgConfig::PC_LIBMOUNT)
endif()
endif()
include(FeatureSummary)
set_package_properties(LibMount PROPERTIES
DESCRIPTION "API for getting info about mounted filesystems (part of util-linux)"
URL "https://www.kernel.org/pub/linux/utils/util-linux/"
)
@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: 2014 Hrvoje Senjan <hrvoje.senjan@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindLibcap
----------
Try to find the setcap binary and cap libraries
This will define:
``Libcap_FOUND``
system has the cap library and setcap binary
``Libcap_LIBRARIES``
cap libraries to link against
``SETCAP_EXECUTABLE``
path of the setcap binary
In addition, the following targets are defined:
``Libcap::SetCapabilities``
Since 5.80.0
#]=======================================================================]
find_program(SETCAP_EXECUTABLE NAMES setcap DOC "The setcap executable")
find_library(Libcap_LIBRARIES NAMES cap DOC "The cap (capabilities) library")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libcap FOUND_VAR Libcap_FOUND
REQUIRED_VARS SETCAP_EXECUTABLE Libcap_LIBRARIES)
if(Libcap_FOUND AND NOT TARGET Libcap::SetCapabilities)
add_executable(Libcap::SetCapabilities IMPORTED)
set_target_properties(Libcap::SetCapabilities PROPERTIES
IMPORTED_LOCATION "${SETCAP_EXECUTABLE}"
)
endif()
mark_as_advanced(SETCAP_EXECUTABLE Libcap_LIBRARIES)
include(FeatureSummary)
set_package_properties(Libcap PROPERTIES
URL https://sites.google.com/site/fullycapable/
DESCRIPTION "Capabilities are a measure to limit the omnipotence of the superuser.")
@@ -0,0 +1,139 @@
# SPDX-FileCopyrightText: 2013-2014 Alex Merry <alex.merry@kdemail.net>
# SPDX-FileCopyrightText: 2006 Alexander Neundorf <neundorf@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindOpenEXR
-----------
Try to find the OpenEXR libraries.
This will define the following variables:
``OpenEXR_FOUND``
True if OpenEXR is available
``OpenEXR_LIBRARIES``
Link to these to use OpenEXR
``OpenEXR_INCLUDE_DIRS``
Include directory for OpenEXR
``OpenEXR_DEFINITIONS``
Compiler flags required to link against OpenEXR
and the following imported targets:
``OpenEXR::IlmImf``
The OpenEXR core library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(OpenEXR)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PC_OpenEXR QUIET OpenEXR)
set(OpenEXR_DEFINITIONS ${PC_OpenEXR_CFLAGS_OTHER})
find_path(OpenEXR_INCLUDE_DIR ImfRgbaFile.h
PATHS
${PC_OpenEXR_INCLUDEDIR}
${PC_OpenEXR_INCLUDE_DIRS}
PATH_SUFFIXES OpenEXR
)
# Required libraries for OpenEXR
find_library(OpenEXR_HALF_LIBRARY NAMES Half
PATHS
${PC_OpenEXR_LIBDIR}
${PC_OpenEXR_LIBRARY_DIRS}
)
find_library(OpenEXR_IEX_LIBRARY NAMES Iex
PATHS
${PC_OpenEXR_LIBDIR}
${PC_OpenEXR_LIBRARY_DIRS}
)
find_library(OpenEXR_IMATH_LIBRARY NAMES Imath
PATHS
${PC_OpenEXR_LIBDIR}
${PC_OpenEXR_LIBRARY_DIRS}
)
find_library(OpenEXR_ILMTHREAD_LIBRARY NAMES IlmThread
PATHS
${PC_OpenEXR_LIBDIR}
${PC_OpenEXR_LIBRARY_DIRS}
)
# This is the actual OpenEXR library
find_library(OpenEXR_ILMIMF_LIBRARY NAMES IlmImf
PATHS
${PC_OpenEXR_LIBDIR}
${PC_OpenEXR_LIBRARY_DIRS}
)
set(_OpenEXR_deps
${OpenEXR_HALF_LIBRARY}
${OpenEXR_IEX_LIBRARY}
${OpenEXR_IMATH_LIBRARY}
${OpenEXR_ILMTHREAD_LIBRARY})
set(OpenEXR_LIBRARIES
${_OpenEXR_deps}
${OpenEXR_ILMIMF_LIBRARY})
if (OpenEXR_INCLUDE_DIR AND EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h")
file(STRINGS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h" openexr_version_str
REGEX "^#define[\t ]+OPENEXR_VERSION_STRING[\t ]+\"[^\"]*\"")
string(REGEX REPLACE "^#define[\t ]+OPENEXR_VERSION_STRING[\t ]+\"([^\"]*).*"
"\\1" OpenEXR_VERSION_STRING "${openexr_version_str}")
unset(openexr_version_str)
endif ()
include(FindPackageHandleStandardArgs)
# find_package_handle_standard_args reports the value of the first variable
# on success, so make sure this is the actual OpenEXR library
find_package_handle_standard_args(OpenEXR
FOUND_VAR OpenEXR_FOUND
REQUIRED_VARS
OpenEXR_ILMIMF_LIBRARY
OpenEXR_HALF_LIBRARY
OpenEXR_IEX_LIBRARY
OpenEXR_IMATH_LIBRARY
OpenEXR_ILMTHREAD_LIBRARY
OpenEXR_INCLUDE_DIR
VERSION_VAR OpenEXR_VERSION_STRING)
set(OpenEXR_INCLUDE_DIRS ${OpenEXR_INCLUDE_DIR})
include(FeatureSummary)
set_package_properties(OpenEXR PROPERTIES
URL https://www.openexr.com/
DESCRIPTION "A library for handling OpenEXR high dynamic-range image files")
mark_as_advanced(
OpenEXR_INCLUDE_DIR
OpenEXR_LIBRARIES
OpenEXR_DEFINITIONS
OpenEXR_ILMIMF_LIBRARY
OpenEXR_ILMTHREAD_LIBRARY
OpenEXR_IMATH_LIBRARY
OpenEXR_IEX_LIBRARY
OpenEXR_HALF_LIBRARY
)
if(OpenEXR_FOUND AND NOT TARGET OpenEXR::IlmImf)
add_library(OpenEXR::IlmImf UNKNOWN IMPORTED)
set_target_properties(OpenEXR::IlmImf PROPERTIES
IMPORTED_LOCATION "${OpenEXR_ILMIMF_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${OpenEXR_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${OpenEXR_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${_OpenEXR_deps}"
)
endif()
@@ -0,0 +1,72 @@
# SPDX-FileCopyrightText: 2017 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindPhoneNumber
---------------
Try to find PhoneNumber.
This is a component-based find module, which makes use of the COMPONENTS and
OPTIONAL_COMPONENTS arguments to find_module. The following components are
available::
PhoneNumber GeoCoding
If no components are specified, this module will act as though all components
were passed to OPTIONAL_COMPONENTS.
This module will define the following variables, independently of the
components searched for or found:
``PhoneNumber_FOUND``
True if (the requestion version of) PhoneNumber is available
For each searched-for components, ``PhoneNumber_<component>_FOUND`` will be set to
TRUE if the corresponding library was found, and FALSE otherwise. If
``PhoneNumber_<component>_FOUND`` is TRUE, the imported target ``PhoneNumber::<component>``
will be defined.
Since 5.54.0.
#]=======================================================================]
include(ECMFindModuleHelpersStub)
ecm_find_package_version_check(PhoneNumber)
set(PhoneNumber_known_components
PhoneNumber
GeoCoding
)
set(PhoneNumber_default_components ${PhoneNumber_known_components})
set(PhoneNumber_PhoneNumber_lib phonenumber)
set(PhoneNumber_PhoneNumber_header phonenumbers/phonenumberutil.h)
set(PhoneNumber_GeoCoding_lib geocoding)
set(PhoneNumber_GeoCoding_header phonenumbers/geocoding/phonenumber_offline_geocoder.h)
ecm_find_package_parse_components(PhoneNumber
RESULT_VAR PhoneNumber_components
KNOWN_COMPONENTS ${PhoneNumber_known_components}
DEFAULT_COMPONENTS ${PhoneNumber_default_components}
)
ecm_find_package_handle_library_components(PhoneNumber
COMPONENTS ${PhoneNumber_components}
)
find_package_handle_standard_args(PhoneNumber
FOUND_VAR
PhoneNumber_FOUND
REQUIRED_VARS
PhoneNumber_LIBRARIES
VERSION_VAR
PhoneNumber_VERSION
HANDLE_COMPONENTS
)
set(PhoneNumber_VERSION 0) # there is no observable version number in the installed files
include(FeatureSummary)
set_package_properties(PhoneNumber PROPERTIES
URL "https://github.com/googlei18n/libphonenumber"
DESCRIPTION "Library for parsing, formatting, and validating international phone numbers")
@@ -0,0 +1,132 @@
# SPDX-FileCopyrightText: 2015 Alex Richardson <arichardson.kde@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindPoppler
-----------
Try to find Poppler.
This is a component-based find module, which makes use of the COMPONENTS
and OPTIONAL_COMPONENTS arguments to find_module. The following components
are available::
Core Cpp Qt5 Qt4 Glib
If no components are specified, this module will act as though all components
were passed to OPTIONAL_COMPONENTS.
This module will define the following variables, independently of the
components searched for or found:
``Poppler_FOUND``
TRUE if (the requested version of) Poppler is available
``Poppler_VERSION``
Found Poppler version
``Poppler_TARGETS``
A list of all targets imported by this module (note that there may be more
than the components that were requested)
``Poppler_LIBRARIES``
This can be passed to target_link_libraries() instead of the imported
targets
``Poppler_INCLUDE_DIRS``
This should be passed to target_include_directories() if the targets are
not used for linking
``Poppler_DEFINITIONS``
This should be passed to target_compile_options() if the targets are not
used for linking
For each searched-for components, ``Poppler_<component>_FOUND`` will be set to
TRUE if the corresponding Poppler library was found, and FALSE otherwise. If
``Poppler_<component>_FOUND`` is TRUE, the imported target
``Poppler::<component>`` will be defined. This module will also attempt to
determine ``Poppler_*_VERSION`` variables for each imported target, although
``Poppler_VERSION`` should normally be sufficient.
In general we recommend using the imported targets, as they are easier to use
and provide more control. Bear in mind, however, that if any target is in the
link interface of an exported library, it must be made available by the
package config file.
Since 5.19
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Poppler)
set(Poppler_known_components
Cpp
Qt4
Qt5
Qt6
Glib
)
foreach(_comp ${Poppler_known_components})
string(TOLOWER "${_comp}" _lc_comp)
set(Poppler_${_comp}_component_deps "Core")
set(Poppler_${_comp}_pkg_config "poppler-${_lc_comp}")
set(Poppler_${_comp}_lib "poppler-${_lc_comp}")
set(Poppler_${_comp}_header_subdir "poppler/${_lc_comp}")
endforeach()
set(Poppler_known_components Core ${Poppler_known_components})
set(Poppler_Core_component_deps "")
set(Poppler_Core_pkg_config "poppler")
# poppler-config.h header is only installed with --enable-xpdf-headers
# fall back to using any header from a submodule with a path to make it work in that case too
set(Poppler_Core_header "poppler-config.h" "cpp/poppler-version.h" "qt6/poppler-qt6.h" "qt5/poppler-qt5.h" "qt4/poppler-qt4.h" "glib/poppler.h")
set(Poppler_Core_header_subdir "poppler")
set(Poppler_Core_lib "poppler")
set(Poppler_Cpp_header "poppler-version.h")
set(Poppler_Qt6_header "poppler-qt6.h")
set(Poppler_Qt5_header "poppler-qt5.h")
set(Poppler_Qt4_header "poppler-qt4.h")
set(Poppler_Glib_header "poppler.h")
ecm_find_package_parse_components(Poppler
RESULT_VAR Poppler_components
KNOWN_COMPONENTS ${Poppler_known_components}
)
ecm_find_package_handle_library_components(Poppler
COMPONENTS ${Poppler_components}
)
# If pkg-config didn't provide us with version information,
# try to extract it from poppler-version.h or poppler-config.h
if(NOT Poppler_VERSION)
find_file(Poppler_VERSION_HEADER
NAMES "poppler-config.h" "cpp/poppler-version.h"
HINTS ${Poppler_INCLUDE_DIRS}
PATH_SUFFIXES ${Poppler_Core_header_subdir}
)
mark_as_advanced(Poppler_VERSION_HEADER)
if(Poppler_VERSION_HEADER)
file(READ ${Poppler_VERSION_HEADER} _poppler_version_header_contents)
string(REGEX REPLACE
"^.*[ \t]+POPPLER_VERSION[ \t]+\"([0-9d.]*)\".*$"
"\\1"
Poppler_VERSION
"${_poppler_version_header_contents}"
)
unset(_poppler_version_header_contents)
endif()
endif()
find_package_handle_standard_args(Poppler
FOUND_VAR
Poppler_FOUND
REQUIRED_VARS
Poppler_LIBRARIES
VERSION_VAR
Poppler_VERSION
HANDLE_COMPONENTS
)
include(FeatureSummary)
set_package_properties(Poppler PROPERTIES
DESCRIPTION "A PDF rendering library"
URL "https://poppler.freedesktop.org/"
)
@@ -0,0 +1,108 @@
# SPDX-FileCopyrightText: 2008 Matthias Kretz <kretz@kde.org>
# SPDX-FileCopyrightText: 2009 Marcus Hufgard <Marcus.Hufgard@hufgard.de>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindPulseAudio
--------------
Try to locate the PulseAudio library.
If found, this will define the following variables:
``PulseAudio_FOUND``
True if the system has the PulseAudio library of at least
the minimum version specified by either the version parameter
to find_package() or the variable PulseAudio_MINIMUM_VERSION
``PulseAudio_INCLUDE_DIRS``
The PulseAudio include directory
``PulseAudio_LIBRARIES``
The PulseAudio libraries for linking
``PulseAudio_MAINLOOP_LIBRARY``
The libraries needed to use PulseAudio Mainloop
``PulseAudio_VERSION``
The version of PulseAudio that was found
``PulseAudio_INCLUDE_DIR``
Deprecated, use ``PulseAudio_INCLUDE_DIRS``
``PulseAudio_LIBRARY``
Deprecated, use ``PulseAudio_LIBRARIES``
If ``PulseAudio_FOUND`` is TRUE, it will also define the following
imported target:
``PulseAudio::PulseAudio``
The PulseAudio library
Since 5.41.0.
#]=======================================================================]
# Support PulseAudio_MINIMUM_VERSION for compatibility:
if(NOT PulseAudio_FIND_VERSION)
set(PulseAudio_FIND_VERSION "${PulseAudio_MINIMUM_VERSION}")
endif()
# the minimum version of PulseAudio we require
if(NOT PulseAudio_FIND_VERSION)
set(PulseAudio_FIND_VERSION "0.9.9")
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(PC_PulseAudio QUIET libpulse>=${PulseAudio_FIND_VERSION})
pkg_check_modules(PC_PulseAudio_MAINLOOP QUIET libpulse-mainloop-glib)
find_path(PulseAudio_INCLUDE_DIRS pulse/pulseaudio.h
HINTS
${PC_PulseAudio_INCLUDEDIR}
${PC_PulseAudio_INCLUDE_DIRS}
)
find_library(PulseAudio_LIBRARIES NAMES pulse libpulse
HINTS
${PC_PulseAudio_LIBDIR}
${PC_PulseAudio_LIBRARY_DIRS}
)
find_library(PulseAudio_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib
HINTS
${PC_PulseAudio_LIBDIR}
${PC_PulseAudio_LIBRARY_DIRS}
)
# Store the version number in the cache, so we don't have to search every time again:
if (PulseAudio_INCLUDE_DIRS AND NOT PulseAudio_VERSION)
# get PulseAudio's version from its version.h
file(STRINGS "${PulseAudio_INCLUDE_DIRS}/pulse/version.h" pulse_version_h
REGEX ".*pa_get_headers_version\\(\\).*")
string(REGEX REPLACE ".*pa_get_headers_version\\(\\)\ \\(\"([0-9]+\\.[0-9]+\\.[0-9]+)[^\"]*\"\\).*" "\\1"
_PulseAudio_VERSION "${pulse_version_h}")
set(PulseAudio_VERSION "${_PulseAudio_VERSION}" CACHE STRING "Version number of PulseAudio" FORCE)
endif()
# Use the new extended syntax of find_package_handle_standard_args(), which also handles version checking:
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PulseAudio REQUIRED_VARS PulseAudio_LIBRARIES PulseAudio_INCLUDE_DIRS
VERSION_VAR PulseAudio_VERSION)
# Deprecated synonyms
set(PULSEAUDIO_INCLUDE_DIR "${PulseAudio_INCLUDE_DIRS}")
set(PULSEAUDIO_LIBRARY "${PulseAudio_LIBRARIES}")
set(PULSEAUDIO_MAINLOOP_LIBRARY "${PulseAudio_MAINLOOP_LIBRARY}")
set(PULSEAUDIO_FOUND "${PulseAudio_FOUND}")
if(PulseAudio_FOUND AND NOT TARGET PulseAudio::PulseAudio)
add_library(PulseAudio::PulseAudio UNKNOWN IMPORTED)
set_target_properties(PulseAudio::PulseAudio PROPERTIES
IMPORTED_LOCATION "${PulseAudio_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${PulseAudio_INCLUDE_DIRS}")
endif()
mark_as_advanced(PulseAudio_INCLUDE_DIRS PULSEAUDIO_INCLUDE_DIR
PulseAudio_LIBRARIES PULSEAUDIO_LIBRARY
PulseAudio_MAINLOOP_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY)
include(FeatureSummary)
set_package_properties(PulseAudio PROPERTIES
URL "https://www.freedesktop.org/wiki/Software/PulseAudio"
DESCRIPTION "Sound server, for sound stream routing and mixing")
@@ -0,0 +1,55 @@
# SPDX-FileCopyrightText: 2016 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
WARNING: FOR ECM-INTERNAL USE ONLY, DO NOT USE IN OWN PROJECTS
THIS FILE MIGHT DISAPPEAR IN FUTURE VERSIONS OF ECM.
Finds the Qt5 QHelpGenerator
QHelpGenerator_FOUND - True if QHelpGenerator found.
QHelpGenerator_EXECUTABLE - Path to executable
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
find_package(Qt${QT_MAJOR_VERSION}Help QUIET)
if (TARGET Qt5::qhelpgenerator)
get_target_property(QHelpGenerator_EXECUTABLE Qt5::qhelpgenerator LOCATION)
else()
# assume same folder as qmake executable
if (TARGET Qt5::qmake)
get_target_property(_qmake_EXECUTABLE Qt5::qmake LOCATION)
get_filename_component(_path ${_qmake_EXECUTABLE} DIRECTORY)
else()
set(_path)
endif()
find_program(QHelpGenerator_EXECUTABLE
NAMES
qhelpgenerator-qt5
qhelpgenerator
PATHS
${_path}
NO_DEFAULT_PATH
)
endif()
mark_as_advanced(QHelpGenerator_EXECUTABLE)
if(QHelpGenerator_EXECUTABLE)
set(QHelpGenerator_FOUND TRUE)
else()
set(QHelpGenerator_FOUND FALSE)
endif()
if(QHelpGenerator_FOUND)
if(NOT QHelpGenerator_FIND_QUIETLY )
message( STATUS "Found QHelpGenerator executable: ${QHelpGenerator_EXECUTABLE}")
endif()
else()
if(QHelpGenerator_FIND_REQUIRED)
message( FATAL_ERROR "Could not find QHelpGenerator executable" )
else()
message( STATUS "Optional QHelpGenerator executable was not found" )
endif()
endif()
@@ -0,0 +1,212 @@
# SPDX-FileCopyrightText: 2012-2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindQtWaylandScanner
--------------------
Try to find qtwaylandscanner.
If the qtwaylandscanner executable is not in your PATH, you can provide
an alternative name or full path location with the ``QtWaylandScanner_EXECUTABLE``
variable.
This will define the following variables:
``QtWaylandScanner_FOUND``
True if qtwaylandscanner is available
``QtWaylandScanner_EXECUTABLE``
The qtwaylandscanner executable.
If ``QtWaylandScanner_FOUND`` is TRUE, it will also define the following imported
target:
``Wayland::QtScanner``
The qtwaylandscanner executable.
This module provides the following functions to generate C++ protocol
implementations:
- ``ecm_add_qtwayland_client_protocol``
- ``ecm_add_qtwayland_server_protocol``
::
ecm_add_qtwayland_client_protocol(<target>
PROTOCOL <xmlfile>
BASENAME <basename>
[PREFIX <prefix>]
[PRIVATE_CODE])
ecm_add_qtwayland_client_protocol(<source_files_var>
PROTOCOL <xmlfile>
BASENAME <basename>
[PREFIX <prefix>]
[PRIVATE_CODE])
Generate C++ wrapper to Wayland client protocol files from ``<xmlfile>``
XML definition for the ``<basename>`` interface and append those files
to ``<source_files_var>`` or ``<target>``. Pass the ``<prefix>`` argument if the interface
names don't start with ``qt_`` or ``wl_``.
``PRIVATE_CODE`` instructs wayland-scanner to hide marshalling code
from the compiled DSO for use in other DSOs. The default is to
export this code.
WaylandScanner is required and will be searched for.
::
ecm_add_qtwayland_server_protocol(<target>
PROTOCOL <xmlfile>
BASENAME <basename>
[PREFIX <prefix>]
[PRIVATE_CODE])
ecm_add_qtwayland_server_protocol(<source_files_var>
PROTOCOL <xmlfile>
BASENAME <basename>
[PREFIX <prefix>]
[PRIVATE_CODE])
Generate C++ wrapper to Wayland server protocol files from ``<xmlfile>``
XML definition for the ``<basename>`` interface and append those files
to ``<source_files_var>`` or ``<target>``. Pass the ``<prefix>`` argument if the interface
names don't start with ``qt_`` or ``wl_``.
``PRIVATE_CODE`` instructs wayland-scanner to hide marshalling code
from the compiled DSO for use in other DSOs. The default is to
export this code.
WaylandScanner is required and will be searched for.
Since 1.4.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
include("${ECM_MODULE_DIR}/ECMQueryQt.cmake")
ecm_find_package_version_check(QtWaylandScanner)
if (QT_MAJOR_VERSION STREQUAL "5")
ecm_query_qt(qtwaylandscanner_dir QT_HOST_BINS)
else()
ecm_query_qt(qtwaylandscanner_dir QT_HOST_LIBEXECS)
endif()
# Find qtwaylandscanner
find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner HINTS ${qtwaylandscanner_dir})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QtWaylandScanner
FOUND_VAR
QtWaylandScanner_FOUND
REQUIRED_VARS
QtWaylandScanner_EXECUTABLE
)
mark_as_advanced(QtWaylandScanner_EXECUTABLE)
if(NOT TARGET Wayland::QtScanner AND QtWaylandScanner_FOUND)
add_executable(Wayland::QtScanner IMPORTED)
set_target_properties(Wayland::QtScanner PROPERTIES
IMPORTED_LOCATION "${QtWaylandScanner_EXECUTABLE}"
)
endif()
include(FeatureSummary)
set_package_properties(QtWaylandScanner PROPERTIES
URL "https://qt.io/"
DESCRIPTION "Executable that converts XML protocol files to C++ code"
)
function(ecm_add_qtwayland_client_protocol target_or_sources_var)
# Parse arguments
set(oneValueArgs PROTOCOL BASENAME PREFIX)
set(options PRIVATE_CODE)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_qtwayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
set(_prefix "${ARGS_PREFIX}")
if(ARGS_PRIVATE_CODE)
set(_private_code_option PRIVATE_CODE)
endif()
find_package(WaylandScanner REQUIRED QUIET)
ecm_add_wayland_client_protocol(${target_or_sources_var}
PROTOCOL ${ARGS_PROTOCOL}
BASENAME ${ARGS_BASENAME}
${_private_code_option})
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_header "${CMAKE_CURRENT_BINARY_DIR}/qwayland-${ARGS_BASENAME}.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/qwayland-${ARGS_BASENAME}.cpp")
set_source_files_properties(${_header} ${_code} GENERATED)
add_custom_command(OUTPUT "${_header}"
COMMAND ${QtWaylandScanner_EXECUTABLE} client-header ${_infile} "" ${_prefix} > ${_header}
DEPENDS ${_infile} ${_cheader} VERBATIM)
add_custom_command(OUTPUT "${_code}"
COMMAND ${QtWaylandScanner_EXECUTABLE} client-code ${_infile} "" ${_prefix} > ${_code}
DEPENDS ${_infile} ${_header} VERBATIM)
set_property(SOURCE ${_header} ${_code} PROPERTY SKIP_AUTOMOC ON)
if (TARGET ${target_or_sources_var})
target_sources(${target_or_sources_var} PRIVATE "${_code}")
else()
list(APPEND ${target_or_sources_var} "${_code}")
set(${target_or_sources_var} ${${target_or_sources_var}} PARENT_SCOPE)
endif()
endfunction()
function(ecm_add_qtwayland_server_protocol target_or_sources_var)
# Parse arguments
set(oneValueArgs PROTOCOL BASENAME PREFIX)
set(options PRIVATE_CODE)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_qtwayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
set(_prefix "${ARGS_PREFIX}")
if(ARGS_PRIVATE_CODE)
set(_private_code_option PRIVATE_CODE)
endif()
find_package(WaylandScanner REQUIRED QUIET)
ecm_add_wayland_server_protocol(${target_or_sources_var}
PROTOCOL ${ARGS_PROTOCOL}
BASENAME ${ARGS_BASENAME}
${_private_code_option})
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_header "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/qwayland-server-${ARGS_BASENAME}.cpp")
set_source_files_properties(${_header} ${_code} GENERATED)
add_custom_command(OUTPUT "${_header}"
COMMAND ${QtWaylandScanner_EXECUTABLE} server-header ${_infile} "" ${_prefix} > ${_header}
DEPENDS ${_infile} VERBATIM)
add_custom_command(OUTPUT "${_code}"
COMMAND ${QtWaylandScanner_EXECUTABLE} server-code ${_infile} "" ${_prefix} > ${_code}
DEPENDS ${_infile} ${_header} VERBATIM)
set_property(SOURCE ${_header} ${_code} PROPERTY SKIP_AUTOMOC ON)
if (TARGET ${target_or_sources_var})
target_sources(${target_or_sources_var} PRIVATE "${_code}")
else()
list(APPEND ${target_or_sources_var} "${_code}")
set(${target_or_sources_var} ${${target_or_sources_var}} PARENT_SCOPE)
endif()
endfunction()
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2020 Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
WARNING: FOR ECM-INTERNAL USE ONLY, DO NOT USE IN OWN PROJECTS
THIS FILE MIGHT DISAPPEAR IN FUTURE VERSIONS OF ECM.
Finds the REUSE Tool by FSFE: https://github.com/fsfe/reuse-tool
REUSETOOL_FOUND - True if REUSE tool is found.
REUSETOOL_EXECUTABLE - Path to executable
#]=======================================================================]
find_program(REUSETOOL_EXECUTABLE NAMES reuse)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ReuseTool
FOUND_VAR
REUSETOOL_FOUND
REQUIRED_VARS
REUSETOOL_EXECUTABLE
)
@@ -0,0 +1,91 @@
# SPDX-FileCopyrightText: 2006, 2007 Laurent Montel <montel@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindSasl2
---------
Try to find the SASL2 library.
This will define the following variables:
``Sasl2_FOUND``
System has SASL2.
``Sasl2_VERSION``
The version of SASL2.
``Sasl2_INCLUDE_DIRS``
This should be passed to target_include_directories() if
the target is not used for linking.
``Sasl2_LIBRARIES``
The SASL2 library.
This can be passed to target_link_libraries() instead of
the ``Sasl2::Sasl2`` target
If ``Sasl2_FOUND`` is TRUE, the following imported target
will be available:
``Sasl2::Sasl2``
The SASL2 library
Since 5.41.0.
#]=======================================================================]
# NOTE: libsasl2.pc doesn't export the include dir.
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Sasl2 libsasl2)
find_path(Sasl2_INCLUDE_DIRS NAMES sasl/sasl.h)
# libsasl2 add for windows, because the windows package of cyrus-sasl2
# contains a libsasl2 also for msvc which is not standard conform
find_library(Sasl2_LIBRARIES
NAMES sasl2 libsasl2
HINTS ${PC_Sasl2_LIBRARY_DIRS}
)
set(Sasl2_VERSION "${PC_Sasl2_VERSION}")
if(NOT Sasl2_VERSION)
if(EXISTS "${Sasl2_INCLUDE_DIRS}/sasl/sasl.h")
file(READ "${Sasl2_INCLUDE_DIRS}/sasl/sasl.h" SASL2_H_CONTENT)
string(REGEX MATCH "#define SASL_VERSION_MAJOR[ ]+[0-9]+" SASL2_VERSION_MAJOR_MATCH ${SASL2_H_CONTENT})
string(REGEX MATCH "#define SASL_VERSION_MINOR[ ]+[0-9]+" SASL2_VERSION_MINOR_MATCH ${SASL2_H_CONTENT})
string(REGEX MATCH "#define SASL_VERSION_STEP[ ]+[0-9]+" SASL2_VERSION_STEP_MATCH ${SASL2_H_CONTENT})
string(REGEX REPLACE ".*_MAJOR[ ]+(.*)" "\\1" SASL2_VERSION_MAJOR ${SASL2_VERSION_MAJOR_MATCH})
string(REGEX REPLACE ".*_MINOR[ ]+(.*)" "\\1" SASL2_VERSION_MINOR ${SASL2_VERSION_MINOR_MATCH})
string(REGEX REPLACE ".*_STEP[ ]+(.*)" "\\1" SASL2_VERSION_STEP ${SASL2_VERSION_STEP_MATCH})
set(Sasl2_VERSION "${SASL2_VERSION_MAJOR}.${SASL2_VERSION_MINOR}.${SASL2_VERSION_STEP}")
else()
# Could not find the version
set(Sasl2_VERSION "0.0.0")
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sasl2
FOUND_VAR Sasl2_FOUND
REQUIRED_VARS Sasl2_LIBRARIES Sasl2_INCLUDE_DIRS
VERSION_VAR Sasl2_VERSION
)
if(Sasl2_FOUND AND NOT TARGET Sasl2::Sasl2)
add_library(Sasl2::Sasl2 UNKNOWN IMPORTED)
set_target_properties(Sasl2::Sasl2 PROPERTIES
IMPORTED_LOCATION "${Sasl2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Sasl2_INCLUDE_DIRS}")
endif()
mark_as_advanced(Sasl2_LIBRARIES Sasl2_INCLUDE_DIRS Sasl2_VERSION)
include(FeatureSummary)
set_package_properties(Sasl2 PROPERTIES
URL "https://www.cyrusimap.org/sasl/"
DESCRIPTION "The Cyrus-sasl library."
)
@@ -0,0 +1,69 @@
# SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
# SPDX-FileCopyrightText: 2017 David Kahles <david.kahles96@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindSeccomp
-----------
Try to locate the libseccomp library.
This will define the following variables:
``Seccomp_FOUND``
True if the seccomp library is available
``Seccomp_INCLUDE_DIRS``
The seccomp include directories
``Seccomp_LIBRARIES``
The seccomp libraries for linking
If ``Seccomp_FOUND`` is TRUE, it will also define the following
imported target:
``Seccomp::Seccomp``
The Seccomp library
Since 5.44.0.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_Libseccomp QUIET libseccomp)
find_path(Seccomp_INCLUDE_DIRS
NAMES
seccomp.h
HINTS
${PKG_Libseccomp_INCLUDE_DIRS}
)
find_library(Seccomp_LIBRARIES
NAMES
seccomp
HINTS
${PKG_Libseccomp_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Seccomp
FOUND_VAR
Seccomp_FOUND
REQUIRED_VARS
Seccomp_LIBRARIES
Seccomp_INCLUDE_DIRS
)
if (Seccomp_FOUND AND NOT TARGET Seccomp::Seccomp)
add_library(Seccomp::Seccomp UNKNOWN IMPORTED)
set_target_properties(Seccomp::Seccomp PROPERTIES
IMPORTED_LOCATION "${Seccomp_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Seccomp_INCLUDE_DIRS}"
)
endif()
mark_as_advanced(Seccomp_LIBRARIES Seccomp_INCLUDE_DIRS)
include(FeatureSummary)
set_package_properties(Seccomp PROPERTIES
URL "https://github.com/seccomp/libseccomp"
DESCRIPTION "The enhanced seccomp library."
)
@@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: 2013-2014 Alex Merry <alex.merry@kdemail.net>
# SPDX-FileCopyrightText: 2007 Pino Toscano <toscano.pino@tiscali.it>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindSharedMimeInfo
------------------
Try to find the shared-mime-info package.
This will define the following variables:
``SharedMimeInfo_FOUND``
True if system has the shared-mime-info package
``UPDATE_MIME_DATABASE_EXECUTABLE``
The update-mime-database executable
and the following imported targets:
``SharedMimeInfo::UpdateMimeDatabase``
The update-mime-database executable
The follow macro is available::
update_xdg_mimetypes(<path>)
Updates the XDG mime database at install time (unless the ``$DESTDIR``
environment variable is set, in which case it is up to package managers to
perform this task).
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(SharedMimeInfo)
find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database)
if (UPDATE_MIME_DATABASE_EXECUTABLE)
execute_process(
COMMAND "${UPDATE_MIME_DATABASE_EXECUTABLE}" -v
OUTPUT_VARIABLE _smiVersionRaw
ERROR_VARIABLE _smiVersionRaw)
string(REGEX REPLACE "update-mime-database \\([a-zA-Z\\-]+\\) ([0-9]\\.[0-9]+).*"
"\\1" SharedMimeInfo_VERSION_STRING "${_smiVersionRaw}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SharedMimeInfo
FOUND_VAR
SharedMimeInfo_FOUND
REQUIRED_VARS
UPDATE_MIME_DATABASE_EXECUTABLE
VERSION_VAR
SharedMimeInfo_VERSION_STRING)
if(SharedMimeInfo_FOUND AND NOT TARGET SharedMimeInfo::UpdateMimeDatabase)
add_executable(SharedMimeInfo::UpdateMimeDatabase IMPORTED)
set_target_properties(SharedMimeInfo::UpdateMimeDatabase PROPERTIES
IMPORTED_LOCATION "${UPDATE_MIME_DATABASE_EXECUTABLE}"
)
endif()
mark_as_advanced(UPDATE_MIME_DATABASE_EXECUTABLE)
function(UPDATE_XDG_MIMETYPES _path)
get_filename_component(_xdgmimeDir "${_path}" NAME)
if("${_xdgmimeDir}" STREQUAL packages )
get_filename_component(_xdgmimeDir "${_path}" PATH)
else()
set(_xdgmimeDir "${_path}")
endif()
# Note that targets and most variables are not available to install code
install(CODE "
set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
if (NOT DESTDIR_VALUE)
# under Windows relative paths are used, that's why it runs from CMAKE_INSTALL_PREFIX
message(STATUS \"Updating MIME database at \${CMAKE_INSTALL_PREFIX}/${_xdgmimeDir}\")
execute_process(COMMAND \"${UPDATE_MIME_DATABASE_EXECUTABLE}\" -n \"${_xdgmimeDir}\"
WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}\")
endif (NOT DESTDIR_VALUE)
")
endfunction()
include(FeatureSummary)
set_package_properties(SharedMimeInfo PROPERTIES
URL https://freedesktop.org/wiki/Software/shared-mime-info/
DESCRIPTION "A database of common MIME types")
@@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: 2006 Laurent Montel <montel@kde.org>
# SPDX-FileCopyrightText: 2019 Heiko Becker <heirecka@exherbo.org>
# SPDX-FileCopyrightText: 2020 Elvis Angelaccio <elvis.angelaccio@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindTaglib
----------
Try to find the Taglib library.
This will define the following variables:
``Taglib_FOUND``
True if the system has the taglib library of at least the minimum
version specified by the version parameter to find_package()
``Taglib_INCLUDE_DIRS``
The taglib include dirs for use with target_include_directories
``Taglib_LIBRARIES``
The taglib libraries for use with target_link_libraries()
``Taglib_VERSION``
The version of taglib that was found
If ``Taglib_FOUND`` is TRUE, it will also define the following imported
target:
``Taglib::Taglib``
The Taglib library
Since 5.72.0
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_TAGLIB QUIET taglib)
find_path(Taglib_INCLUDE_DIRS
NAMES tag.h
PATH_SUFFIXES taglib
HINTS ${PC_TAGLIB_INCLUDEDIR}
)
find_library(Taglib_LIBRARIES
NAMES tag
HINTS ${PC_TAGLIB_LIBDIR}
)
set(Taglib_VERSION ${PC_TAGLIB_VERSION})
if (Taglib_INCLUDE_DIRS AND NOT Taglib_VERSION)
if(EXISTS "${Taglib_INCLUDE_DIRS}/taglib.h")
file(READ "${Taglib_INCLUDE_DIRS}/taglib.h" TAGLIB_H)
string(REGEX MATCH "#define TAGLIB_MAJOR_VERSION[ ]+[0-9]+" TAGLIB_MAJOR_VERSION_MATCH ${TAGLIB_H})
string(REGEX MATCH "#define TAGLIB_MINOR_VERSION[ ]+[0-9]+" TAGLIB_MINOR_VERSION_MATCH ${TAGLIB_H})
string(REGEX MATCH "#define TAGLIB_PATCH_VERSION[ ]+[0-9]+" TAGLIB_PATCH_VERSION_MATCH ${TAGLIB_H})
string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+(.*)" "\\1" TAGLIB_MAJOR_VERSION "${TAGLIB_MAJOR_VERSION_MATCH}")
string(REGEX REPLACE ".*_MINOR_VERSION[ ]+(.*)" "\\1" TAGLIB_MINOR_VERSION "${TAGLIB_MINOR_VERSION_MATCH}")
string(REGEX REPLACE ".*_PATCH_VERSION[ ]+(.*)" "\\1" TAGLIB_PATCH_VERSION "${TAGLIB_PATCH_VERSION_MATCH}")
set(Taglib_VERSION "${TAGLIB_MAJOR_VERSION}.${TAGLIB_MINOR_VERSION}.${TAGLIB_PATCH_VERSION}")
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Taglib
FOUND_VAR
Taglib_FOUND
REQUIRED_VARS
Taglib_LIBRARIES
Taglib_INCLUDE_DIRS
VERSION_VAR
Taglib_VERSION
)
if (Taglib_FOUND AND NOT TARGET Taglib::Taglib)
add_library(Taglib::Taglib UNKNOWN IMPORTED)
set_target_properties(Taglib::Taglib PROPERTIES
IMPORTED_LOCATION "${Taglib_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Taglib_INCLUDE_DIRS}"
)
endif()
mark_as_advanced(Taglib_LIBRARIES Taglib_INCLUDE_DIRS)
include(FeatureSummary)
set_package_properties(Taglib PROPERTIES
URL "https://taglib.org/"
DESCRIPTION "A library for reading and editing the meta-data of audio formats"
)
@@ -0,0 +1,71 @@
# SPDX-FileCopyrightText: 2010 Rafael Fernández López <ereslibre@kde.org>
# SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindUDev
--------
Try to find the UDev library.
This will define the following variables:
``UDev_FOUND``
System has UDev.
``UDev_INCLUDE_DIRS``
The libudev include directory.
``UDev_LIBRARIES``
The libudev libraries.
``UDev_VERSION``
The libudev version.
If ``UDev_FOUND`` is TRUE, it will also define the following imported
target:
``UDev::UDev``
The UDev library
Since 5.57.0.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_UDEV QUIET libudev)
find_path(UDev_INCLUDE_DIRS NAMES libudev.h HINTS ${PC_UDEV_INCLUDE_DIRS})
find_library(UDev_LIBRARIES NAMES udev HINTS ${PC_UDEV_LIBRARY_DIRS})
set(UDev_VERSION ${PC_UDEV_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UDev
FOUND_VAR UDev_FOUND
REQUIRED_VARS UDev_INCLUDE_DIRS UDev_LIBRARIES
VERSION_VAR UDev_VERSION
)
mark_as_advanced(UDev_INCLUDE_DIRS UDev_LIBRARIES)
if(UDev_FOUND AND NOT TARGET UDev::UDev)
add_library(UDev::UDev UNKNOWN IMPORTED)
set_target_properties(UDev::UDev PROPERTIES
IMPORTED_LOCATION "${UDev_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${UDev_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "${PC_UDEV_CFLAGS_OTHER}"
)
endif()
# backward compat variables, remove for KF6
set(UDEV_FOUND ${UDev_FOUND})
set(UDEV_LIBS ${UDev_LIBRARIES})
set(UDEV_INCLUDE_DIR ${UDev_INCLUDE_DIRS})
mark_as_advanced(UDEV_FOUND UDEV_LIBS UDEV_INCLUDE_DIR)
include(FeatureSummary)
set_package_properties(UDev PROPERTIES
DESCRIPTION "API for enumerating and introspecting local devices (part of systemd)"
URL "https://www.freedesktop.org/wiki/Software/systemd/"
)
@@ -0,0 +1,137 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindWayland
-----------
Try to find Wayland.
This is a component-based find module, which makes use of the COMPONENTS
and OPTIONAL_COMPONENTS arguments to find_module. The following components
are available::
Client Server Cursor Egl
If no components are specified, this module will act as though all components
were passed to OPTIONAL_COMPONENTS.
This module will define the following variables, independently of the
components searched for or found:
``Wayland_FOUND``
TRUE if (the requested version of) Wayland is available
``Wayland_VERSION``
Found Wayland version
``Wayland_TARGETS``
A list of all targets imported by this module (note that there may be more
than the components that were requested)
``Wayland_LIBRARIES``
This can be passed to target_link_libraries() instead of the imported
targets
``Wayland_INCLUDE_DIRS``
This should be passed to target_include_directories() if the targets are
not used for linking
``Wayland_DEFINITIONS``
This should be passed to target_compile_options() if the targets are not
used for linking
``Wayland_DATADIR``
The core wayland protocols data directory
Since 5.73.0
For each searched-for components, ``Wayland_<component>_FOUND`` will be set to
TRUE if the corresponding Wayland library was found, and FALSE otherwise. If
``Wayland_<component>_FOUND`` is TRUE, the imported target
``Wayland::<component>`` will be defined. This module will also attempt to
determine ``Wayland_*_VERSION`` variables for each imported target, although
``Wayland_VERSION`` should normally be sufficient.
In general we recommend using the imported targets, as they are easier to use
and provide more control. Bear in mind, however, that if any target is in the
link interface of an exported library, it must be made available by the
package config file.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Wayland)
set(Wayland_known_components
Client
Server
Cursor
Egl
)
foreach(_comp ${Wayland_known_components})
string(TOLOWER "${_comp}" _lc_comp)
set(Wayland_${_comp}_component_deps)
set(Wayland_${_comp}_pkg_config "wayland-${_lc_comp}")
set(Wayland_${_comp}_lib "wayland-${_lc_comp}")
set(Wayland_${_comp}_header "wayland-${_lc_comp}.h")
endforeach()
set(Wayland_Egl_component_deps Client)
ecm_find_package_parse_components(Wayland
RESULT_VAR Wayland_components
KNOWN_COMPONENTS ${Wayland_known_components}
)
ecm_find_package_handle_library_components(Wayland
COMPONENTS ${Wayland_components}
)
# If pkg-config didn't provide us with version information,
# try to extract it from wayland-version.h
# (Note that the version from wayland-egl.pc will probably be
# the Mesa version, rather than the Wayland version, but that
# version will be ignored as we always find wayland-client.pc
# first).
if(NOT Wayland_VERSION)
find_file(Wayland_VERSION_HEADER
NAMES wayland-version.h
HINTS ${Wayland_INCLUDE_DIRS}
)
mark_as_advanced(Wayland_VERSION_HEADER)
if(Wayland_VERSION_HEADER)
file(READ ${Wayland_VERSION_HEADER} _wayland_version_header_contents)
string(REGEX REPLACE
"^.*[ \t]+WAYLAND_VERSION[ \t]+\"([0-9.]*)\".*$"
"\\1"
Wayland_VERSION
"${_wayland_version_header_contents}"
)
unset(_wayland_version_header_contents)
endif()
endif()
find_package_handle_standard_args(Wayland
FOUND_VAR
Wayland_FOUND
REQUIRED_VARS
Wayland_LIBRARIES
VERSION_VAR
Wayland_VERSION
HANDLE_COMPONENTS
)
pkg_get_variable(Wayland_DATADIR wayland-scanner pkgdatadir)
if (CMAKE_CROSSCOMPILING AND (NOT EXISTS "${Wayland_DATADIR}/wayland.xml"))
# PKG_CONFIG_SYSROOT_DIR only applies to -I and -L flags, so pkg-config
# does not prepend CMAKE_SYSROOT when cross-compiling unless you pass
# --define-prefix explicitly. Therefore we have to manually do prepend
# it here when cross-compiling.
# See https://gitlab.kitware.com/cmake/cmake/-/issues/16647#note_844761
set(Wayland_DATADIR ${CMAKE_SYSROOT}${Wayland_DATADIR})
endif()
if (NOT EXISTS "${Wayland_DATADIR}/wayland.xml")
message(WARNING "Could not find wayland.xml in ${Wayland_DATADIR}")
endif()
include(FeatureSummary)
set_package_properties(Wayland PROPERTIES
URL "https://wayland.freedesktop.org/"
DESCRIPTION "C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients"
)
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindWaylandProtocols
--------------------
Try to find wayland-protocols on a Unix system.
This will define the following variables:
``WaylandProtocols_FOUND``
True if (the requested version of) wayland-protocols is available
``WaylandProtocols_VERSION``
The version of wayland-protocols
``WaylandProtocols_DATADIR``
The wayland protocols data directory
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_wayland_protocols QUIET wayland-protocols)
set(WaylandProtocols_VERSION ${PKG_wayland_protocols_VERSION})
pkg_get_variable(WaylandProtocols_DATADIR wayland-protocols pkgdatadir)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WaylandProtocols
FOUND_VAR WaylandProtocols_FOUND
REQUIRED_VARS WaylandProtocols_DATADIR
VERSION_VAR WaylandProtocols_VERSION
)
include(FeatureSummary)
set_package_properties(WaylandProtocols PROPERTIES
DESCRIPTION "Specifications of extended Wayland protocols"
URL "https://wayland.freedesktop.org/"
)
@@ -0,0 +1,183 @@
# SPDX-FileCopyrightText: 2012-2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindWaylandScanner
------------------
Try to find wayland-scanner.
If the wayland-scanner executable is not in your PATH, you can provide
an alternative name or full path location with the ``WaylandScanner_EXECUTABLE``
variable.
This will define the following variables:
``WaylandScanner_FOUND``
True if wayland-scanner is available.
``WaylandScanner_EXECUTABLE``
The wayland-scanner executable.
If ``WaylandScanner_FOUND`` is TRUE, it will also define the following imported
target:
``Wayland::Scanner``
The wayland-scanner executable.
This module provides the following functions to generate C protocol
implementations:
- ``ecm_add_wayland_client_protocol``
- ``ecm_add_wayland_server_protocol``
::
ecm_add_wayland_client_protocol(<target>
PROTOCOL <xmlfile>
BASENAME <basename>
[PRIVATE_CODE])
ecm_add_wayland_client_protocol(<source_files_var>
PROTOCOL <xmlfile>
BASENAME <basename>
[PRIVATE_CODE])
Generate Wayland client protocol files from ``<xmlfile>`` XML
definition for the ``<basename>`` interface and append those files
to ``<source_files_var>`` or ``<target>``.
``PRIVATE_CODE`` instructs wayland-scanner to hide marshalling code
from the compiled DSO for use in other DSOs. The default is to
export this code.
::
ecm_add_wayland_server_protocol(<target>
PROTOCOL <xmlfile>
BASENAME <basename>
[PRIVATE_CODE])
ecm_add_wayland_server_protocol(<source_files_var>
PROTOCOL <xmlfile>
BASENAME <basename>
[PRIVATE_CODE])
Generate Wayland server protocol files from ``<xmlfile>`` XML
definition for the ``<basename>`` interface and append those files
to ``<source_files_var>`` or ``<target>``.
``PRIVATE_CODE`` instructs wayland-scanner to hide marshalling code
from the compiled DSO for use in other DSOs. The default is to
export this code.
Since 1.4.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(WaylandScanner)
# Find wayland-scanner
find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WaylandScanner
FOUND_VAR
WaylandScanner_FOUND
REQUIRED_VARS
WaylandScanner_EXECUTABLE
)
mark_as_advanced(WaylandScanner_EXECUTABLE)
if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND)
add_executable(Wayland::Scanner IMPORTED)
set_target_properties(Wayland::Scanner PROPERTIES
IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}"
)
endif()
include(FeatureSummary)
set_package_properties(WaylandScanner PROPERTIES
URL "https://wayland.freedesktop.org/"
DESCRIPTION "Executable that converts XML protocol files to C code"
)
function(ecm_add_wayland_client_protocol target_or_sources_var)
# Parse arguments
set(options PRIVATE_CODE)
set(oneValueArgs PROTOCOL BASENAME)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c")
if(ARGS_PRIVATE_CODE)
set(_code_type private-code)
else()
set(_code_type public-code)
endif()
set_source_files_properties(${_client_header} GENERATED)
set_source_files_properties(${_code} GENERATED)
set_property(SOURCE ${_client_header} ${_code} PROPERTY SKIP_AUTOMOC ON)
add_custom_command(OUTPUT "${_client_header}"
COMMAND ${WaylandScanner_EXECUTABLE} client-header ${_infile} ${_client_header}
DEPENDS ${_infile} VERBATIM)
add_custom_command(OUTPUT "${_code}"
COMMAND ${WaylandScanner_EXECUTABLE} ${_code_type} ${_infile} ${_code}
DEPENDS ${_infile} ${_client_header} VERBATIM)
if (TARGET ${target_or_sources_var})
target_sources(${target_or_sources_var} PRIVATE "${_client_header}" "${_code}")
else()
list(APPEND ${target_or_sources_var} "${_client_header}" "${_code}")
set(${target_or_sources_var} ${${target_or_sources_var}} PARENT_SCOPE)
endif()
endfunction()
function(ecm_add_wayland_server_protocol target_or_sources_var)
# Parse arguments
set(options PRIVATE_CODE)
set(oneValueArgs PROTOCOL BASENAME)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
if(ARGS_PRIVATE_CODE)
set(_private_code_option PRIVATE_CODE)
endif()
ecm_add_wayland_client_protocol(${target_or_sources_var}
PROTOCOL ${ARGS_PROTOCOL}
BASENAME ${ARGS_BASENAME}
${_private_code_option})
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h")
set(_server_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c")
set_property(SOURCE ${_server_header} ${_server_code} PROPERTY SKIP_AUTOMOC ON)
set_source_files_properties(${_server_header} GENERATED)
add_custom_command(OUTPUT "${_server_header}"
COMMAND ${WaylandScanner_EXECUTABLE} server-header ${_infile} ${_server_header}
DEPENDS ${_infile} VERBATIM)
if (TARGET ${target_or_sources_var})
target_sources(${target_or_sources_var} PRIVATE "${_server_header}")
else()
list(APPEND ${target_or_sources_var} "${_server_header}")
set(${target_or_sources_var} ${${target_or_sources_var}} PARENT_SCOPE)
endif()
endfunction()
@@ -0,0 +1,96 @@
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2011 Fredrik Höglund <fredrik@kde.org>
# SPDX-FileCopyrightText: 2008 Helio Chissini de Castro <helio@kde.org>
# SPDX-FileCopyrightText: 2007 Matthias Kretz <kretz@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindX11_XCB
-----------
Try to find the X11 XCB compatibility library.
This will define the following variables:
``X11_XCB_FOUND``
True if (the requested version of) libX11-xcb is available
``X11_XCB_VERSION``
The version of libX11-xcb (this is not guaranteed to be set even when
X11_XCB_FOUND is true)
``X11_XCB_LIBRARIES``
This can be passed to target_link_libraries() instead of the ``EGL::EGL``
target
``X11_XCB_INCLUDE_DIR``
This should be passed to target_include_directories() if the target is not
used for linking
``X11_XCB_DEFINITIONS``
This should be passed to target_compile_options() if the target is not
used for linking
If ``X11_XCB_FOUND`` is TRUE, it will also define the following imported
target:
``X11::XCB``
The X11 XCB compatibility library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(X11_XCB)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_X11_XCB QUIET x11-xcb)
set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS_OTHER})
set(X11_XCB_VERSION ${PKG_X11_XCB_VERSION})
find_path(X11_XCB_INCLUDE_DIR
NAMES X11/Xlib-xcb.h
HINTS ${PKG_X11_XCB_INCLUDE_DIRS}
)
find_library(X11_XCB_LIBRARY
NAMES X11-xcb
HINTS ${PKG_X11_XCB_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(X11_XCB
FOUND_VAR
X11_XCB_FOUND
REQUIRED_VARS
X11_XCB_LIBRARY
X11_XCB_INCLUDE_DIR
VERSION_VAR
X11_XCB_VERSION
)
if(X11_XCB_FOUND AND NOT TARGET X11::XCB)
add_library(X11::XCB UNKNOWN IMPORTED)
set_target_properties(X11::XCB PROPERTIES
IMPORTED_LOCATION "${X11_XCB_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${X11_XCB_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}"
)
endif()
mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARY)
# compatibility variables
set(X11_XCB_LIBRARIES ${X11_XCB_LIBRARY})
set(X11_XCB_INCLUDE_DIRS ${X11_XCB_INCLUDE_DIR})
set(X11_XCB_VERSION_STRING ${X11_XCB_VERSION})
include(FeatureSummary)
set_package_properties(X11_XCB PROPERTIES
URL "https://xorg.freedesktop.org/"
DESCRIPTION "A compatibility library for code that translates Xlib API calls into XCB calls"
)
@@ -0,0 +1,168 @@
# SPDX-FileCopyrightText: 2011 Fredrik Höglund <fredrik@kde.org>
# SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
# SPDX-FileCopyrightText: 2014-2015 Alex Merry <alex.merry@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
FindXCB
-------
Try to find XCB.
This is a component-based find module, which makes use of the COMPONENTS and
OPTIONAL_COMPONENTS arguments to find_module. The following components are
available::
XCB
ATOM AUX COMPOSITE CURSOR DAMAGE
DPMS DRI2 DRI3 EVENT EWMH
GLX ICCCM IMAGE KEYSYMS PRESENT
RANDR RECORD RENDER RENDERUTIL RES
SCREENSAVER SHAPE SHM SYNC UTIL
XF86DRI XFIXES XINERAMA XINPUT XKB
XTEST XV XVMC
If no components are specified, this module will act as though all components
were passed to OPTIONAL_COMPONENTS. Before 5.82 this excluded XINPUT. Since 5.82
all components are searched for.
This module will define the following variables, independently of the
components searched for or found:
``XCB_FOUND``
True if (the requestion version of) xcb is available
``XCB_VERSION``
Found xcb version
``XCB_TARGETS``
A list of all targets imported by this module (note that there may be more
than the components that were requested)
``XCB_LIBRARIES``
This can be passed to target_link_libraries() instead of the imported
targets
``XCB_INCLUDE_DIRS``
This should be passed to target_include_directories() if the targets are
not used for linking
``XCB_DEFINITIONS``
This should be passed to target_compile_options() if the targets are not
used for linking
For each searched-for components, ``XCB_<component>_FOUND`` will be set to
true if the corresponding xcb library was found, and false otherwise. If
``XCB_<component>_FOUND`` is true, the imported target ``XCB::<component>``
will be defined. This module will also attempt to determine
``XCB_*_VERSION`` variables for each imported target, although
``XCB_VERSION`` should normally be sufficient.
In general we recommend using the imported targets, as they are easier to use
and provide more control. Bear in mind, however, that if any target is in the
link interface of an exported library, it must be made available by the
package config file.
Since pre-1.0.0.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(XCB)
# Note that this list needs to be ordered such that any component
# appears after its dependencies
set(XCB_known_components
XCB
RENDER
SHAPE
XFIXES
SHM
ATOM
AUX
COMPOSITE
CURSOR
DAMAGE
DPMS
DRI2
DRI3
EVENT
EWMH
GLX
ICCCM
IMAGE
KEYSYMS
PRESENT
RANDR
RECORD
RENDERUTIL
RES
SCREENSAVER
SYNC
UTIL
XF86DRI
XINERAMA
XINPUT
XKB
XTEST
XV
XVMC
)
# default component info: xcb components have fairly predictable
# header files, library names and pkg-config names
foreach(_comp ${XCB_known_components})
string(TOLOWER "${_comp}" _lc_comp)
set(XCB_${_comp}_component_deps XCB)
set(XCB_${_comp}_pkg_config "xcb-${_lc_comp}")
set(XCB_${_comp}_lib "xcb-${_lc_comp}")
set(XCB_${_comp}_header "xcb/${_lc_comp}.h")
endforeach()
# exceptions
set(XCB_XCB_component_deps)
set(XCB_COMPOSITE_component_deps XCB XFIXES)
set(XCB_DAMAGE_component_deps XCB XFIXES)
set(XCB_IMAGE_component_deps XCB SHM)
set(XCB_RENDERUTIL_component_deps XCB RENDER)
set(XCB_XFIXES_component_deps XCB RENDER SHAPE)
set(XCB_XVMC_component_deps XCB XV)
set(XCB_XV_component_deps XCB SHM)
set(XCB_XCB_pkg_config "xcb")
set(XCB_XCB_lib "xcb")
set(XCB_ATOM_header "xcb/xcb_atom.h")
set(XCB_ATOM_lib "xcb-util")
set(XCB_AUX_header "xcb/xcb_aux.h")
set(XCB_AUX_lib "xcb-util")
set(XCB_CURSOR_header "xcb/xcb_cursor.h")
set(XCB_EVENT_header "xcb/xcb_event.h")
set(XCB_EVENT_lib "xcb-util")
set(XCB_EWMH_header "xcb/xcb_ewmh.h")
set(XCB_ICCCM_header "xcb/xcb_icccm.h")
set(XCB_IMAGE_header "xcb/xcb_image.h")
set(XCB_KEYSYMS_header "xcb/xcb_keysyms.h")
set(XCB_PIXEL_header "xcb/xcb_pixel.h")
set(XCB_RENDERUTIL_header "xcb/xcb_renderutil.h")
set(XCB_RENDERUTIL_lib "xcb-render-util")
set(XCB_UTIL_header "xcb/xcb_util.h")
ecm_find_package_parse_components(XCB
RESULT_VAR XCB_components
KNOWN_COMPONENTS ${XCB_known_components}
DEFAULT_COMPONENTS ${XCB_default_components}
)
ecm_find_package_handle_library_components(XCB
COMPONENTS ${XCB_components}
)
find_package_handle_standard_args(XCB
FOUND_VAR
XCB_FOUND
REQUIRED_VARS
XCB_LIBRARIES
VERSION_VAR
XCB_VERSION
HANDLE_COMPONENTS
)
include(FeatureSummary)
set_package_properties(XCB PROPERTIES
URL "https://xcb.freedesktop.org/"
DESCRIPTION "X protocol C-language Binding"
)
@@ -0,0 +1,84 @@
# SPDX-FileCopyrightText: 2014 Fredrik Höglund <fredrik@kde.org>
# SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
Findepoxy
---------
Try to find libepoxy on a Unix system.
This will define the following variables:
``epoxy_FOUND``
True if (the requested version of) libepoxy is available
``epoxy_VERSION``
The version of libepoxy
``epoxy_LIBRARIES``
This should be passed to target_link_libraries() if the target is not
used for linking
``epoxy_INCLUDE_DIRS``
This should be passed to target_include_directories() if the target is not
used for linking
``epoxy_DEFINITIONS``
This should be passed to target_compile_options() if the target is not
used for linking
``epoxy_HAS_GLX``
True if GLX support is available
If ``epoxy_FOUND`` is TRUE, it will also define the following imported target:
``epoxy::epoxy``
The epoxy library
In general we recommend using the imported target, as it is easier to use.
Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_epoxy QUIET epoxy)
set(epoxy_VERSION ${PKG_epoxy_VERSION})
set(epoxy_DEFINITIONS ${PKG_epoxy_CFLAGS})
find_path(epoxy_INCLUDE_DIRS
NAMES epoxy/gl.h
HINTS ${PKG_epoxy_INCLUDEDIR} ${PKG_epoxy_INCLUDE_DIRS}
)
find_library(epoxy_LIBRARIES
NAMES epoxy
HINTS ${PKG_epoxy_LIBDIR} ${PKG_epoxy_LIBRARY_DIRS}
)
find_file(epoxy_GLX_HEADER NAMES epoxy/glx.h HINTS ${epoxy_INCLUDE_DIR})
if (epoxy_GLX_HEADER STREQUAL "epoxy_GLX_HEADER-NOTFOUND")
set(epoxy_HAS_GLX FALSE CACHE BOOL "whether glx is available")
else ()
set(epoxy_HAS_GLX TRUE CACHE BOOL "whether glx is available")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(epoxy
FOUND_VAR epoxy_FOUND
REQUIRED_VARS epoxy_LIBRARIES epoxy_INCLUDE_DIRS
VERSION_VAR epoxy_VERSION
)
if (epoxy_FOUND AND NOT TARGET epoxy::epoxy)
add_library(epoxy::epoxy UNKNOWN IMPORTED)
set_target_properties(epoxy::epoxy PROPERTIES
IMPORTED_LOCATION "${epoxy_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${epoxy_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${epoxy_INCLUDE_DIRS}"
)
endif()
mark_as_advanced(
epoxy_DEFINITIONS
epoxy_HAS_GLX
epoxy_INCLUDE_DIRS
epoxy_LIBRARIES
epoxy_VERSION
)
@@ -0,0 +1,54 @@
# SPDX-FileCopyrightText: 2019, 2021 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#[=======================================================================[.rst:
Findgzip
--------
Try to find gzip.
If the gzip executable is not in your PATH, you can provide
an alternative name or full path location with the ``gzip_EXECUTABLE``
variable.
This will define the following variables:
``gzip_FOUND``
TRUE if gzip is available
``gzip_EXECUTABLE``
Path to gzip executable
If ``gzip_FOUND`` is TRUE, it will also define the following imported
target:
``gzip::gzip``
Path to gzip executable
Since 5.85.0.
#]=======================================================================]
find_program(gzip_EXECUTABLE NAMES gzip)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(gzip
FOUND_VAR
gzip_FOUND
REQUIRED_VARS
gzip_EXECUTABLE
)
mark_as_advanced(gzip_EXECUTABLE)
if(NOT TARGET gzip::gzip AND gzip_FOUND)
add_executable(gzip::gzip IMPORTED)
set_target_properties(gzip::gzip PROPERTIES
IMPORTED_LOCATION "${gzip_EXECUTABLE}"
)
endif()
include(FeatureSummary)
set_package_properties(gzip PROPERTIES
URL "https://www.gnu.org/software/gzip"
DESCRIPTION "Data compression program for the gzip format"
)
@@ -0,0 +1 @@
sdk.dir=@ANDROID_SDK_ROOT@
@@ -0,0 +1 @@
rootProject.name = '@ARG_NAME@'