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:
@@ -0,0 +1,33 @@
|
||||
# Ignore generated cmake files
|
||||
cmake/ECMConfig.cmake
|
||||
cmake/ECMConfigVersion.cmake
|
||||
|
||||
# Ignore the following files
|
||||
*~
|
||||
*.[oa]
|
||||
*.diff
|
||||
*.kate-swp
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
*.kdevelop.pcs
|
||||
*.moc
|
||||
*.moc.cpp
|
||||
*.orig
|
||||
*.user
|
||||
.*.swp
|
||||
.swp.*
|
||||
Doxyfile
|
||||
Makefile
|
||||
avail
|
||||
random_seed
|
||||
/build*/
|
||||
/cmake-build*/
|
||||
.idea
|
||||
/.vscode/
|
||||
CMakeLists.txt.user*
|
||||
*.unc-backup*
|
||||
__pycache__
|
||||
.cmake/
|
||||
/compile_commands.json
|
||||
/.clang-format
|
||||
/Testing
|
||||
@@ -0,0 +1,18 @@
|
||||
# SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
include:
|
||||
- project: sysadmin/ci-utilities
|
||||
file:
|
||||
- /gitlab-templates/linux.yml
|
||||
- /gitlab-templates/linux-static.yml
|
||||
- /gitlab-templates/freebsd.yml
|
||||
- /gitlab-templates/android-qt6.yml
|
||||
- /gitlab-templates/linux-qt6.yml
|
||||
- /gitlab-templates/linux-qt6-static.yml
|
||||
- /gitlab-templates/windows.yml
|
||||
- /gitlab-templates/windows-static.yml
|
||||
- /gitlab-templates/freebsd-qt6.yml
|
||||
- /gitlab-templates/windows-qt6.yml
|
||||
- /gitlab-templates/alpine-qt6.yml
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
Options:
|
||||
per-test-timeout: 120
|
||||
require-passing-tests-on: [ 'Linux', 'FreeBSD', 'Windows' ]
|
||||
@@ -0,0 +1,159 @@
|
||||
#=============================================================================
|
||||
# SPDX-FileCopyrightText: 2006-2013 Alex Neundorf <neundorf@kde.org>
|
||||
# SPDX-FileCopyrightText: 2014-2015 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#=============================================================================
|
||||
|
||||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
|
||||
#
|
||||
# Preliminary setup
|
||||
#
|
||||
|
||||
set(VERSION "6.10.0") # handled by release scripts
|
||||
|
||||
project(ECM
|
||||
VERSION "${VERSION}"
|
||||
LANGUAGES NONE
|
||||
)
|
||||
|
||||
#
|
||||
# Includes
|
||||
#
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
|
||||
#
|
||||
# Installation paths
|
||||
#
|
||||
|
||||
set(SHARE_INSTALL_DIR share
|
||||
CACHE
|
||||
PATH
|
||||
"read-only architecture-independent data"
|
||||
)
|
||||
|
||||
set(CMAKECONFIG_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/cmake/)
|
||||
|
||||
set(FIND_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/find-modules/)
|
||||
set(KDE_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/kde-modules/)
|
||||
set(MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/modules/)
|
||||
set(TOOLCHAIN_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/toolchain/)
|
||||
|
||||
set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/ECM
|
||||
CACHE
|
||||
PATH
|
||||
"HTML and QtHelp documentation"
|
||||
)
|
||||
set(MAN_INSTALL_DIR ${SHARE_INSTALL_DIR}/man
|
||||
CACHE
|
||||
PATH
|
||||
"man pages"
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Documentation
|
||||
#
|
||||
|
||||
option(BUILD_DOC "Build documentation." ON)
|
||||
add_feature_info(BUILD_DOC BUILD_DOC "Build documentation.")
|
||||
if(BUILD_DOC)
|
||||
add_subdirectory(docs)
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
|
||||
option(BUILD_TESTING "Build automated tests." ON)
|
||||
add_feature_info(BUILD_TESTING BUILD_TESTING "Build automated tests.")
|
||||
if(BUILD_TESTING)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
||||
#
|
||||
# Install modules
|
||||
#
|
||||
|
||||
file(GLOB installModuleFiles ${CMAKE_SOURCE_DIR}/modules/*[^~])
|
||||
install(FILES ${installModuleFiles} DESTINATION ${MODULES_INSTALL_DIR})
|
||||
|
||||
file(GLOB installTestModuleFiles ${CMAKE_SOURCE_DIR}/test-modules/*[^~])
|
||||
install(FILES ${installTestModuleFiles} DESTINATION ${SHARE_INSTALL_DIR}/ECM/test-modules)
|
||||
|
||||
file(GLOB installKdeModuleFiles LIST_DIRECTORIES FALSE ${CMAKE_SOURCE_DIR}/kde-modules/*[^~])
|
||||
install(FILES ${installKdeModuleFiles} DESTINATION ${KDE_MODULES_INSTALL_DIR})
|
||||
# The scripts need to be executable
|
||||
file(GLOB installKDECommitHooks ${CMAKE_SOURCE_DIR}/kde-modules/kde-git-commit-hooks/*[^~])
|
||||
install(PROGRAMS ${installKDECommitHooks} DESTINATION ${KDE_MODULES_INSTALL_DIR}/kde-git-commit-hooks)
|
||||
|
||||
file(GLOB installFindModuleFiles ${CMAKE_SOURCE_DIR}/find-modules/*.cmake ${CMAKE_SOURCE_DIR}/find-modules/*.py)
|
||||
install(FILES ${installFindModuleFiles} DESTINATION ${FIND_MODULES_INSTALL_DIR})
|
||||
|
||||
file(GLOB installToolchainModuleFiles ${CMAKE_SOURCE_DIR}/toolchain/*[^~])
|
||||
install(FILES ${installToolchainModuleFiles} DESTINATION ${TOOLCHAIN_MODULES_INSTALL_DIR})
|
||||
|
||||
|
||||
#
|
||||
# Config.cmake file
|
||||
#
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(
|
||||
ECMConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ECMConfig.cmake
|
||||
INSTALL_DESTINATION
|
||||
${CMAKECONFIG_INSTALL_DIR}
|
||||
PATH_VARS
|
||||
FIND_MODULES_INSTALL_DIR
|
||||
KDE_MODULES_INSTALL_DIR
|
||||
MODULES_INSTALL_DIR
|
||||
)
|
||||
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ECMConfigVersion.cmake
|
||||
VERSION
|
||||
"${PROJECT_VERSION}"
|
||||
COMPATIBILITY
|
||||
AnyNewerVersion
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ECMConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ECMConfigVersion.cmake
|
||||
DESTINATION
|
||||
${CMAKECONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Packaging
|
||||
#
|
||||
|
||||
set(CPACK_PACKAGE_NAME extra-cmake-modules)
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_SYSTEM_NAME "generic")
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
set(CPACK_SET_DESTDIR FALSE)
|
||||
|
||||
include(CPack)
|
||||
|
||||
|
||||
#
|
||||
# Feature summary
|
||||
#
|
||||
|
||||
feature_summary(
|
||||
FATAL_ON_MISSING_REQUIRED_PACKAGES
|
||||
WHAT ALL
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,15 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set(ECM_FIND_MODULE_DIR "@PACKAGE_FIND_MODULES_INSTALL_DIR@")
|
||||
|
||||
set(ECM_MODULE_DIR "@PACKAGE_MODULES_INSTALL_DIR@")
|
||||
|
||||
set(ECM_KDE_MODULE_DIR "@PACKAGE_KDE_MODULES_INSTALL_DIR@")
|
||||
|
||||
set(ECM_PREFIX "@CMAKE_INSTALL_PREFIX@")
|
||||
|
||||
set(ECM_MODULE_PATH "${ECM_MODULE_DIR}" "${ECM_FIND_MODULE_DIR}" "${ECM_KDE_MODULE_DIR}")
|
||||
|
||||
set(ECM_GLOBAL_FIND_VERSION "${ECM_FIND_VERSION}")
|
||||
|
||||
include("${ECM_MODULE_DIR}/ECMUseFindModules.cmake")
|
||||
@@ -0,0 +1,22 @@
|
||||
Copyright (c) <year> <owner>. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,26 @@
|
||||
Copyright (c) <year> <owner>. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,121 @@
|
||||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
@@ -0,0 +1,19 @@
|
||||
MIT License Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Extra CMake Modules
|
||||
|
||||
## Introduction
|
||||
|
||||
The Extra CMake Modules package, or ECM, adds to the modules provided by CMake,
|
||||
including ones used by ``find_package()`` to find common software, ones that
|
||||
can be used directly in ``CMakeLists.txt`` files to perform common tasks and
|
||||
toolchain files that must be specified on the commandline by the user.
|
||||
|
||||
In addition, it provides common build settings used in software produced by the
|
||||
KDE community.
|
||||
|
||||
While the driving force of this module is to reduce duplication in CMake scripts
|
||||
across KDE software, it is intended to be useful for any software that uses the
|
||||
CMake build system.
|
||||
|
||||
For more information visit the documentation at https://api.kde.org/ecm/
|
||||
@@ -0,0 +1,97 @@
|
||||
Extra CMake Modules
|
||||
*******************
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
The Extra CMake Modules package, or ECM, adds to the modules provided by CMake,
|
||||
including ones used by ``find_package()`` to find common software, ones that
|
||||
can be used directly in ``CMakeLists.txt`` files to perform common tasks and
|
||||
toolchain files that must be specified on the commandline by the user.
|
||||
|
||||
In addition, it provides common build settings used in software produced by the
|
||||
KDE community.
|
||||
|
||||
While the driving force of this module is to reduce duplication in CMake scripts
|
||||
across KDE software, it is intended to be useful for any software that uses the
|
||||
CMake build system.
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
To use ECM, add the following to your ``CMakeLists.txt``:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(ECM REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
|
||||
(note that you may want to append ``${ECM_MODULE_PATH}`` to
|
||||
``CMAKE_MODULE_PATH`` rather than discarding the existing value). You can then
|
||||
just include the modules you require, or use ``find_package()`` as needed. For
|
||||
example:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
include(ECMInstallIcons)
|
||||
|
||||
Developers of KDE software will often want to use the KDE standard settings
|
||||
provided by ECM; they can do the following:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(ECM REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
include(KDEInstallDirs)
|
||||
include(KDECompilerSettings)
|
||||
include(KDECMakeSettings)
|
||||
|
||||
Note that any combination of the above includes can be used if you only want
|
||||
some of the settings. Some of the functionality of
|
||||
:kde-module:`KDECMakeSettings` can also be selectively disabled.
|
||||
|
||||
|
||||
Organization
|
||||
------------
|
||||
|
||||
ECM provides four different types of modules.
|
||||
|
||||
* Core modules provide helpful macros for use in project CMake scripts.
|
||||
See :manual:`ecm-modules(7)` for more information.
|
||||
* Find modules extend the functionality of CMake's ``find_package()`` command.
|
||||
See :manual:`ecm-find-modules(7)` for more information.
|
||||
* KDE modules provide common settings for software produced by KDE; much of this
|
||||
may also be useful to other projects. See :manual:`ecm-kde-modules(7)` for
|
||||
more information.
|
||||
* Toolchain files change the build tools and targets used by CMake. See
|
||||
:manual:`ecm-toolchains(7)` for more information.
|
||||
|
||||
The ``${ECM_MODULE_DIR}``, ``${ECM_FIND_MODULE_DIR}`` and
|
||||
``${ECM_KDE_MODULE_DIR}`` variables may be used instead of
|
||||
``${ECM_MODULE_PATH}`` if you only need some of this functionality.
|
||||
|
||||
|
||||
Development
|
||||
===========
|
||||
|
||||
The :manual:`ecm-developer(7)` manual contains more information about
|
||||
developing for Extra CMake Modules.
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
All code is licensed under the `BSD 3-Clause license`_.
|
||||
|
||||
.. _BSD 3-Clause license: https://opensource.org/licenses/BSD-3-Clause
|
||||
|
||||
|
||||
Links
|
||||
=====
|
||||
|
||||
* Home page: https://commits.kde.org/extra-cmake-modules
|
||||
* Documentation: https://api.kde.org/ecm/
|
||||
* Mailing list: https://mail.kde.org/mailman/listinfo/kde-buildsystem
|
||||
* IRC channel: #kde-devel on Libera Chat
|
||||
* Git repository: https://commits.kde.org/extra-cmake-modules
|
||||
@@ -0,0 +1,69 @@
|
||||
# SPDX-FileCopyrightText: 2015 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindSphinx
|
||||
----------
|
||||
|
||||
Try to find the Sphinx documentation builder.
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``Sphinx_FOUND``
|
||||
True if (the requested version of) Sphinx is available
|
||||
``Sphinx_VERSION``
|
||||
The version of the Sphinx documentation builder.
|
||||
``Sphinx_BUILD_EXECUTABLE``
|
||||
The path to the Sphinx documentation builder executable.
|
||||
|
||||
If ``Sphinx_FOUND`` is TRUE, it will also define the following imported target:
|
||||
|
||||
``Sphinx::Build``
|
||||
The Sphinx documentation builder.
|
||||
|
||||
In general we recommend using the imported target, as it is easier to use.
|
||||
|
||||
Since 5.17.0.
|
||||
#]=======================================================================]
|
||||
|
||||
# Distros sometimes rename Python executables to allow for parallel
|
||||
# installation of Python2 and Python3 versions
|
||||
find_program(Sphinx_BUILD_EXECUTABLE
|
||||
NAMES
|
||||
sphinx-build
|
||||
sphinx-build2
|
||||
sphinx-build3
|
||||
DOC "Sphinx Documentation Builder (https://www.sphinx-doc.org/)"
|
||||
)
|
||||
|
||||
if (Sphinx_BUILD_EXECUTABLE)
|
||||
if(NOT TARGET Sphinx::Build)
|
||||
add_executable(Sphinx::Build IMPORTED)
|
||||
set_target_properties(Sphinx::Build PROPERTIES
|
||||
IMPORTED_LOCATION "${Sphinx_BUILD_EXECUTABLE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND "${Sphinx_BUILD_EXECUTABLE}" --version
|
||||
OUTPUT_VARIABLE _Sphinx_version_raw
|
||||
ERROR_VARIABLE _Sphinx_version_raw
|
||||
)
|
||||
if (_Sphinx_version_raw MATCHES "^Sphinx \\([^)]*\\) ([0-9]+(\\.[0-9]+)*)")
|
||||
set(Sphinx_VERSION "${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
unset(_Sphinx_version_raw)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sphinx
|
||||
FOUND_VAR
|
||||
Sphinx_FOUND
|
||||
REQUIRED_VARS
|
||||
Sphinx_BUILD_EXECUTABLE
|
||||
VERSION_VAR
|
||||
Sphinx_VERSION
|
||||
)
|
||||
|
||||
mark_as_advanced(Sphinx_BUILD_EXECUTABLE)
|
||||
@@ -0,0 +1,138 @@
|
||||
#=============================================================================
|
||||
# SPDX-FileCopyrightText: 2000-2013 Kitware, Inc.
|
||||
# SPDX-FileCopyrightText: 2014-2015 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#=============================================================================
|
||||
|
||||
include(CMakeDependentOption)
|
||||
enable_language(CXX)
|
||||
|
||||
find_package(Sphinx 1.2 MODULE)
|
||||
set_package_properties(
|
||||
Sphinx
|
||||
PROPERTIES
|
||||
URL "https://www.sphinx-doc.org/"
|
||||
DESCRIPTION "Tool to generate documentation."
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required to build documentation for Extra CMake Modules."
|
||||
)
|
||||
|
||||
find_package(Qt6 COMPONENTS ToolsTools)
|
||||
set_package_properties(
|
||||
Qt6ToolsTools
|
||||
PROPERTIES
|
||||
URL "https://www.qt.io/"
|
||||
DESCRIPTION "Qt help collection generator."
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required to build Extra CMake Modules documentation in Qt Help format."
|
||||
)
|
||||
|
||||
cmake_dependent_option(
|
||||
BUILD_HTML_DOCS "Build html help with Sphinx" ON
|
||||
"Sphinx_FOUND" OFF
|
||||
)
|
||||
add_feature_info(BUILD_HTML_DOCS BUILD_HTML_DOCS "Generate HTML documentation for installed modules.")
|
||||
|
||||
cmake_dependent_option(
|
||||
BUILD_MAN_DOCS "Build man pages with Sphinx" ON
|
||||
"Sphinx_FOUND" OFF
|
||||
)
|
||||
add_feature_info(BUILD_MAN_DOCS BUILD_MAN_DOCS "Generate man page documentation for installed modules.")
|
||||
|
||||
if(TARGET Qt6::qhelpgenerator)
|
||||
set(QHelpGenerator_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
cmake_dependent_option(
|
||||
BUILD_QTHELP_DOCS "Build Qt help with Sphinx" ON
|
||||
"Sphinx_FOUND;QHelpGenerator_FOUND" OFF
|
||||
)
|
||||
add_feature_info(BUILD_QTHELP_DOCS BUILD_QTHELP_DOCS "Generate QtHelp documentation for installed modules.")
|
||||
|
||||
|
||||
set(doc_formats "")
|
||||
if(BUILD_HTML_DOCS)
|
||||
list(APPEND doc_formats html)
|
||||
endif()
|
||||
if(BUILD_MAN_DOCS)
|
||||
list(APPEND doc_formats man)
|
||||
endif()
|
||||
if(BUILD_QTHELP_DOCS)
|
||||
list(APPEND doc_formats qthelp)
|
||||
set(qthelp_extra_commands
|
||||
COMMAND
|
||||
Qt6::qhelpgenerator
|
||||
${CMAKE_CURRENT_BINARY_DIR}/qthelp/ExtraCMakeModules.qhcp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT doc_formats)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (Sphinx_VERSION VERSION_LESS 1.3)
|
||||
set(sphinx_theme default)
|
||||
else()
|
||||
set(sphinx_theme classic)
|
||||
endif()
|
||||
configure_file(sphinx/conf.py.in conf.py @ONLY)
|
||||
configure_file(sphinx/ecm.css.in static/ecm.css)
|
||||
|
||||
|
||||
set(doc_format_outputs "")
|
||||
set(doc_format_last "")
|
||||
foreach(format ${doc_formats})
|
||||
set(doc_format_output "doc_format_${format}")
|
||||
set(doc_format_log "build-${format}.log")
|
||||
add_custom_command(
|
||||
OUTPUT ${doc_format_output}
|
||||
COMMAND
|
||||
Sphinx::Build
|
||||
-D man_make_section_directory=0
|
||||
-c ${CMAKE_CURRENT_BINARY_DIR}
|
||||
-d ${CMAKE_CURRENT_BINARY_DIR}/doctrees
|
||||
-b ${format}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${format}
|
||||
> ${doc_format_log} # log stdout, pass stderr
|
||||
${${format}_extra_commands}
|
||||
DEPENDS ${doc_format_last}
|
||||
COMMENT "sphinx-build ${format}: see ${CMAKE_CURRENT_BINARY_DIR}/${doc_format_log}"
|
||||
VERBATIM
|
||||
)
|
||||
set_property(SOURCE ${doc_format_output} PROPERTY SYMBOLIC 1)
|
||||
list(APPEND doc_format_outputs ${doc_format_output})
|
||||
set(doc_format_last ${doc_format_output})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(documentation ALL DEPENDS ${doc_format_outputs})
|
||||
|
||||
if(BUILD_MAN_DOCS)
|
||||
file(GLOB man_rst RELATIVE ${ECM_SOURCE_DIR}/docs/manual
|
||||
${ECM_SOURCE_DIR}/docs/manual/*.[1-9].rst)
|
||||
foreach(m ${man_rst})
|
||||
if("x${m}" MATCHES "^x(.+)\\.([1-9])\\.rst$")
|
||||
set(name "${CMAKE_MATCH_1}")
|
||||
set(sec "${CMAKE_MATCH_2}")
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/man/${name}.${sec}
|
||||
DESTINATION ${MAN_INSTALL_DIR}/man${sec}
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
if(BUILD_HTML_DOCS)
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
|
||||
DESTINATION ${DOC_INSTALL_DIR}
|
||||
PATTERN .buildinfo EXCLUDE
|
||||
PATTERN objects.inv EXCLUDE
|
||||
)
|
||||
endif()
|
||||
if(BUILD_QTHELP_DOCS)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/ExtraCMakeModules.qch
|
||||
DESTINATION ${DOC_INSTALL_DIR}
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/Find7Zip.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/Find7z.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindCanberra.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindEGL.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindGLIB2.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindGperf.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindGradle.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindIcoTool.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindInotify.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindIsoCodes.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindKF5.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindLibExiv2.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindLibGit2.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindLibMount.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindLibcap.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindOpenEXR.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindPhoneNumber.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindPoppler.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindPulseAudio.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindQtWaylandScanner.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindSasl2.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindSeccomp.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindSharedMimeInfo.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindTaglib.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindUDev.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindWayland.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindWaylandProtocols.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindWaylandScanner.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindX11_XCB.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/FindXCB.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/Findepoxy.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../find-modules/Findgzip.cmake
|
||||
@@ -0,0 +1,19 @@
|
||||
.. title:: Extra CMake Modules Reference Documentation
|
||||
|
||||
Reference Manuals
|
||||
#################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
/manual/ecm.7
|
||||
/manual/*
|
||||
|
||||
.. only:: html
|
||||
|
||||
Index and Search
|
||||
################
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`search`
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDECMakeSettings.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEClangFormat.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDECompilerSettings.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEFrameworkCompilerSettings.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEGitCommitHooks.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEInstallDirs.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEInstallDirs5.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEInstallDirs6.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEMetaInfoPlatformCheck.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../kde-modules/KDEPackageAppTemplates.cmake
|
||||
@@ -0,0 +1,239 @@
|
||||
.. ecm-manual-description: ECM Developer Reference
|
||||
|
||||
ecm-developer(7)
|
||||
****************
|
||||
|
||||
.. only:: html or latex
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
Writing Modules
|
||||
===============
|
||||
|
||||
The CMake 3 documentation (and `cmake-developer(7)`_ in particular) has a lot of
|
||||
useful information about writing CMake modules, including a large section
|
||||
devoted to find modules. This guide will only highlight things that are
|
||||
particular to the Extra CMake Modules project.
|
||||
|
||||
Most of these are stylistic points. For example, the license header for a module
|
||||
in ECM should look like:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
# SPDX-FileCopyrightText: 20XX Your Name <your.email@example.com>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
Documentation is written in reStructuredText format and put inside a bracket
|
||||
comment with a ``.rst:`` id after the opening bracket:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
The docs
|
||||
#]=======================================================================]
|
||||
|
||||
(docs/sphinx/ext/ecm.py has code to extract the rst text from a comment with
|
||||
such wrapping)
|
||||
|
||||
Functions should be used instead of macros unless there is a good reason not to
|
||||
(and that reason should be noted in a comment), and lowercase should be used for
|
||||
macros, functions and commands.
|
||||
|
||||
4 spaces is the generally-recommended indent, although there are several files
|
||||
that use 2 spaces; consistency within a file is more important than consistency
|
||||
across files.
|
||||
|
||||
If in doubt, look at how other modules in Extra CMake Modules are written, and
|
||||
follow the same pattern.
|
||||
|
||||
|
||||
Find Modules
|
||||
------------
|
||||
|
||||
A good template for find module documentation is:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindFoo
|
||||
-------
|
||||
|
||||
Finds the Foo library.
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``Foo_FOUND``
|
||||
True if (the requested version of) Foo is available
|
||||
``Foo_VERSION``
|
||||
The version of Foo, if it is found
|
||||
``Foo_LIBRARIES``
|
||||
This can be passed to target_link_libraries() instead of the ``Foo::Foo``
|
||||
target
|
||||
``Foo_INCLUDE_DIRS``
|
||||
This should be passed to target_include_directories() if the target is not
|
||||
used for linking
|
||||
``Foo_DEFINITIONS``
|
||||
This should be passed to target_compile_options() if the target is not
|
||||
used for linking
|
||||
|
||||
If ``Foo_FOUND`` is TRUE, it will also define the following imported target:
|
||||
|
||||
``Foo::Foo``
|
||||
The Foo 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.
|
||||
#]=======================================================================]
|
||||
|
||||
Note the use of definition lists for the variables.
|
||||
|
||||
Because of the :module:`ECMUseFindModules` module, projects may easily make
|
||||
local copies of find modules, and may install those copies with their own CMake
|
||||
project config files. For this reason, find modules should include the full BSD
|
||||
3-clause license::
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 20XX Your Name <your.email@example.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
Find modules should always provide imported targets in addition to the
|
||||
traditional variables (like ``Foo_LIBRARIES``, etc).
|
||||
|
||||
Unlike find modules shipped with CMake, if the module requires a specific CMake
|
||||
version it is not enough to warn when the minimum required version is not high
|
||||
enough: you should also produce an error when the actual CMake version being
|
||||
used is not high enough. This can be done with:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.16.0)
|
||||
message(FATAL_ERROR "CMake 3.16.0 is required by FindFoo.cmake")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.16.0)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 3.16.0 to use FindFoo.cmake")
|
||||
endif()
|
||||
|
||||
The :module:`ECMFindModuleHelpers` module has several useful functions and
|
||||
macros. For example, it allows you to replace the above version check with:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
ecm_find_package_version_check(Foo)
|
||||
|
||||
Components
|
||||
~~~~~~~~~~
|
||||
|
||||
Using :module:`ECMFindModuleHelpers`, creating a find module for a library with
|
||||
several inter-dependent components is reasonably straightforward. After the
|
||||
documentation, you need to include the module and do the usual version check:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
include(ECMFindModuleHelpers)
|
||||
ecm_find_package_version_check(Foo)
|
||||
|
||||
The important macros are ``ecm_find_package_parse_components`` and
|
||||
``ecm_find_package_handle_library_components``. These take a list of
|
||||
components, and query other variables you provide to find out the information
|
||||
they require. The documentation for :module:`ECMFindModuleHelpers` provides
|
||||
more information, but a simple setup might look like:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
set(Foo_known_components Bar Baz)
|
||||
set(Foo_Bar_pkg_config "foo-bar")
|
||||
set(Foo_Bar_lib "bar")
|
||||
set(Foo_Bar_header "foo/bar.h")
|
||||
set(Foo_Bar_pkg_config "foo-baz")
|
||||
set(Foo_Baz_lib "baz")
|
||||
set(Foo_Baz_header "foo/baz.h")
|
||||
|
||||
If ``Baz`` depends on ``Bar``, for example, you can specify this with
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
set(Foo_Baz_component_deps "Bar")
|
||||
|
||||
Then call the macros:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
ecm_find_package_parse_components(Foo
|
||||
RESULT_VAR Foo_components
|
||||
KNOWN_COMPONENTS ${Foo_known_components}
|
||||
)
|
||||
ecm_find_package_handle_library_components(Foo
|
||||
COMPONENTS ${Foo_components}
|
||||
)
|
||||
|
||||
Of course, if your components need unusual handling, you may want to replace
|
||||
``ecm_find_package_handle_library_components`` with, for example, a ``foreach``
|
||||
loop over the components (the body of which should implement most of what a
|
||||
normal find module does, including setting ``Foo_<component>_FOUND``).
|
||||
|
||||
At this point, you should set ``Foo_VERSION`` using whatever information you
|
||||
have available (such as from parsing header files). Note that
|
||||
``ecm_find_package_handle_library_components`` will set it to the version
|
||||
reported by pkg-config of the first component found, but this depends on the
|
||||
presence of pkg-config files, and the version of a component may not be the same
|
||||
as the version of the whole package. After that, finish off with
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Foo
|
||||
FOUND_VAR
|
||||
Foo_FOUND
|
||||
REQUIRED_VARS
|
||||
Foo_LIBRARIES
|
||||
VERSION_VAR
|
||||
Foo_VERSION
|
||||
HANDLE_COMPONENTS
|
||||
)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(Foo PROPERTIES
|
||||
URL "https://www.foo.example.com/"
|
||||
DESCRIPTION "A library for doing useful things")
|
||||
|
||||
|
||||
Submitting Modules
|
||||
==================
|
||||
|
||||
Proposed new modules should be submitted using the `KDE Review Board instance`_,
|
||||
and be assigned to the ``buildsystem`` and ``extracmakemodules`` groups. You
|
||||
should be able to point to two separate projects that will make use of the
|
||||
module.
|
||||
|
||||
The mailing list can be found at
|
||||
https://mail.kde.org/mailman/listinfo/kde-buildsystem\ .
|
||||
|
||||
|
||||
.. _KDE Review Board instance: https://git.reviewboard.kde.org/
|
||||
.. _cmake-developer(7): https://www.cmake.org/cmake/help/git-master/manual/cmake-developer.7.html
|
||||
@@ -0,0 +1,64 @@
|
||||
.. ecm-manual-description: ECM Find Modules Reference
|
||||
|
||||
ecm-find-modules(7)
|
||||
*******************
|
||||
|
||||
.. only:: html or latex
|
||||
|
||||
.. contents::
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Find modules are used by the CMake ``find_package`` command to search for
|
||||
packages that do not provide their own CMake package config files. CMake
|
||||
provides an extensive set of find modules, and Extra CMake Modules (ECM) adds
|
||||
to that.
|
||||
|
||||
To use ECM's find modules, you need to tell CMake to find the ECM package, and
|
||||
then add either ``${ECM_MODULE_PATH}`` or ``${ECM_FIND_MODULE_DIR}`` to the
|
||||
``CMAKE_MODULE_PATH`` variable:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(ECM REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_FIND_MODULE_DIR})
|
||||
|
||||
Using ``${ECM_MODULE_PATH}`` will also make the modules intended for direct use
|
||||
by CMake scripts available (see :manual:`ecm-modules(7)` and
|
||||
:manual:`ecm-kde-modules(7)`).
|
||||
|
||||
You can also make local copies of find modules using the
|
||||
``ecm_use_find_modules`` function from :module:`ECMUseFindModules`, which is
|
||||
automatically included when ECM is found:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(ECM REQUIRED NO_MODULE)
|
||||
ecm_use_find_modules(
|
||||
DIR "${CMAKE_BINARY_DIR}/cmake"
|
||||
MODULES FindEGL.cmake
|
||||
)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/cmake")
|
||||
|
||||
This allows selective use of ECM's find modules, and the NO_OVERRIDE argument
|
||||
can be used to ensure that if CMake ships its own version of that find module,
|
||||
it will be used instead.
|
||||
|
||||
|
||||
All Find Modules
|
||||
================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
/find-module/*
|
||||
|
||||
.. only:: man
|
||||
|
||||
See Also
|
||||
========
|
||||
|
||||
:manual:`ecm(7)`, :manual:`ecm-modules(7)`, :manual:`ecm-kde-modules(7)`
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
.. ecm-manual-description: ECM KDE Modules Reference
|
||||
|
||||
ecm-kde-modules(7)
|
||||
******************
|
||||
|
||||
.. only:: html or latex
|
||||
|
||||
.. contents::
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Extra CMake Modules (ECM) provides several modules that provide default settings
|
||||
(like installation directories, compiler flags and other CMake options) aimed at
|
||||
software produced by the KDE modules; these are documented here. ECM also
|
||||
provides modules with more general functionality, documented in
|
||||
:manual:`ecm-modules(7)`, and ones that extend the functionality of the
|
||||
``find_package`` command, documented in :manual:`ecm-find-modules(7)`.
|
||||
|
||||
To use these modules, you need to tell CMake to find the ECM package, and
|
||||
then add either ``${ECM_MODULE_PATH}`` or ``${ECM_KDE_MODULE_DIR}`` to the
|
||||
``CMAKE_MODULE_PATH`` variable:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(ECM REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_DIR})
|
||||
|
||||
Using ``${ECM_MODULE_PATH}`` will also make the other types of modules
|
||||
available.
|
||||
|
||||
All KDE Modules
|
||||
===============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
/kde-module/*
|
||||
|
||||
.. only:: man
|
||||
|
||||
See Also
|
||||
========
|
||||
|
||||
:manual:`ecm(7)`, :manual:`ecm-modules(7)`, :manual:`ecm-find-modules(7)`
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
.. ecm-manual-description: ECM Modules Reference
|
||||
|
||||
ecm-modules(7)
|
||||
**************
|
||||
|
||||
.. only:: html or latex
|
||||
|
||||
.. contents::
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Extra CMake Modules (ECM) provides various modules that provide useful functions
|
||||
for CMake scripts. ECM actually provides three types of modules that can be
|
||||
used from CMake scripts: those that extend the functionality of the
|
||||
``find_package`` command are documented in :manual:`ecm-find-modules(7)`; those
|
||||
that provide standard settings for software produced by the KDE community are
|
||||
documented in :manual:`ecm-kde-modules(7)`. The rest provide macros and
|
||||
functions for general use by CMake scripts and are documented here.
|
||||
|
||||
To use these modules, you need to tell CMake to find the ECM package, and
|
||||
then add either ``${ECM_MODULE_PATH}`` or ``${ECM_MODULE_DIR}`` to the
|
||||
``CMAKE_MODULE_PATH`` variable:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(ECM REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_DIR})
|
||||
|
||||
Using ``${ECM_MODULE_PATH}`` will also make the find modules and KDE modules
|
||||
available.
|
||||
|
||||
Note that there are also toolchain modules, documented in
|
||||
:manual:`ecm-toolchains(7)`, but these are used by users building the software
|
||||
rather than developers writing CMake scripts.
|
||||
|
||||
|
||||
All Modules
|
||||
===========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
/module/*
|
||||
|
||||
.. only:: man
|
||||
|
||||
See Also
|
||||
========
|
||||
|
||||
:manual:`ecm(7)`, :manual:`ecm-find-modules(7)`, :manual:`ecm-kde-modules(7)`
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
.. ecm-manual-description: ECM Toolchains Reference
|
||||
|
||||
ecm-toolchains(7)
|
||||
*****************
|
||||
|
||||
.. only:: html or latex
|
||||
|
||||
.. contents::
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Extra CMake Modules (ECM) provides some toolchain modules. Unlike normal
|
||||
modules, these are not included directly in projects, but specified with
|
||||
the ``CMAKE_TOOLCHAIN_FILE`` cache variable on the commandline.
|
||||
|
||||
|
||||
All Modules
|
||||
===========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
/toolchain/*
|
||||
|
||||
.. only:: man
|
||||
|
||||
See Also
|
||||
========
|
||||
|
||||
:manual:`ecm(7)`
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
.. ecm-manual-description: Extra CMake Modules
|
||||
|
||||
ecm(7)
|
||||
******
|
||||
|
||||
.. only:: html or latex
|
||||
|
||||
.. contents::
|
||||
|
||||
.. include:: ../../README.rst
|
||||
:start-line: 2
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/CheckAtomic.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMAddAndroidApk.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMAddAppIcon.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMAddQch.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMAddQtDesignerPlugin.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMAddTests.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMCheckOutboundLicense.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMConfiguredInstall.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMCoverageOption.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMCreateQmFromPoFiles.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMDeprecationSettings.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMEnableSanitizers.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMFindModuleHelpers.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMFindQmlModule.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGenerateDBusServiceFile.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGenerateExportHeader.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGenerateHeaders.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGeneratePkgConfigFile.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGeneratePriFile.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGeneratePythonBindings.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMGenerateQmlTypes.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMInstallIcons.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMMarkAsTest.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMMarkNonGuiExecutable.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMOptionalAddSubdirectory.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMPackageConfigHelpers.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMPoQmTools.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMQmlModule.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMQtDeclareLoggingCategory.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMQueryQt.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMSetupQtPluginMacroNames.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMSetupVersion.cmake
|
||||
+1
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMSourceVersionControl.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMUninstallTarget.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMUseFindModules.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/ECMWinResolveSymlinks.cmake
|
||||
@@ -0,0 +1 @@
|
||||
.. ecm-module:: ../../modules/QtVersionOption.cmake
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user