diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 0f96ce5..28a816a 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,153 +1,153 @@ #============================================================================= # Copyright 2000-2013 Kitware, Inc. # Copyright 2014-2015 Alex Merry # # 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. #============================================================================= include(CMakeDependentOption) find_package(Sphinx 1.2 MODULE) set_package_properties( Sphinx PROPERTIES URL "http://sphinx-doc.org/" DESCRIPTION "Tool to generate documentation." TYPE OPTIONAL PURPOSE "Required to build documentation for Extra CMake Modules." ) find_package(QCollectionGenerator MODULE) set_package_properties( QCollectionGenerator PROPERTIES - URL "http://www.qt.io/" + 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.") cmake_dependent_option( BUILD_QTHELP_DOCS "Build Qt help with Sphinx" OFF "Sphinx_FOUND;QCollectionGenerator_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 QCollectionGenerator::Generator ${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 -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() diff --git a/docs/manual/ecm-developer.7.rst b/docs/manual/ecm-developer.7.rst index 8eea58c..8054306 100644 --- a/docs/manual/ecm-developer.7.rst +++ b/docs/manual/ecm-developer.7.rst @@ -1,244 +1,244 @@ .. 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:: #============================================================================= # Copyright 20XX Your Name # # 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. 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:: #.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 # # 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 2.8.12) message(FATAL_ERROR "CMake 2.8.12 is required by FindFoo.cmake") endif() if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 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__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 "http://www.foo.example.com/" + 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): http://www.cmake.org/cmake/help/git-master/manual/cmake-developer.7.html +.. _cmake-developer(7): https://www.cmake.org/cmake/help/git-master/manual/cmake-developer.7.html diff --git a/find-modules/FindGperf.cmake b/find-modules/FindGperf.cmake index 3defb27..051ee7a 100644 --- a/find-modules/FindGperf.cmake +++ b/find-modules/FindGperf.cmake @@ -1,127 +1,127 @@ #.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. # # 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( # [GENERATION_FLAGS ]) # # Run ``gperf`` on ```` to generate ````, adding it to # the ```` variable which contains the source for the target # where ```` is going to be built. 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. #============================================================================= # Copyright 2016-2017 Pino Toscano # # 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. #============================================================================= include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) ecm_find_package_version_check(Gperf) # Find gperf find_program(Gperf_EXECUTABLE NAMES gperf) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Gperf FOUND_VAR Gperf_FOUND REQUIRED_VARS Gperf_EXECUTABLE ) 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 "http://www.gnu.org/software/gperf/" + URL "https://www.gnu.org/software/gperf/" DESCRIPTION "Perfect hash function generator" ) include(CMakeParseArguments) function(ecm_gperf_generate input_file output_file out_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() 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 ) list(APPEND ${out_var} "${output_file}") set(${out_var} ${${out_var}} PARENT_SCOPE) endfunction() diff --git a/find-modules/FindIcoTool.cmake b/find-modules/FindIcoTool.cmake index 90d0442..a934d4c 100644 --- a/find-modules/FindIcoTool.cmake +++ b/find-modules/FindIcoTool.cmake @@ -1,80 +1,80 @@ #.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. #============================================================================= # Copyright 2017 Vincent Pinon # Copyright 2014 Alex Merry # # 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. #============================================================================= 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 "http://www.nongnu.org/icoutils/" + URL "https://www.nongnu.org/icoutils/" DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file" ) diff --git a/find-modules/FindPng2Ico.cmake b/find-modules/FindPng2Ico.cmake index d84f667..01ad8c4 100644 --- a/find-modules/FindPng2Ico.cmake +++ b/find-modules/FindPng2Ico.cmake @@ -1,117 +1,117 @@ #.rst: # FindPng2Ico # ----------- # # Try to find png2ico. # # If the png2ico executable is not in your PATH, you can provide # an alternative name or full path location with the ``Png2Ico_EXECUTABLE`` # variable. # # This will define the following variables: # # ``Png2Ico_FOUND`` # True if png2ico is available. # # ``Png2Ico_EXECUTABLE`` # The png2ico executable. # # If ``Png2Ico_FOUND`` is TRUE, it will also define the following imported # target: # # ``Png2Ico::Png2Ico`` # The png2ico executable. # # and the following variables: # # ``Png2Ico_HAS_COLORS_ARGUMENT`` # Whether png2ico accepts a ``--colors`` argument. `Matthias Benkmann's -# tool `_ does, while the +# tool `_ does, while the # version of png2ico from the `"KDE On Windows" (kdewin) -# `_ project does not. +# `_ project does not. # # ``Png2Ico_HAS_RCFILE_ARGUMENT`` # Whether png2ico accepts an ``--rcfile`` argument. The version of png2ico # from the `"KDE On Windows" (kdewin) -# `_ project does, +# `_ project does, # while `Matthias Benkmann's tool -# `_ does not. +# `_ does not. # # Since 1.7.0. #============================================================================= # Copyright 2014 Alex Merry # # 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. #============================================================================= include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) ecm_find_package_version_check(Png2Ico) # Find png2ico find_program(Png2Ico_EXECUTABLE NAMES png2ico) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Png2Ico FOUND_VAR Png2Ico_FOUND REQUIRED_VARS Png2Ico_EXECUTABLE ) mark_as_advanced(Png2Ico_EXECUTABLE) if (Png2Ico_FOUND) execute_process( COMMAND "${Png2Ico_EXECUTABLE}" --help OUTPUT_VARIABLE _png2ico_help_text ERROR_VARIABLE _png2ico_help_text ) if (_png2ico_help_text MATCHES ".*--rcfile .*") set(Png2Ico_HAS_RCFILE_ARGUMENT TRUE) else() set(Png2Ico_HAS_RCFILE_ARGUMENT FALSE) endif() if (_png2ico_help_text MATCHES ".*--colors .*") set(Png2Ico_HAS_COLORS_ARGUMENT TRUE) else() set(Png2Ico_HAS_COLORS_ARGUMENT FALSE) endif() unset(_png2ico_help_text) if (NOT TARGET Png2Ico::Png2Ico) add_executable(Png2Ico::Png2Ico IMPORTED) set_target_properties(Png2Ico::Png2Ico PROPERTIES IMPORTED_LOCATION "${Png2Ico_EXECUTABLE}" ) endif() endif() include(FeatureSummary) set_package_properties(Png2Ico PROPERTIES - URL "http://www.winterdrache.de/freeware/png2ico/ or https://projects.kde.org/projects/kdesupport/kdewin" + URL "https://www.winterdrache.de/freeware/png2ico/ or https://commits.kde.org/kdewin" DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file" ) diff --git a/find-modules/FindPoppler.cmake b/find-modules/FindPoppler.cmake index 57bfa07..4cbe1d2 100644 --- a/find-modules/FindPoppler.cmake +++ b/find-modules/FindPoppler.cmake @@ -1,151 +1,151 @@ #.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__FOUND`` will be set to # TRUE if the corresponding Poppler library was found, and FALSE otherwise. If # ``Poppler__FOUND`` is TRUE, the imported target # ``Poppler::`` 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 #============================================================================= # Copyright 2015 Alex Richardson # # 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. #============================================================================= include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) ecm_find_package_version_check(Poppler) set(Poppler_known_components Cpp Qt4 Qt5 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" "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_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 "http://poppler.freedesktop.org" + URL "https://poppler.freedesktop.org/" ) diff --git a/find-modules/FindQtWaylandScanner.cmake b/find-modules/FindQtWaylandScanner.cmake index 37ebbdb..0854d0f 100644 --- a/find-modules/FindQtWaylandScanner.cmake +++ b/find-modules/FindQtWaylandScanner.cmake @@ -1,192 +1,192 @@ #.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( # PROTOCOL # BASENAME # [PREFIX ]) # # Generate C++ wrapper to Wayland client protocol files from ```` # XML definition for the ```` interface and append those files # to ````. Pass the ```` argument if the interface # names don't start with ``qt_`` or ``wl_``. # # WaylandScanner is required and will be searched for. # # :: # # ecm_add_qtwayland_server_protocol( # PROTOCOL # BASENAME # [PREFIX ]) # # Generate C++ wrapper to Wayland server protocol files from ```` # XML definition for the ```` interface and append those files # to ````. Pass the ```` argument if the interface # names don't start with ``qt_`` or ``wl_``. # # WaylandScanner is required and will be searched for. # # Since 1.4.0. #============================================================================= # Copyright 2012-2014 Pier Luigi Fiorini # # 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. #============================================================================= include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) include("${ECM_MODULE_DIR}/ECMQueryQmake.cmake") ecm_find_package_version_check(QtWaylandScanner) query_qmake(qt_binaries_dir QT_INSTALL_BINS) # Find qtwaylandscanner find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner HINTS ${qt_binaries_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 "http://qt.io" + URL "https://qt.io/" DESCRIPTION "Executable that converts XML protocol files to C++ code" ) include(CMakeParseArguments) function(ecm_add_qtwayland_client_protocol out_var) # Parse arguments set(oneValueArgs PROTOCOL BASENAME PREFIX) cmake_parse_arguments(ARGS "" "${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}") find_package(WaylandScanner REQUIRED QUIET) ecm_add_wayland_client_protocol(${out_var} PROTOCOL ${ARGS_PROTOCOL} BASENAME ${ARGS_BASENAME}) get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) set(_cheader "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h") 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) list(APPEND ${out_var} "${_code}") set(${out_var} ${${out_var}} PARENT_SCOPE) endfunction() function(ecm_add_qtwayland_server_protocol out_var) # Parse arguments set(oneValueArgs PROTOCOL BASENAME PREFIX) cmake_parse_arguments(ARGS "" "${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}") find_package(WaylandScanner REQUIRED QUIET) ecm_add_wayland_server_protocol(${out_var} PROTOCOL ${ARGS_PROTOCOL} BASENAME ${ARGS_BASENAME}) 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) list(APPEND ${out_var} "${_code}") set(${out_var} ${${out_var}} PARENT_SCOPE) endfunction() diff --git a/find-modules/FindSharedMimeInfo.cmake b/find-modules/FindSharedMimeInfo.cmake index a850d43..06a3b2c 100644 --- a/find-modules/FindSharedMimeInfo.cmake +++ b/find-modules/FindSharedMimeInfo.cmake @@ -1,114 +1,114 @@ #.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() # # 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. #============================================================================= # Copyright 2013-2014 Alex Merry # Copyright 2007 Pino Toscano # # 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. #============================================================================= 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}\" \"${_xdgmimeDir}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}\") endif (NOT DESTDIR_VALUE) ") endfunction() include(FeatureSummary) set_package_properties(SharedMimeInfo PROPERTIES - URL http://freedesktop.org/wiki/Software/shared-mime-info/ + URL https://freedesktop.org/wiki/Software/shared-mime-info/ DESCRIPTION "A database of common MIME types") diff --git a/find-modules/FindWayland.cmake b/find-modules/FindWayland.cmake index 233cc88..3c0059a 100644 --- a/find-modules/FindWayland.cmake +++ b/find-modules/FindWayland.cmake @@ -1,143 +1,143 @@ #.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 # # For each searched-for components, ``Wayland__FOUND`` will be set to # TRUE if the corresponding Wayland library was found, and FALSE otherwise. If # ``Wayland__FOUND`` is TRUE, the imported target # ``Wayland::`` 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. #============================================================================= # Copyright 2014 Alex Merry # Copyright 2014 Martin Gräßlin # # 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. #============================================================================= 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 ) include(FeatureSummary) set_package_properties(Wayland PROPERTIES - URL "http://wayland.freedesktop.org" + URL "https://wayland.freedesktop.org/" DESCRIPTION "C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients" ) diff --git a/find-modules/FindWaylandScanner.cmake b/find-modules/FindWaylandScanner.cmake index 287e50a..361915f 100644 --- a/find-modules/FindWaylandScanner.cmake +++ b/find-modules/FindWaylandScanner.cmake @@ -1,167 +1,167 @@ #.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( # PROTOCOL # BASENAME ) # # Generate Wayland client protocol files from ```` XML # definition for the ```` interface and append those files # to ````. # # :: # # ecm_add_wayland_server_protocol( # PROTOCOL # BASENAME ) # # Generate Wayland server protocol files from ```` XML # definition for the ```` interface and append those files # to ````. # # Since 1.4.0. #============================================================================= # Copyright 2012-2014 Pier Luigi Fiorini # # 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. #============================================================================= 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 "http://wayland.freedesktop.org" + URL "https://wayland.freedesktop.org/" DESCRIPTION "Executable that converts XML protocol files to C code" ) include(CMakeParseArguments) function(ecm_add_wayland_client_protocol out_var) # Parse arguments set(oneValueArgs PROTOCOL BASENAME) cmake_parse_arguments(ARGS "" "${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") set_source_files_properties(${_client_header} GENERATED) set_source_files_properties(${_code} GENERATED) set_property(SOURCE ${_client_header} 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 < ${_infile} > ${_code} DEPENDS ${_infile} ${_client_header} VERBATIM) list(APPEND ${out_var} "${_client_header}" "${_code}") set(${out_var} ${${out_var}} PARENT_SCOPE) endfunction() function(ecm_add_wayland_server_protocol out_var) # Parse arguments set(oneValueArgs PROTOCOL BASENAME) cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) if(ARGS_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") endif() ecm_add_wayland_client_protocol(${out_var} PROTOCOL ${ARGS_PROTOCOL} BASENAME ${ARGS_BASENAME}) get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h") set_property(SOURCE ${_server_header} 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) list(APPEND ${out_var} "${_server_header}") set(${out_var} ${${out_var}} PARENT_SCOPE) endfunction() diff --git a/find-modules/FindX11_XCB.cmake b/find-modules/FindX11_XCB.cmake index dd55fd7..a5aae2c 100644 --- a/find-modules/FindX11_XCB.cmake +++ b/find-modules/FindX11_XCB.cmake @@ -1,118 +1,118 @@ #.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. #============================================================================= # Copyright 2014 Alex Merry # Copyright 2011 Fredrik Höglund # Copyright 2008 Helio Chissini de Castro # Copyright 2007 Matthias Kretz # # 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. #============================================================================= 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) 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 "http://xorg.freedesktop.org/" + URL "https://xorg.freedesktop.org/" DESCRIPTION "A compatibility library for code that translates Xlib API calls into XCB calls" ) diff --git a/find-modules/FindXCB.cmake b/find-modules/FindXCB.cmake index d530d2d..c545b39 100644 --- a/find-modules/FindXCB.cmake +++ b/find-modules/FindXCB.cmake @@ -1,201 +1,201 @@ #.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 # XEVIE XF86DRI XFIXES XINERAMA XINPUT # XKB XPRINT XTEST XV XVMC # # If no components are specified, this module will act as though all components # except XINPUT (which is considered unstable) were passed to # OPTIONAL_COMPONENTS. # # 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__FOUND`` will be set to # true if the corresponding xcb library was found, and false otherwise. If # ``XCB__FOUND`` is true, the imported target ``XCB::`` # 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. #============================================================================= # Copyright 2011 Fredrik Höglund # Copyright 2013 Martin Gräßlin # Copyright 2014-2015 Alex Merry # # 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. #============================================================================= 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 XEVIE XF86DRI XINERAMA XINPUT XKB XPRINT XTEST XV XVMC ) # XINPUT is unstable; do not include it by default set(XCB_default_components ${XCB_known_components}) list(REMOVE_ITEM XCB_default_components "XINPUT") # 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} ) list(FIND XCB_components "XINPUT" _XCB_XINPUT_index) if (NOT _XCB_XINPUT_index EQUAL -1) message(AUTHOR_WARNING "XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to unavailable on many systems!") endif() 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 "http://xcb.freedesktop.org" + URL "https://xcb.freedesktop.org/" DESCRIPTION "X protocol C-language Binding" ) diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake index 52b2eb2..275fd65 100644 --- a/kde-modules/KDEInstallDirs.cmake +++ b/kde-modules/KDEInstallDirs.cmake @@ -1,714 +1,714 @@ #.rst: # KDEInstallDirs # -------------- # # Define KDE standard installation directories. # # Note that none of the variables defined by this module provide any # information about the location of already-installed KDE software. # # Inclusion of this module defines the following variables: # # ``KDE_INSTALL_`` # destination for files of a given type # ``KDE_INSTALL_FULL_`` # corresponding absolute path # # where ```` is one of (default values in parentheses and alternative, # deprecated variable name in square brackets): # # ``BUNDLEDIR`` # application bundles (``/Applications/KDE``) [``BUNDLE_INSTALL_DIR``] # ``EXECROOTDIR`` # executables and libraries (````) [``EXEC_INSTALL_PREFIX``] # ``BINDIR`` # user executables (``EXECROOTDIR/bin``) [``BIN_INSTALL_DIR``] # ``SBINDIR`` # system admin executables (``EXECROOTDIR/sbin``) [``SBIN_INSTALL_DIR``] # ``LIBDIR`` # object code libraries (``EXECROOTDIR/lib``, ``EXECROOTDIR/lib64`` or # ``EXECROOTDIR/lib/`` variables (or their ``CMAKE_INSTALL_`` or # deprecated counterparts) may be passed to the DESTINATION options of # ``install()`` commands for the corresponding file type. They are set in the # CMake cache, and so the defaults above can be overridden by users. # # Note that the ``KDE_INSTALL_``, ``CMAKE_INSTALL_`` or deprecated # form of the variable can be changed using CMake command line variable # definitions; in either case, all forms of the variable will be affected. The # effect of passing multiple forms of the same variable on the command line # (such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR`` is undefined. # # The variable ``KDE_INSTALL_TARGETS_DEFAULT_ARGS`` is also defined (along with # the deprecated form ``INSTALL_TARGETS_DEFAULT_ARGS``). This should be used # when libraries or user-executable applications are installed, in the # following manner: # # .. code-block:: cmake # # install(TARGETS mylib myapp ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) # # It MUST NOT be used for installing plugins, system admin executables or # executables only intended for use internally by other code. Those should use # ``KDE_INSTALL_PLUGINDIR``, ``KDE_INSTALL_SBINDIR`` or # ``KDE_INSTALL_LIBEXECDIR`` respectively. # # Additionally, ``CMAKE_INSTALL_DEFAULT_COMPONENT_NAME`` will be set to # ``${PROJECT_NAME}`` to provide a sensible default for this CMake option. # # Note that mixing absolute and relative paths, particularly for ``BINDIR``, # ``LIBDIR`` and ``INCLUDEDIR``, can cause issues with exported targets. Given # that the default values for these are relative paths, relative paths should # be used on the command line when possible (eg: use # ``-DKDE_INSTALL_LIBDIR=lib64`` instead of # ``-DKDE_INSTALL_LIBDIR=/usr/lib/lib64`` to override the library directory). # # Since pre-1.0.0. # # NB: The variables starting ``KDE_INSTALL_`` are available since 1.6.0, # unless otherwise noted with the variable. # # The ``KDE_INSTALL_PREFIX_SCRIPT`` option will install a ${CMAKE_INSTALL_PREFIX}/prefix.sh # file that allows to easily incorporate the necessary environment variables # for the prefix into a process. # #============================================================================= # Copyright 2014-2015 Alex Merry # Copyright 2013 Stephen Kelly # Copyright 2012 David Faure # Copyright 2007 Matthias Kretz # Copyright 2006-2007 Laurent Montel # Copyright 2006-2013 Alex Neundorf # # 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. # Figure out what the default install directory for libraries should be. # This is based on the logic in GNUInstallDirs, but simplified (the # GNUInstallDirs code deals with re-configuring, but that is dealt with # by the _define_* macros in this module). set(_LIBDIR_DEFAULT "lib") # Override this default 'lib' with 'lib64' iff: # - we are on a Linux, kFreeBSD or Hurd system but NOT cross-compiling # - we are NOT on debian # - we are NOT on flatpak # - we are on a 64 bits system # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" -# See http://wiki.debian.org/Multiarch +# See https://wiki.debian.org/Multiarch if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU") AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{FLATPAK_ID}) if (EXISTS "/etc/debian_version") # is this a debian system ? if(CMAKE_LIBRARY_ARCHITECTURE) set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") endif() else() # not debian, rely on CMAKE_SIZEOF_VOID_P: if(NOT DEFINED CMAKE_SIZEOF_VOID_P) message(AUTHOR_WARNING "Unable to determine default LIB_INSTALL_LIBDIR directory because no target architecture is known. " "Please enable at least one language before including KDEInstallDirs.") else() if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") set(_LIBDIR_DEFAULT "lib64") endif() endif() endif() endif() set(_gnu_install_dirs_vars BINDIR SBINDIR LIBEXECDIR SYSCONFDIR SHAREDSTATEDIR LOCALSTATEDIR LIBDIR INCLUDEDIR OLDINCLUDEDIR DATAROOTDIR DATADIR INFODIR LOCALEDIR MANDIR DOCDIR) # Macro for variables that are relative to another variable. We store an empty # value in the cache (for documentation/GUI cache editor purposes), and store # the default value in a local variable. If the cache variable is ever set to # something non-empty, the local variable will no longer be set. However, if # the cache variable remains (or is set to be) empty, the value will be # relative to that of the parent variable. # # varname: the variable name suffix (eg: BINDIR for KDE_INSTALL_BINDIR) # parent: the variable suffix of the variable this is relative to # (eg: DATAROOTDIR for KDE_INSTALL_DATAROOTDIR) # subdir: the path of the default value of KDE_INSTALL_${varname} # relative to KDE_INSTALL_${parent}: no leading / # docstring: documentation about the variable (not including the default value) # oldstylename (optional): the old-style name of the variable macro(_define_relative varname parent subdir docstring) set(_oldstylename) if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED AND ${ARGC} GREATER 4) set(_oldstylename "${ARGV4}") endif() set(_cmakename) if(NOT KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES) list(FIND _gnu_install_dirs_vars "${varname}" _list_offset) set(_cmakename_is_deprecated FALSE) if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED OR NOT _list_offset EQUAL -1) set(_cmakename CMAKE_INSTALL_${varname}) if(_list_offset EQUAL -1) set(_cmakename_is_deprecated TRUE) endif() endif() endif() # Surprisingly complex logic to deal with joining paths. # Note that we cannot use arg vars directly in if() because macro args are # not proper variables. set(_parent "${parent}") set(_subdir "${subdir}") if(_parent AND _subdir) set(_docpath "${_parent}/${_subdir}") if(KDE_INSTALL_${_parent}) set(_realpath "${KDE_INSTALL_${_parent}}/${_subdir}") else() set(_realpath "${_subdir}") endif() elseif(_parent) set(_docpath "${_parent}") set(_realpath "${KDE_INSTALL_${_parent}}") else() set(_docpath "${_subdir}") set(_realpath "${_subdir}") endif() if(KDE_INSTALL_${varname}) # make sure the cache documentation is set correctly get_property(_iscached CACHE KDE_INSTALL_${varname} PROPERTY VALUE SET) if (_iscached) # make sure the docs are still set if it was passed on the command line set_property(CACHE KDE_INSTALL_${varname} PROPERTY HELPSTRING "${docstring} (${_docpath})") # make sure the type is correct if it was passed on the command line set_property(CACHE KDE_INSTALL_${varname} PROPERTY TYPE PATH) endif() elseif(${_oldstylename}) if(NOT CMAKE_VERSION VERSION_LESS 3.0.0) message(DEPRECATION "${_oldstylename} is deprecated, use KDE_INSTALL_${varname} instead.") endif() # The old name was given (probably on the command line): move # it to the new name set(KDE_INSTALL_${varname} "${${_oldstylename}}" CACHE PATH "${docstring} (${_docpath})" FORCE) elseif(${_cmakename}) if(_cmakename_is_deprecated AND NOT CMAKE_VERSION VERSION_LESS 3.0.0) message(DEPRECATION "${_cmakename} is deprecated, use KDE_INSTALL_${varname} instead.") endif() # The CMAKE_ name was given (probably on the command line): move # it to the new name set(KDE_INSTALL_${varname} "${${_cmakename}}" CACHE PATH "${docstring} (${_docpath})" FORCE) else() # insert an empty value into the cache, indicating the default # should be used (including compatibility vars above) set(KDE_INSTALL_${varname} "" CACHE PATH "${docstring} (${_docpath})") set(KDE_INSTALL_${varname} "${_realpath}") endif() mark_as_advanced(KDE_INSTALL_${varname}) if(NOT IS_ABSOLUTE ${KDE_INSTALL_${varname}}) set(KDE_INSTALL_FULL_${varname} "${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_${varname}}") else() set(KDE_INSTALL_FULL_${varname} "${KDE_INSTALL_${varname}}") endif() # Override compatibility vars at runtime, even though we don't touch # them in the cache; this way, we keep the variables in sync where # KDEInstallDirs is included, but don't interfere with, say, # GNUInstallDirs in a parallel part of the CMake tree. if(_cmakename) set(${_cmakename} "${KDE_INSTALL_${varname}}") set(CMAKE_INSTALL_FULL_${varname} "${KDE_INSTALL_FULL_${varname}}") endif() if(_oldstylename) set(${_oldstylename} "${KDE_INSTALL_${varname}}") endif() endmacro() # varname: the variable name suffix (eg: BINDIR for KDE_INSTALL_BINDIR) # dir: the relative path of the default value of KDE_INSTALL_${varname} # relative to CMAKE_INSTALL_PREFIX: no leading / # docstring: documentation about the variable (not including the default value) # oldstylename (optional): the old-style name of the variable macro(_define_absolute varname dir docstring) _define_relative("${varname}" "" "${dir}" "${docstring}" ${ARGN}) endmacro() macro(_define_non_cache varname value) set(KDE_INSTALL_${varname} "${value}") if(NOT IS_ABSOLUTE ${KDE_INSTALL_${varname}}) set(KDE_INSTALL_FULL_${varname} "${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_${varname}}") else() set(KDE_INSTALL_FULL_${varname} "${KDE_INSTALL_${varname}}") endif() if(NOT KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES) list(FIND _gnu_install_dirs_vars "${varname}" _list_offset) if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED OR NOT _list_offset EQUAL -1) set(CMAKE_INSTALL_${varname} "${KDE_INSTALL_${varname}}") set(CMAKE_INSTALL_FULL_${varname} "${KDE_INSTALL_FULL_${varname}}") endif() endif() endmacro() if(APPLE) _define_absolute(BUNDLEDIR "/Applications/KDE" "application bundles" BUNDLE_INSTALL_DIR) endif() _define_absolute(EXECROOTDIR "" "executables and libraries" EXEC_INSTALL_PREFIX) _define_relative(BINDIR EXECROOTDIR "bin" "user executables" BIN_INSTALL_DIR) _define_relative(SBINDIR EXECROOTDIR "sbin" "system admin executables" SBIN_INSTALL_DIR) _define_relative(LIBDIR EXECROOTDIR "${_LIBDIR_DEFAULT}" "object code libraries" LIB_INSTALL_DIR) if(WIN32) _define_relative(LIBEXECDIR BINDIR "" "executables for internal use by programs and libraries" LIBEXEC_INSTALL_DIR) _define_non_cache(LIBEXECDIR_KF5 "${CMAKE_INSTALL_LIBEXECDIR}") else() _define_relative(LIBEXECDIR LIBDIR "libexec" "executables for internal use by programs and libraries" LIBEXEC_INSTALL_DIR) _define_non_cache(LIBEXECDIR_KF5 "${CMAKE_INSTALL_LIBEXECDIR}/kf5") endif() if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED) set(KF5_LIBEXEC_INSTALL_DIR "${CMAKE_INSTALL_LIBEXECDIR_KF5}") endif() _define_relative(CMAKEPACKAGEDIR LIBDIR "cmake" "CMake packages, including config files" CMAKECONFIG_INSTALL_PREFIX) include("${ECM_MODULE_DIR}/ECMQueryQmake.cmake") set(_default_KDE_INSTALL_USE_QT_SYS_PATHS OFF) if(NOT DEFINED KDE_INSTALL_USE_QT_SYS_PATHS) query_qmake(qt_install_prefix_dir QT_INSTALL_PREFIX TRY) if(qt_install_prefix_dir STREQUAL "${CMAKE_INSTALL_PREFIX}") message(STATUS "Installing in the same prefix as Qt, adopting their path scheme.") set(_default_KDE_INSTALL_USE_QT_SYS_PATHS ON) endif() endif() option (KDE_INSTALL_USE_QT_SYS_PATHS "Install mkspecs files, QCH files for Qt-based libs, Plugins and Imports to the Qt 5 install dir" "${_default_KDE_INSTALL_USE_QT_SYS_PATHS}") if(KDE_INSTALL_USE_QT_SYS_PATHS) # Qt-specific vars query_qmake(qt_plugins_dir QT_INSTALL_PLUGINS) _define_absolute(QTPLUGINDIR ${qt_plugins_dir} "Qt plugins" QT_PLUGIN_INSTALL_DIR) query_qmake(qt_imports_dir QT_INSTALL_IMPORTS) _define_absolute(QTQUICKIMPORTSDIR ${qt_imports_dir} "QtQuick1 imports" IMPORTS_INSTALL_DIR) query_qmake(qt_qml_dir QT_INSTALL_QML) _define_absolute(QMLDIR ${qt_qml_dir} "QtQuick2 imports" QML_INSTALL_DIR) else() set(_pluginsDirParent LIBDIR) if (ANDROID) set(_pluginsDirParent) #androiddeployqt wants plugins right in the prefix endif() _define_relative(QTPLUGINDIR "${_pluginsDirParent}" "plugins" "Qt plugins" QT_PLUGIN_INSTALL_DIR) _define_relative(QTQUICKIMPORTSDIR QTPLUGINDIR "imports" "QtQuick1 imports" IMPORTS_INSTALL_DIR) _define_relative(QMLDIR LIBDIR "qml" "QtQuick2 imports" QML_INSTALL_DIR) endif() _define_relative(PLUGINDIR QTPLUGINDIR "" "Plugins" PLUGIN_INSTALL_DIR) _define_absolute(INCLUDEDIR "include" "C and C++ header files" INCLUDE_INSTALL_DIR) _define_non_cache(INCLUDEDIR_KF5 "${CMAKE_INSTALL_INCLUDEDIR}/KF5") if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED) set(KF5_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR_KF5}") endif() _define_absolute(LOCALSTATEDIR "var" "modifiable single-machine data") _define_absolute(SHAREDSTATEDIR "com" "modifiable architecture-independent data") if (WIN32) _define_relative(DATAROOTDIR BINDIR "data" "read-only architecture-independent data root" SHARE_INSTALL_PREFIX) else() _define_absolute(DATAROOTDIR "share" "read-only architecture-independent data root" SHARE_INSTALL_PREFIX) endif() _define_relative(DATADIR DATAROOTDIR "" "read-only architecture-independent data" DATA_INSTALL_DIR) _define_non_cache(DATADIR_KF5 "${CMAKE_INSTALL_DATADIR}/kf5") if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED) set(KF5_DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR_KF5}") endif() # Qt-specific data vars if(KDE_INSTALL_USE_QT_SYS_PATHS) query_qmake(qt_docs_dir QT_INSTALL_DOCS) _define_absolute(QTQCHDIR ${qt_docs_dir} "documentation bundles in QCH format for Qt-extending libraries") else() _define_relative(QTQCHDIR DATAROOTDIR "doc/qch" "documentation bundles in QCH format for Qt-extending libraries") endif() # KDE Framework-specific things _define_relative(DOCBUNDLEDIR DATAROOTDIR "doc/HTML" "documentation bundles generated using kdoctools" HTML_INSTALL_DIR) _define_relative(KCFGDIR DATAROOTDIR "config.kcfg" "kconfig description files" KCFG_INSTALL_DIR) _define_relative(KCONFUPDATEDIR DATAROOTDIR "kconf_update" "kconf_update scripts" KCONF_UPDATE_INSTALL_DIR) _define_relative(KSERVICES5DIR DATAROOTDIR "kservices5" "services for KDE Frameworks 5" SERVICES_INSTALL_DIR) _define_relative(KSERVICETYPES5DIR DATAROOTDIR "kservicetypes5" "service types for KDE Frameworks 5" SERVICETYPES_INSTALL_DIR) _define_relative(KNOTIFY5RCDIR DATAROOTDIR "knotifications5" "knotify description files" KNOTIFYRC_INSTALL_DIR) _define_relative(KXMLGUI5DIR DATAROOTDIR "kxmlgui5" "kxmlgui .rc files" KXMLGUI_INSTALL_DIR) _define_relative(KTEMPLATESDIR DATAROOTDIR "kdevappwizard/templates" "Kapptemplate and Kdevelop templates") # Cross-desktop or other system things _define_relative(ICONDIR DATAROOTDIR "icons" "icons" ICON_INSTALL_DIR) _define_relative(LOCALEDIR DATAROOTDIR "locale" "knotify description files" LOCALE_INSTALL_DIR) _define_relative(SOUNDDIR DATAROOTDIR "sounds" "sound files" SOUND_INSTALL_DIR) _define_relative(TEMPLATEDIR DATAROOTDIR "templates" "templates" TEMPLATES_INSTALL_DIR) _define_relative(WALLPAPERDIR DATAROOTDIR "wallpapers" "desktop wallpaper images" WALLPAPER_INSTALL_DIR) _define_relative(APPDIR DATAROOTDIR "applications" "application desktop files" XDG_APPS_INSTALL_DIR) _define_relative(DESKTOPDIR DATAROOTDIR "desktop-directories" "desktop directories" XDG_DIRECTORY_INSTALL_DIR) _define_relative(MIMEDIR DATAROOTDIR "mime/packages" "mime description files" XDG_MIME_INSTALL_DIR) _define_relative(METAINFODIR DATAROOTDIR "metainfo" "AppStream component metadata") _define_relative(QCHDIR DATAROOTDIR "doc/qch" "documentation bundles in QCH format") _define_relative(MANDIR DATAROOTDIR "man" "man documentation" MAN_INSTALL_DIR) _define_relative(INFODIR DATAROOTDIR "info" "info documentation") _define_relative(DBUSDIR DATAROOTDIR "dbus-1" "D-Bus") _define_relative(DBUSINTERFACEDIR DBUSDIR "interfaces" "D-Bus interfaces" DBUS_INTERFACES_INSTALL_DIR) _define_relative(DBUSSERVICEDIR DBUSDIR "services" "D-Bus session services" DBUS_SERVICES_INSTALL_DIR) _define_relative(DBUSSYSTEMSERVICEDIR DBUSDIR "system-services" "D-Bus system services" DBUS_SYSTEM_SERVICES_INSTALL_DIR) set(_default_sysconf_dir "etc") if (CMAKE_INSTALL_PREFIX STREQUAL "/usr") set(_default_sysconf_dir "/etc") endif() _define_absolute(SYSCONFDIR "${_default_sysconf_dir}" "read-only single-machine data" SYSCONF_INSTALL_DIR) _define_relative(CONFDIR SYSCONFDIR "xdg" "application configuration files" CONFIG_INSTALL_DIR) _define_relative(AUTOSTARTDIR CONFDIR "autostart" "autostart files" AUTOSTART_INSTALL_DIR) set(_mixed_core_path_styles FALSE) if (IS_ABSOLUTE "${KDE_INSTALL_BINDIR}") if (NOT IS_ABSOLUTE "${KDE_INSTALL_LIBDIR}" OR NOT IS_ABSOLUTE "${KDE_INSTALL_INCLUDEDIR}") set(_mixed_core_path_styles ) endif() else() if (IS_ABSOLUTE "${KDE_INSTALL_LIBDIR}" OR IS_ABSOLUTE "${KDE_INSTALL_INCLUDEDIR}") set(_mixed_core_path_styles TRUE) endif() endif() if (_mixed_core_path_styles) message(WARNING "KDE_INSTALL_BINDIR, KDE_INSTALL_LIBDIR and KDE_INSTALL_INCLUDEDIR should either all be absolute paths or all be relative paths.") endif() # For more documentation see above. # Later on it will be possible to extend this for installing OSX frameworks # The COMPONENT Devel argument has the effect that static libraries belong to the # "Devel" install component. If we use this also for all install() commands # for header files, it will be possible to install # -everything: make install OR cmake -P cmake_install.cmake # -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake # -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake # This can then also be used for packaging with cpack. # FIXME: why is INCLUDES (only) set for ARCHIVE targets? set(KDE_INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT Devel INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) set(KF5_INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT Devel INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR_KF5}" ) # on the Mac support an extra install directory for application bundles if(APPLE) set(KDE_INSTALL_TARGETS_DEFAULT_ARGS ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) set(KF5_INSTALL_TARGETS_DEFAULT_ARGS ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) endif() if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED) set(INSTALL_TARGETS_DEFAULT_ARGS ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) endif() # new in cmake 2.8.9: this is used for all installed files which do not have a component set # so set the default component name to the name of the project, if a project name has been set: if(NOT "${PROJECT_NAME}" STREQUAL "Project") set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "${PROJECT_NAME}") endif() ################################################################### # Prefix set up configure_file(${CMAKE_CURRENT_LIST_DIR}/prefix.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh @ONLY) option(KDE_INSTALL_PREFIX_SCRIPT "Installs ${CMAKE_INSTALL_PREFIX}/prefix.sh that sets up the necessary environment variables" OFF) if(KDE_INSTALL_PREFIX_SCRIPT) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh DESTINATION ${CMAKE_INSTALL_PREFIX} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ) endif() diff --git a/modules/ECMAddQch.cmake b/modules/ECMAddQch.cmake index 40b6026..60230ea 100644 --- a/modules/ECMAddQch.cmake +++ b/modules/ECMAddQch.cmake @@ -1,747 +1,747 @@ #.rst: # ECMAddQch # ------------------ # # This module provides the ``ecm_add_qch`` function for generating API # documentation files in the QCH format, and the ``ecm_install_qch_export`` # function for generating and installing exported CMake targets for such # generated QCH files to enable builds of other software with generation of # QCH files to create links into the given QCH files. # # :: # # ecm_add_qch( # NAME # VERSION # QCH_INSTALL_DESTINATION # TAGFILE_INSTALL_DESTINATION # [COMPONENT ] # [BASE_NAME ] # [SOURCE_DIRS [ [...]]] # [SOURCES [ [...]]] # |MD_MAINPAGE ] # [IMAGE_DIRS [ [...]]] # [EXAMPLE_DIRS [ [...]]] # [ORG_DOMAIN ] # [NAMESPACE ] # [LINK_QCHS [ [...]]] # [PREDEFINED_MACROS [ [...]]] # [BLANK_MACROS [ [...]]] # [CONFIG_TEMPLATE ] # [VERBOSE] # ) # # This macro adds a target called for the creation of an API # documentation manual in the QCH format from the given sources. # It currently uses doxygen, future versions might optionally also allow other # tools. # Next to the QCH file the target will generate a corresponding doxygen tag # file, which enables creating links from other documentation into the # generated QCH file. # # It is recommended to make the use of this macro optional, by depending # the call to ``ecm_add_qch`` on a CMake option being set, with a name like # ``BUILD_QCH`` and being TRUE by default. This will allow the developers to # saves resources on normal source development build cycles by setting this # option to FALSE. # # The macro will set the target properties DOXYGEN_TAGFILE, QHP_NAMESPACE, # QHP_NAMESPACE_VERSIONED, QHP_VIRTUALFOLDER and LINK_QCHS to the respective # values, to allow other code access to them, e.g. the macro # ``ecm_install_qch_export``. # To enable the use of the target as item for LINK_QCHS # in further ``ecm_add_qch`` calls in the current build, # additionally a target property DOXYGEN_TAGFILE_BUILD is set, with the path # of the created doxygen tag file in the build dir. # If existing, ``ecm_add_qch`` will use this property instead of # DOXYGEN_TAGFILE for access to the tags file. # # NAME specifies the name for the generated documentation. # # VERSION specifies the version of the library for which the documentation is # created. # # BASE_NAME specifies the base name for the generated files. # The default basename is ````. # # SOURCE_DIRS specifies the dirs (incl. subdirs) with the source files for # which the API documentation should be generated. Dirs can be relative to # the current source dir. Dependencies to the files in the dirs are not # tracked currently, other than with the SOURCES argument. So do not use for # sources generated during the build. # Needs to be used when SOURCES or CONFIG_TEMPLATE are not used. # # SOURCES specifies the source files for which the API documentation should be # generated. # Needs to be used when SOURCE_DIRS or CONFIG_TEMPLATE are not used. # # MD_MAINPAGE specifies a file in Markdown format that should be used as main # page. This page will overrule any ``\mainpage`` command in the included # sources. # # IMAGE_DIRS specifies the dirs which contain images that are included in the # documentation. Dirs can be relative to the current source dir. # # EXAMPLE_DIRS specifies the dirs which contain examples that are included in # the documentation. Dirs can be relative to the current source dir. # # QCH_INSTALL_DESTINATION specifies where the generated QCH file will be # installed. # # TAGFILE_INSTALL_DESTINATION specifies where the generated tag file will be # installed. # # COMPONENT specifies the installation component name with which the install # rules for the generated QCH file and tag file are associated. # # NAMESPACE can be used to set a custom namespace of the generated # QCH file. The namepspace is used as the unique id by QHelpEngine (cmp. -# http://doc.qt.io/qt-5/qthelpproject.html#namespace). +# https://doc.qt.io/qt-5/qthelpproject.html#namespace). # The default namespace is ``.``. # Needs to be used when ORG_DOMAIN is not used. # # ORG_DOMAIN can be used to define the organization domain prefix for the # default namespace of the generated QCH file. # Needs to be used when NAMESPACE is not used. # # LINK_QCHS specifies a list of other QCH targets which should be used for # creating references to API documentation of code in external libraries. # For each target in the list these target properties are expected to be # defined: DOXYGEN_TAGFILE, QHP_NAMESPACE and QHP_VIRTUALFOLDER. # If any of these is not existing, will be ignored. # Use the macro ``ecm_install_qch_export`` for exporting a target with these # properties with the CMake config of a library. # Any target can also be one created before in the same buildsystem by # another call of ``ecm_add_qch``. # # PREDEFINED_MACROS specifies a list of C/C++ macros which should be handled as # given by the API dox generation tool. # Examples are macros only defined in generated files, so whose # definition might be not available to the tool. # # BLANK_MACROS specifies a list of C/C++ macro names which should be ignored by # the API dox generation tool and handled as if they resolve to empty strings. # Examples are export macros only defined in generated files, so whose # definition might be not available to the tool. # # CONFIG_TEMPLATE specifies a custom cmake template file for the config file # that is created to control the execution of the API dox generation tool. # The following CMake variables need to be used: # ECM_QCH_DOXYGEN_QHELPGENERATOR_EXECUTABLE, # ECM_QCH_DOXYGEN_FILEPATH, ECM_QCH_DOXYGEN_TAGFILE. # The following CMake variables can be used: # ECM_QCH_DOXYGEN_PROJECTNAME, ECM_QCH_DOXYGEN_PROJECTVERSION, # ECM_QCH_DOXYGEN_VIRTUALFOLDER, ECM_QCH_DOXYGEN_FULLNAMESPACE, # ECM_QCH_DOXYGEN_TAGFILES, # ECM_QCH_DOXYGEN_WARN_LOGFILE, ECM_QCH_DOXYGEN_QUIET. # There is no guarantue that the other CMake variables currently used in the # default config file template will also be present with the same semantics # in future versions of this macro. # # VERBOSE tells the API dox generation tool to be more verbose about its # activity. # # Example usage: # # .. code-block:: cmake # # ecm_add_qch( # MyLib_QCH # NAME MyLib # VERSION "0.42.0" # ORG_DOMAIN org.myorg # SOURCE_DIRS # src # LINK_QCHS # Qt5Core_QCH # Qt5Xml_QCH # Qt5Gui_QCH # Qt5Widgets_QCH # BLANK_MACROS # MyLib_EXPORT # MyLib_DEPRECATED # TAGFILE_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/tags # QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/qch # COMPONENT Devel # ) # # Example usage (with two QCH files, second linking first): # # .. code-block:: cmake # # ecm_add_qch( # MyLib_QCH # NAME MyLib # VERSION ${MyLib_VERSION} # ORG_DOMAIN org.myorg # SOURCES ${MyLib_PUBLIC_HEADERS} # MD_MAINPAGE src/mylib/README.md # LINK_QCHS Qt5Core_QCH # TAGFILE_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/tags # QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/qch # COMPONENT Devel # ) # ecm_add_qch( # MyOtherLib_QCH # NAME MyOtherLib # VERSION ${MyOtherLib_VERSION} # ORG_DOMAIN org.myorg # SOURCES ${MyOtherLib_PUBLIC_HEADERS} # MD_MAINPAGE src/myotherlib/README.md # LINK_QCHS Qt5Core_QCH MyLib_QCH # TAGFILE_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/tags # QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/qch # COMPONENT Devel # ) # # :: # # ecm_install_qch_export( # TARGETS [ [ [...]]] # FILE # DESTINATION # [COMPONENT ] # ) # # This macro creates and installs a CMake file which exports the given # QCH targets etc., so they can be picked up by CMake-based builds of # other software that also generate QCH files (using ``ecm_add_qch``) and # which should include links to the QCH files created by the given targets. # The installed CMake file is expected to be included by the CMake # config file created for the software the related QCH files are documenting. # # TARGETS specifies the QCH targets which should be exported. If a target does # not exist or does not have all needed properties, a warning will be # generated and the target skipped. # This behaviour might change in future versions to result in a fail instead. # # FILE specifies the name of the created CMake file, typically with a .cmake # extension. # # DESTINATION specifies the directory on disk to which the file will be # installed. It usually is the same as the one where the CMake config files # for this software are installed. # # COMPONENT specifies the installation component name with which the # install rule is associated. # # Example usage: # # .. code-block:: cmake # # ecm_install_qch_export( # TARGETS MyLib_QCH # FILE MyLibQCHTargets.cmake # DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/MyLib" # COMPONENT Devel # ) # # Since 5.36.0. #============================================================================= # Copyright 2016-2017 Friedrich W. H. Kossebau # # 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. include(CMakeParseArguments) include(ECMQueryQmake) # Helper method: adding the LINK_QCHS property to a Qt QCH targets, from module base names ("Core" etc.) # if target does not exist (e.g. because no tagsfile was found), this is a no-op macro(_ecm_setup_qt_qch_links _module) set(_target "Qt5${_module}_QCH") if(TARGET ${_target}) set(_linkqchs) foreach(_linkqch ${ARGN}) list(APPEND _linkqchs "Qt5${_linkqch}_QCH") endforeach() set_property(TARGET ${_target} PROPERTY LINK_QCHS ${_linkqchs}) endif() endmacro() # Helper method: ensure Qt QCH targets are created function(_ecm_ensure_qt_qch_targets) # create QCH targets for Qt # Ideally one day Qt CMake Config files provide these if(NOT TARGET Qt5Core_QCH) # get Qt version, if any find_package(Qt5Core CONFIG QUIET) # lookup tag files query_qmake(qt_docs_dir QT_INSTALL_DOCS TRY) find_path(_qtcoreTagsPath qtcore/qtcore.tags PATHS ${qt_docs_dir} ) if(Qt5Core_FOUND AND _qtcoreTagsPath) string(REPLACE "." "" _version ${Qt5Core_VERSION}) # TODO: properly find each tag file # TODO: complete list of Qt modules # qtdbus.tags file missing since 5.0, QTBUG-60933, extra handling? foreach(_module 3D Bluetooth Concurrent Core DBus Gui Location Network Positioning PrintSupport Qml Quick Sensors SerialPort Sql Svg WebChannel WebEngine WebSockets Widgets Xml XmlPatterns ) string(TOLOWER ${_module} _lowermodule) set(_tagfile "${_qtcoreTagsPath}/qt${_lowermodule}/qt${_lowermodule}.tags") if(EXISTS "${_tagfile}") add_custom_target(Qt5${_module}_QCH) set_target_properties(Qt5${_module}_QCH PROPERTIES DOXYGEN_TAGFILE "${_tagfile}" QHP_NAMESPACE "org.qt-project.qt${_lowermodule}" QHP_NAMESPACE_VERSIONED "org.qt-project.qt${_lowermodule}.${_version}" QHP_VIRTUALFOLDER "qt${_lowermodule}" IMPORTED TRUE ) endif() endforeach() _ecm_setup_qt_qch_links(3D Gui Core) _ecm_setup_qt_qch_links(Bluetooth DBus Core) _ecm_setup_qt_qch_links(Concurrent Gui Core) _ecm_setup_qt_qch_links(DBus Core) _ecm_setup_qt_qch_links(Gui Core) _ecm_setup_qt_qch_links(Location Positioning Gui Core) _ecm_setup_qt_qch_links(Network Core) _ecm_setup_qt_qch_links(Positioning Core) _ecm_setup_qt_qch_links(PrintSupport Widgets Gui Core) _ecm_setup_qt_qch_links(Qml Network Core) _ecm_setup_qt_qch_links(Quick Qml Network Gui Core) _ecm_setup_qt_qch_links(Sensors Core) _ecm_setup_qt_qch_links(SerialPort Core) _ecm_setup_qt_qch_links(Sql Core) _ecm_setup_qt_qch_links(Svg Widgets Gui Core) _ecm_setup_qt_qch_links(WebChannel Qml Core) _ecm_setup_qt_qch_links(WebEngine Quick Qml Gui Core) _ecm_setup_qt_qch_links(WebSockets Network Core) _ecm_setup_qt_qch_links(Widgets Gui Core) _ecm_setup_qt_qch_links(Xml Core) _ecm_setup_qt_qch_links(XmlPatterns Network Core) endif() endif() endfunction() # Helper method: collect all qch targets from the LINK_QCHS dependency tree and set result to function(_ecm_collect_linkable_qch_targets name) set(_candidate_qchs ${ARGN}) set(_handled_qchs) set(_good_qchs) # while unhandled qch targets while(_candidate_qchs) # get another unhandled qch target list(GET _candidate_qchs 0 _qch) list(REMOVE_AT _candidate_qchs 0) list(FIND _handled_qchs ${_qch} _index) # if not already handled if(_index EQUAL -1) list(APPEND _handled_qchs ${_qch}) if(TARGET ${_qch}) # always look at other linked qch targets, also for incomplete targets get_property(_link_qchs TARGET ${_qch} PROPERTY LINK_QCHS) if(_link_qchs) list(APPEND _candidate_qchs ${_link_qchs}) endif() # check if this target has all needed properties set(_target_usable TRUE) foreach(_propertyname DOXYGEN_TAGFILE QHP_NAMESPACE QHP_VIRTUALFOLDER ) get_target_property(_property ${_qch} ${_propertyname}) if(NOT _property) message(STATUS "No property ${_propertyname} set on ${_qch} when calling ecm_add_qch(). <<${_property}>>") set(_target_usable FALSE) endif() endforeach() get_target_property(_tagfile_build ${_qch} DOXYGEN_TAGFILE_BUILD) if (NOT _tagfile_build) get_target_property(_tagfile ${_qch} DOXYGEN_TAGFILE) if(NOT EXISTS ${_tagfile}) message(STATUS "No such tag file \"${_tagfile}\" found for ${_qch} when calling ecm_add_qch().") set(_target_usable FALSE) endif() endif() if(_target_usable) list(APPEND _good_qchs ${_qch}) else() message(WARNING "No linking to API dox of ${_qch}.") endif() else() message(STATUS "No such target ${_qch} defined when calling ecm_add_qch(), ignored.") endif() endif() endwhile() set(${name} ${_good_qchs} PARENT_SCOPE) endfunction() function(ecm_add_qch target_name) # Parse arguments set(options VERBOSE) set(oneValueArgs NAME BASE_NAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION COMPONENT VERSION NAMESPACE MD_MAINPAGE ORG_DOMAIN CONFIG_TEMPLATE) set(multiValueArgs SOURCE_DIRS SOURCES IMAGE_DIRS EXAMPLE_DIRS PREDEFINED_MACROS BLANK_MACROS LINK_QCHS) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # check required args foreach(_arg_name NAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION VERSION) if(NOT DEFINED ARGS_${_arg_name}) message(FATAL_ERROR "${_arg_name} needs to be defined when calling ecm_add_qch") endif() endforeach() if(NOT DEFINED ARGS_SOURCE_DIRS AND NOT DEFINED ARGS_SOURCES AND NOT DEFINED ARGS_CONFIG_TEMPLATE) message(FATAL_ERROR "SOURCE_DIRS or SOURCES needs to be defined when calling ecm_add_qch") endif() if(DEFINED ARGS_SOURCE_DIRS AND DEFINED ARGS_SOURCES) message(FATAL_ERROR "Either SOURCE_DIRS or SOURCES, not both, needs to be defined when calling ecm_add_qch") endif() if(NOT DEFINED ARGS_ORG_DOMAIN AND NOT DEFINED ARGS_NAMESPACE) message(FATAL_ERROR "ORG_DOMAIN or NAMESPACE needs to be defined when calling ecm_add_qch") endif() # find required tools if (NOT DOXYGEN_PATCHED_JSFILESADDED) set(REQUIRED_DOXYGEN_VERSION 1.8.13) endif() find_package(Doxygen ${REQUIRED_DOXYGEN_VERSION} REQUIRED) if (NOT DOXYGEN_FOUND AND NOT DOXYGEN_PATCHED_JSFILESADDED) set(doxygen_description_addition " (Or older version patched with https://github.com/doxygen/doxygen/commit/bf9415698e53d79b, pass -DDOXYGEN_PATCHED_JSFILESADDED=ON to cmake if patched)") endif() set_package_properties(Doxygen PROPERTIES TYPE REQUIRED PURPOSE "Needed for API dox QCH file generation${doxygen_description_addition}" ) find_package(QHelpGenerator REQUIRED) set_package_properties(QHelpGenerator PROPERTIES TYPE REQUIRED PURPOSE "Needed for API dox QCH file generation" DESCRIPTION "Part of Qt5 tools" ) set(_missing_tools) if (NOT DOXYGEN_FOUND) list(APPEND _missing_tools "Doxygen") endif() if (NOT QHelpGenerator_FOUND) list(APPEND _missing_tools "qhelpgenerator") endif() if (_missing_tools) message(WARNING "API dox QCH file will not be generated, tools missing: ${_missing_tools}!") else() _ecm_ensure_qt_qch_targets() # prepare base dirs, working file names and other vars if (DEFINED ARGS_BASE_NAME) set(_basename ${ARGS_BASE_NAME}) else() set(_basename ${ARGS_NAME}) endif() set(_qch_file_basename "${_basename}.qch") set(_tags_file_basename "${_basename}.tags") set(_qch_buildpath "${CMAKE_CURRENT_BINARY_DIR}/${_qch_file_basename}") set(_tags_buildpath "${CMAKE_CURRENT_BINARY_DIR}/${_tags_file_basename}") set(_apidox_builddir "${CMAKE_CURRENT_BINARY_DIR}/${_basename}_ECMQchDoxygen") if (DEFINED ARGS_NAMESPACE) set(_namespace "${ARGS_NAMESPACE}") else() set(_namespace "${ARGS_ORG_DOMAIN}.${ARGS_NAME}") endif() string(REPLACE "." "_" _dotLessVersion ${ARGS_VERSION}) set(_versioned_namespace "${_namespace}.${_dotLessVersion}") set(_sources) set(_dep_tagfiles) set(_dep_qch_targets) ### Create doxygen config file set(_doxygenconfig_file "${CMAKE_CURRENT_BINARY_DIR}/${_basename}_ECMQchDoxygen.config") if (DEFINED ARGS_CONFIG_TEMPLATE) set(_doxygenconfig_template_file "${ARGS_CONFIG_TEMPLATE}") else() set(_doxygenconfig_template_file "${ECM_MODULE_DIR}/ECMQchDoxygen.config.in") endif() set(_doxygen_layout_file "${ECM_MODULE_DIR}/ECMQchDoxygenLayout.xml") # Setup variables used in config file template, ECM_QCH_DOXYGEN_* set(ECM_QCH_DOXYGEN_OUTPUTDIR "\"${_apidox_builddir}\"") set(ECM_QCH_DOXYGEN_TAGFILE "\"${_tags_buildpath}\"") set(ECM_QCH_DOXYGEN_LAYOUTFILE "\"${_doxygen_layout_file}\"") set(ECM_QCH_DOXYGEN_IMAGEDIRS) foreach(_image_DIR IN LISTS ARGS_IMAGE_DIRS) if (NOT IS_ABSOLUTE ${_image_DIR}) set(_image_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_image_DIR}") endif() # concat dirs separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_IMAGEDIRS "${ECM_QCH_DOXYGEN_IMAGEDIRS} \\\n\"${_image_DIR}\"") endforeach() set(ECM_QCH_DOXYGEN_EXAMPLEDIRS) foreach(_example_DIR IN LISTS ARGS_EXAMPLE_DIRS) if (NOT IS_ABSOLUTE ${_example_DIR}) set(_example_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_example_DIR}") endif() # concat dirs separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_EXAMPLEDIRS "${ECM_QCH_DOXYGEN_EXAMPLEDIRS} \\\n\"${_example_DIR}\"") endforeach() if (ARGS_MD_MAINPAGE) if (NOT IS_ABSOLUTE ${ARGS_MD_MAINPAGE}) set(ARGS_MD_MAINPAGE "${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_MD_MAINPAGE}") endif() set(ECM_QCH_DOXYGEN_MAINPAGE_MDFILE "\"${ARGS_MD_MAINPAGE}\"") else() set(ECM_QCH_DOXYGEN_MAINPAGE_MDFILE) endif() set(ECM_QCH_DOXYGEN_INPUT) if (ARGS_SOURCE_DIRS) foreach(_source_DIR IN LISTS ARGS_SOURCE_DIRS) if (NOT IS_ABSOLUTE ${_source_DIR}) set(_source_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_source_DIR}") endif() # concat dirs separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_INPUT "${ECM_QCH_DOXYGEN_INPUT} \\\n\"${_source_DIR}\"") endforeach() if (ARGS_MD_MAINPAGE) set(ECM_QCH_DOXYGEN_INPUT "${ECM_QCH_DOXYGEN_INPUT} \\\n\"${ARGS_MD_MAINPAGE}\"") endif() set(ECM_QCH_DOXYGEN_FILE_PATTERNS "*.h *.cpp *.hpp *.hh *.cc *.h++ *.c++ *.hxx *.cxx *.dox *.md") else() foreach(_source IN LISTS ARGS_SOURCES) if (NOT IS_ABSOLUTE ${_source}) set(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_source}") endif() list(APPEND _sources "${_source}") endforeach() if (ARGS_MD_MAINPAGE) list(FIND _sources ${ARGS_MD_MAINPAGE} _mainpage_index) if (_mainpage_index STREQUAL -1) list(APPEND _sources "${ARGS_MD_MAINPAGE}") endif() endif() foreach(_source IN LISTS _sources) # concat sources separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_INPUT "${ECM_QCH_DOXYGEN_INPUT} \\\n\"${_source}\"") endforeach() set(ECM_QCH_DOXYGEN_FILE_PATTERNS "") endif() set(ECM_QCH_DOXYGEN_PROJECTNAME ${ARGS_NAME}) file(RELATIVE_PATH _builddirrelative_filepath "${_apidox_builddir}/html" ${_qch_buildpath}) set(ECM_QCH_DOXYGEN_FILEPATH "\"${_builddirrelative_filepath}\"") set(ECM_QCH_DOXYGEN_PROJECTVERSION ${ARGS_VERSION}) string(TOLOWER ${ARGS_NAME} ECM_QCH_DOXYGEN_VIRTUALFOLDER) set(ECM_QCH_DOXYGEN_FULLNAMESPACE ${_versioned_namespace}) set(ECM_QCH_DOXYGEN_PREDEFINED_MACROS) foreach(_macro IN LISTS ARGS_PREDEFINED_MACROS) # concat dirs separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_PREDEFINED_MACROS "${ECM_QCH_DOXYGEN_PREDEFINED_MACROS} \\\n${_macro}") endforeach() set(ECM_QCH_DOXYGEN_BLANK_MACROS) foreach(_macro IN LISTS ARGS_BLANK_MACROS) # concat dirs separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_BLANK_MACROS "${ECM_QCH_DOXYGEN_BLANK_MACROS} \\\n${_macro}=\"\"") endforeach() # create list of tag files for linking other QCH files set(ECM_QCH_DOXYGEN_TAGFILES) _ecm_collect_linkable_qch_targets(_link_qchs ${ARGS_LINK_QCHS}) foreach(_link_qch IN LISTS _link_qchs) list(APPEND _dep_qch_targets ${_link_qch}) get_target_property(_link_qch_tagfile ${_link_qch} DOXYGEN_TAGFILE) get_target_property(_link_qch_tagfile_build ${_link_qch} DOXYGEN_TAGFILE_BUILD) get_target_property(_link_qch_namespace ${_link_qch} QHP_NAMESPACE) get_target_property(_link_qch_virtualfolder ${_link_qch} QHP_VIRTUALFOLDER) # if same build, then prefer build version over any installed one if (_link_qch_tagfile_build) set(_link_qch_tagfile ${_link_qch_tagfile_build}) list(APPEND _dep_tagfiles "${_link_qch_tagfile}") endif() get_property(_linkqchs TARGET ${_link_qch} PROPERTY LINK_QCHS) set(_tagfile_entry "\"${_link_qch_tagfile}=qthelp://${_link_qch_namespace}/${_link_qch_virtualfolder}/\"") # concat dirs separated by a break, it is no issue that first has also a leading break set(ECM_QCH_DOXYGEN_TAGFILES "${ECM_QCH_DOXYGEN_TAGFILES} \\\n${_tagfile_entry}") endforeach() set(ECM_QCH_DOXYGEN_WARN_LOGFILE "\"${_doxygenconfig_file}.log\"") if(ARGS_VERBOSE) set(ECM_QCH_DOXYGEN_QUIET "NO") else() set(ECM_QCH_DOXYGEN_QUIET "YES") endif() set(ECM_QCH_DOXYGEN_QHELPGENERATOR_EXECUTABLE ${QHelpGenerator_EXECUTABLE}) # finally create doxygen config file configure_file( "${_doxygenconfig_template_file}" "${_doxygenconfig_file}" @ONLY ) # setup make target set(_qch_INSTALLPATH ${ARGS_QCH_INSTALL_DESTINATION}) set(_tags_INSTALLPATH ${ARGS_TAGFILE_INSTALL_DESTINATION}) file(RELATIVE_PATH _relative_qch_file ${CMAKE_BINARY_DIR} ${_qch_buildpath}) file(RELATIVE_PATH _relative_tags_file ${CMAKE_BINARY_DIR} ${_tags_buildpath}) add_custom_command( OUTPUT ${_qch_buildpath} ${_tags_buildpath} COMMENT "Generating ${_relative_qch_file}, ${_relative_tags_file}" COMMAND cmake -E remove_directory "${ECM_QCH_DOXYGEN_OUTPUTDIR}" COMMAND cmake -E make_directory "${ECM_QCH_DOXYGEN_OUTPUTDIR}" COMMAND ${DOXYGEN_EXECUTABLE} "${_doxygenconfig_file}" DEPENDS ${_doxygenconfig_file} ${_doxygen_layout_file} ${_sources} ${_dep_tagfiles} ${_dep_qch_targets} ) add_custom_target(${target_name} ALL DEPENDS ${_qch_buildpath} ${_tags_buildpath}) set_target_properties(${target_name} PROPERTIES DOXYGEN_TAGFILE "${_qch_INSTALLPATH}/${_tags_file_basename}" DOXYGEN_TAGFILE_NAME "${_tags_file_basename}" DOXYGEN_TAGFILE_INSTALLDIR "${_qch_INSTALLPATH}" DOXYGEN_TAGFILE_BUILD "${_tags_buildpath}" QHP_NAMESPACE "${_namespace}" QHP_NAMESPACE_VERSIONED "${_versioned_namespace}" QHP_VIRTUALFOLDER "${ECM_QCH_DOXYGEN_VIRTUALFOLDER}" ) # list as value does not work with set_target_properties set_property(TARGET ${target_name} PROPERTY LINK_QCHS "${ARGS_LINK_QCHS}") if (DEFINED ARGS_COMPONENT) set(_component COMPONENT ${ARGS_COMPONENT}) else() set(_component) endif() # setup installation install(FILES ${_qch_buildpath} DESTINATION ${_qch_INSTALLPATH} ${_component} ) install(FILES ${_tags_buildpath} DESTINATION ${_tags_INSTALLPATH} ${_component} ) endif() endfunction() function(ecm_install_qch_export) set(options ) set(oneValueArgs FILE DESTINATION COMPONENT) set(multiValueArgs TARGETS) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT DEFINED ARGS_FILE) message(FATAL_ERROR "FILE needs to be defined when calling ecm_install_qch_export().") endif() if(NOT DEFINED ARGS_DESTINATION) message(FATAL_ERROR "DESTINATION needs to be defined when calling ecm_install_qch_export().") endif() # TARGETS may be empty (and ARGS_TARGETS will not be defined then by cmake_parse_arguments) set(_content "# This file was generated by ecm_install_qch_export(). DO NOT EDIT! " ) foreach(_target IN LISTS ARGS_TARGETS) set(_target_usable TRUE) if (NOT TARGET ${_target}) message(STATUS "No such target ${_target} when calling ecm_install_qch_export().") set(_target_usable FALSE) else() foreach(_propertyname DOXYGEN_TAGFILE_NAME DOXYGEN_TAGFILE_INSTALLDIR QHP_NAMESPACE QHP_NAMESPACE_VERSIONED QHP_VIRTUALFOLDER ) get_target_property(_property ${_target} ${_propertyname}) if(NOT _property) message(STATUS "No property ${_propertyname} set on ${_target} when calling ecm_install_qch_export(). <${_property}>") set(_target_usable FALSE) endif() endforeach() endif() if(_target_usable) get_target_property(_tagfile_name ${_target} DOXYGEN_TAGFILE_NAME) get_target_property(_tagfile_installdir ${_target} DOXYGEN_TAGFILE_INSTALLDIR) if (NOT IS_ABSOLUTE ${_tagfile_installdir}) set(_tagfile_installdir "${CMAKE_INSTALL_PREFIX}/${_tagfile_installdir}") endif() get_target_property(_namespace ${_target} QHP_NAMESPACE) get_target_property(_namespace_versioned ${_target} QHP_NAMESPACE_VERSIONED) get_target_property(_virtualfolder ${_target} QHP_VIRTUALFOLDER) get_property(_linkqchs TARGET ${_target} PROPERTY LINK_QCHS) set(_content "${_content} if (NOT TARGET ${_target}) add_custom_target(${_target}) set_target_properties(${_target} PROPERTIES DOXYGEN_TAGFILE \"${_tagfile_installdir}/${_tagfile_name}\" QHP_NAMESPACE \"${_namespace}\" QHP_NAMESPACE_VERSIONED \"${_namespace_versioned}\" QHP_VIRTUALFOLDER \"${_virtualfolder}\" IMPORTED TRUE ) set_property(TARGET ${_target} PROPERTY LINK_QCHS ${_linkqchs}) endif() " ) else() message(STATUS "No target exported for ${_target}.") endif() endforeach() if (NOT IS_ABSOLUTE ${ARGS_FILE}) set(ARGS_FILE "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_FILE}") endif() file(GENERATE OUTPUT "${ARGS_FILE}" CONTENT "${_content}" ) if (DEFINED ARGS_COMPONENT) set(_component COMPONENT ${ARGS_COMPONENT}) else() set(_component) endif() install( FILES "${ARGS_FILE}" DESTINATION "${ARGS_DESTINATION}" ${_component} ) endfunction() diff --git a/modules/ECMGeneratePkgConfigFile.cmake b/modules/ECMGeneratePkgConfigFile.cmake index 09d7e2b..91a2cba 100644 --- a/modules/ECMGeneratePkgConfigFile.cmake +++ b/modules/ECMGeneratePkgConfigFile.cmake @@ -1,199 +1,199 @@ #.rst: # ECMGeneratePkgConfigFile # ------------------------ # -# Generate a `pkg-config `_ +# Generate a `pkg-config `_ # file for the benefit of -# `autotools `_-based +# `autotools `_-based # projects. # # :: # # ecm_generate_pkgconfig_file(BASE_NAME # [LIB_NAME ] # [DEPS " [ [...]]"] # [FILENAME_VAR ] # [INCLUDE_INSTALL_DIR ] # [LIB_INSTALL_DIR ] # [DEFINES -D...] # [DESCRIPTION ] # [INSTALL]) # # ``BASE_NAME`` is the name of the module. It's the name projects will use to # find the module. # # ``LIB_NAME`` is the name of the library that is being exported. If undefined, # it will default to the ``BASE_NAME``. That means the ``LIB_NAME`` will be set # as the name field as well as the library to link to. # # ``FILENAME_VAR`` is specified with a variable name. This variable will # receive the location of the generated file will be set, within the build # directory. This way it can be used in case some processing is required. See # also ``INSTALL``. # # ``INCLUDE_INSTALL_DIR`` specifies where the includes will be installed. If # it's not specified, it will default to ``INSTALL_INCLUDEDIR``, # ``CMAKE_INSTALL_INCLUDEDIR`` or just "include/" in case they are specified, # with the BASE_NAME postfixed. # # ``LIB_INSTALL_DIR`` specifies where the library is being installed. If it's # not specified, it will default to ``LIB_INSTALL_DIR``, # ``CMAKE_INSTALL_LIBDIR`` or just "lib/" in case they are specified. # # ``DEFINES`` is a list of preprocessor defines that it is recommended users of # the library pass to the compiler when using it. # # ``DESCRIPTION`` describes what this library is. If it's not specified, CMake # will first try to get the description from the metainfo.yaml file or will # create one based on ``LIB_NAME``. # # ``INSTALL`` will cause the module to be installed to the ``pkgconfig`` # subdirectory of ``LIB_INSTALL_DIR``, unless the ``ECM_PKGCONFIG_INSTALL_DIR`` # cache variable is set to something different. Note that the first call to # ecm_generate_pkgconfig_file with the ``INSTALL`` argument will cause # ``ECM_PKGCONFIG_INSTALL_DIR`` to be set to the cache, and will be used in any # subsequent calls. # # To properly use this macro a version needs to be set. To retrieve it, # ``ECM_PKGCONFIG_INSTALL_DIR`` uses ``PROJECT_VERSION``. To set it, use the # project() command (only available since CMake 3.0) or the ecm_setup_version() # macro. # # Example usage: # # .. code-block:: cmake # # ecm_generate_pkgconfig_file( # BASE_NAME KF5Archive # DEPS Qt5Core # FILENAME_VAR pkgconfig_filename # INSTALL # ) # # Since 1.3.0. # ``DESCRIPTION`` available since 5.1.41 # #============================================================================= # Copyright 2014 Aleix Pol Gonzalez # Copyright 2014 David Faure # # 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. function(ECM_GENERATE_PKGCONFIG_FILE) set(options INSTALL) set(oneValueArgs BASE_NAME LIB_NAME FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR DESCRIPTION) set(multiValueArgs DEPS DEFINES) cmake_parse_arguments(EGPF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(EGPF_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to ECM_GENERATE_PKGCONFIG_FILE(): \"${EGPF_UNPARSED_ARGUMENTS}\"") endif() if(NOT EGPF_BASE_NAME) message(FATAL_ERROR "Required argument BASE_NAME missing in ECM_GENERATE_PKGCONFIG_FILE() call") endif() if(NOT PROJECT_VERSION) message(FATAL_ERROR "Required variable PROJECT_VERSION not set before ECM_GENERATE_PKGCONFIG_FILE() call. Did you call ecm_setup_version or project with the VERSION argument?") endif() if(NOT EGPF_LIB_NAME) set(EGPF_LIB_NAME ${EGPF_BASE_NAME}) endif() if(NOT EGPF_INCLUDE_INSTALL_DIR) if(INCLUDE_INSTALL_DIR) set(EGPF_INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_DIR}/${EGPF_BASE_NAME}") elseif(CMAKE_INSTALL_INCLUDEDIR) set(EGPF_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${EGPF_BASE_NAME}") else() set(EGPF_INCLUDE_INSTALL_DIR "include/${EGPF_BASE_NAME}") endif() endif() if(NOT EGPF_LIB_INSTALL_DIR) if(LIB_INSTALL_DIR) set(EGPF_LIB_INSTALL_DIR "${LIB_INSTALL_DIR}") elseif(CMAKE_INSTALL_LIBDIR) set(EGPF_LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") else() set(EGPF_LIB_INSTALL_DIR "lib") endif() endif() if(NOT EGPF_DESCRIPTION) if(EXISTS ${CMAKE_SOURCE_DIR}/metainfo.yaml) file(STRINGS "${CMAKE_SOURCE_DIR}/metainfo.yaml" _EGPF_METAINFO_DESCRIPTION_STRING REGEX "^description:.*$") if(_EGPF_METAINFO_DESCRIPTION_STRING) string(REGEX REPLACE "^description:[ ]*(.*)" "\\1" EGPF_DESCRIPTION ${_EGPF_METAINFO_DESCRIPTION_STRING}) endif() endif() if("${EGPF_DESCRIPTION}" STREQUAL "") set(EGPF_DESCRIPTION "${EGPF_LIB_NAME} library.") endif() endif() set(PKGCONFIG_TARGET_BASENAME ${EGPF_BASE_NAME}) set(PKGCONFIG_TARGET_LIBNAME ${EGPF_LIB_NAME}) if (DEFINED EGPF_DEPS) string(REPLACE ";" " " PKGCONFIG_TARGET_DEPS "${EGPF_DEPS}") endif () if(IS_ABSOLUTE "${EGPF_INCLUDE_INSTALL_DIR}") set(PKGCONFIG_TARGET_INCLUDES "-I${EGPF_INCLUDE_INSTALL_DIR}") else() set(PKGCONFIG_TARGET_INCLUDES "-I${CMAKE_INSTALL_PREFIX}/${EGPF_INCLUDE_INSTALL_DIR}") endif() if(IS_ABSOLUTE "${EGPF_LIB_INSTALL_DIR}") set(PKGCONFIG_TARGET_LIBS "${EGPF_LIB_INSTALL_DIR}") else() set(PKGCONFIG_TARGET_LIBS "${CMAKE_INSTALL_PREFIX}/${EGPF_LIB_INSTALL_DIR}") endif() set(PKGCONFIG_TARGET_DESCRIPTION "${EGPF_DESCRIPTION}") set(PKGCONFIG_TARGET_DEFINES "") if(EGPF_DEFINES) set(PKGCONFIG_TARGET_DEFINES "${EGPF_DEFINE}") endif() set(PKGCONFIG_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/${PKGCONFIG_TARGET_BASENAME}.pc) if (EGPF_FILENAME_VAR) set(${EGPF_FILENAME_VAR} ${PKGCONFIG_FILENAME} PARENT_SCOPE) endif() file(WRITE ${PKGCONFIG_FILENAME} " Name: ${PKGCONFIG_TARGET_LIBNAME} Description: ${PKGCONFIG_TARGET_DESCRIPTION} Version: ${PROJECT_VERSION} Libs: -L${CMAKE_INSTALL_PREFIX}/${EGPF_LIB_INSTALL_DIR} -l${PKGCONFIG_TARGET_LIBNAME} Cflags: ${PKGCONFIG_TARGET_INCLUDES} ${PKGCONFIG_TARGET_DEFINES} Requires: ${PKGCONFIG_TARGET_DEPS} " ) if(EGPF_INSTALL) if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(ECM_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig" CACHE PATH "The directory where pkgconfig will be installed to.") else() set(ECM_PKGCONFIG_INSTALL_DIR "${EGPF_LIB_INSTALL_DIR}/pkgconfig" CACHE PATH "The directory where pkgconfig will be installed to.") endif() install(FILES ${PKGCONFIG_FILENAME} DESTINATION ${ECM_PKGCONFIG_INSTALL_DIR}) endif() endfunction() diff --git a/modules/ECMPackageConfigHelpers.cmake b/modules/ECMPackageConfigHelpers.cmake index a118fea..b03d066 100644 --- a/modules/ECMPackageConfigHelpers.cmake +++ b/modules/ECMPackageConfigHelpers.cmake @@ -1,223 +1,223 @@ #.rst: # ECMPackageConfigHelpers # ----------------------- # # Helper macros for generating CMake package config files. # # ``write_basic_package_version_file()`` is the same as the one provided by the # `CMakePackageConfigHelpers -# `_ +# `_ # module in CMake; see that module's documentation for # more information. # # :: # # ecm_configure_package_config_file( # INSTALL_DESTINATION # [PATH_VARS [ [...]] # [NO_SET_AND_CHECK_MACRO] # [NO_CHECK_REQUIRED_COMPONENTS_MACRO]) # # # This behaves in the same way as configure_package_config_file() from CMake # 2.8.12, except that it adds an extra helper macro: find_dependency(). It is # highly recommended that you read the `documentation for # CMakePackageConfigHelpers -# `_ +# `_ # for more information, particularly with regard to the PATH_VARS argument. # # Note that there is no argument that will disable the find_dependency() macro; # if you do not require this macro, you should use # ``configure_package_config_file`` from the CMakePackageConfigHelpers module. # # CMake 3.0 includes a CMakeFindDependencyMacro module that provides the # find_dependency() macro (which you can ``include()`` in your package config # file), so this file is only useful for projects wishing to provide config # files that will work with CMake 2.8.12. # # Additional Config File Macros # ============================= # # :: # # find_dependency( [ [EXACT]]) # # find_dependency() should be used instead of find_package() to find package # dependencies. It forwards the correct parameters for EXACT, QUIET and # REQUIRED which were passed to the original find_package() call. It also sets # an informative diagnostic message if the dependency could not be found. # # Since pre-1.0.0. #============================================================================= # Copyright 2014 Alex Merry # Copyright 2013 Stephen Kelly # # 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. include(${CMAKE_ROOT}/Modules/CMakePackageConfigHelpers.cmake) set(_ecm_package_config_helpers_included TRUE) if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.13) message(AUTHOR_WARNING "Your project already requires a version of CMake that includes the find_dependency macro via the CMakeFindDependencyMacro module. You should use CMakePackageConfigHelpers instead of ECMPackageConfigHelpers.") endif() function(ECM_CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile) set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO) set(oneValueArgs INSTALL_DESTINATION ) set(multiValueArgs PATH_VARS ) cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(CCF_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"") endif() if(NOT CCF_INSTALL_DESTINATION) message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()") endif() if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}") set(absInstallDir "${CCF_INSTALL_DESTINATION}") else() set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}") endif() file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" ) foreach(var ${CCF_PATH_VARS}) if(NOT DEFINED ${var}) message(FATAL_ERROR "Variable ${var} does not exist") else() if(IS_ABSOLUTE "${${var}}") string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" PACKAGE_${var} "${${var}}") else() set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}") endif() endif() endforeach() get_filename_component(inputFileName "${_inputFile}" NAME) set(PACKAGE_INIT " ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() (ECM variant) ####### ####### Any changes to this file will be overwritten by the next CMake run ####### ####### The input file was ${inputFileName} ####### get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE) ") if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+") # Handle "/usr move" symlinks created by some Linux distros. set(PACKAGE_INIT "${PACKAGE_INIT} # Use original install prefix when loaded through a \"/usr move\" # cross-prefix symbolic link such as /lib -> /usr/lib. get_filename_component(_realCurr \"\${CMAKE_CURRENT_LIST_DIR}\" REALPATH) get_filename_component(_realOrig \"${absInstallDir}\" REALPATH) if(_realCurr STREQUAL _realOrig) set(PACKAGE_PREFIX_DIR \"${CMAKE_INSTALL_PREFIX}\") endif() unset(_realOrig) unset(_realCurr) ") endif() if(NOT CCF_NO_SET_AND_CHECK_MACRO) set(PACKAGE_INIT "${PACKAGE_INIT} macro(set_and_check _var _file) set(\${_var} \"\${_file}\") if(NOT EXISTS \"\${_file}\") message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\") endif() endmacro() include(CMakeFindDependencyMacro OPTIONAL RESULT_VARIABLE _CMakeFindDependencyMacro_FOUND) if (NOT _CMakeFindDependencyMacro_FOUND) macro(find_dependency dep) if (NOT \${dep}_FOUND) set(ecm_fd_version) if (\${ARGC} GREATER 1) set(ecm_fd_version \${ARGV1}) endif() set(ecm_fd_exact_arg) if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT) set(ecm_fd_exact_arg EXACT) endif() set(ecm_fd_quiet_arg) if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) set(ecm_fd_quiet_arg QUIET) endif() set(ecm_fd_required_arg) if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) set(ecm_fd_required_arg REQUIRED) endif() find_package(\${dep} \${ecm_fd_version} \${ecm_fd_exact_arg} \${ecm_fd_quiet_arg} \${ecm_fd_required_arg} ) if (NOT \${dep}_FOUND) set(\${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE \"\${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency \${dep} could not be found.\") set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND False) return() endif() set(ecm_fd_version) set(ecm_fd_required_arg) set(ecm_fd_quiet_arg) set(ecm_fd_exact_arg) endif() endmacro() endif() ") endif() if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO) set(PACKAGE_INIT "${PACKAGE_INIT} macro(check_required_components _NAME) foreach(comp \${\${_NAME}_FIND_COMPONENTS}) if(NOT \${_NAME}_\${comp}_FOUND) if(\${_NAME}_FIND_REQUIRED_\${comp}) set(\${_NAME}_FOUND FALSE) endif() endif() endforeach() endmacro() ") endif() set(PACKAGE_INIT "${PACKAGE_INIT} ####################################################################################") configure_file("${_inputFile}" "${_outputFile}" @ONLY) endfunction() diff --git a/modules/ECMQchDoxygen.config.in b/modules/ECMQchDoxygen.config.in index ad30072..58d53b1 100644 --- a/modules/ECMQchDoxygen.config.in +++ b/modules/ECMQchDoxygen.config.in @@ -1,247 +1,247 @@ #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = @ECM_QCH_DOXYGEN_PROJECTNAME@ PROJECT_NUMBER = @ECM_QCH_DOXYGEN_PROJECTVERSION@ OUTPUT_DIRECTORY = @ECM_QCH_DOXYGEN_OUTPUTDIR@ GENERATE_TAGFILE = @ECM_QCH_DOXYGEN_TAGFILE@ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The \$name class" \ "The \$name widget" \ "The \$name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = STRIP_FROM_INC_PATH = SHORT_NAMES = NO # Do not require explicity @brief command for brief description JAVADOC_AUTOBRIEF = YES MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO BUILTIN_STL_SUPPORT = NO DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES LAYOUT_FILE = @ECM_QCH_DOXYGEN_LAYOUTFILE@ #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = NO EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO # Require classes to be documented to appear in apidox, but always document all # public and protected members (even if static) HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = YES HIDE_FRIEND_COMPOUNDS = YES HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES HIDE_COMPOUND_REFERENCE = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_MEMBERS_CTORS_1ST = YES SORT_BRIEF_DOCS = YES SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = NO GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST = YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = NO SHOW_FILES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = @ECM_QCH_DOXYGEN_QUIET@ WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES WARN_FORMAT = "\$file:\$line: \$text" WARN_LOGFILE = @ECM_QCH_DOXYGEN_WARN_LOGFILE@ #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = @ECM_QCH_DOXYGEN_INPUT@ FILE_PATTERNS = @ECM_QCH_DOXYGEN_FILE_PATTERNS@ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = */.svn/* \ */.git/* \ */cmake/* \ *.moc.* \ moc* \ *.all_cpp.* \ *unload.* \ */test/* \ */tests/* \ */autotests/* \ *_p.cpp \ *_p.h # Symbols from Qt that show up occassionlly and we don't want to see EXCLUDE_SYMBOLS = iterator const_iterator EXAMPLE_PATH = @ECM_QCH_DOXYGEN_EXAMPLEDIRS@ EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = YES IMAGE_PATH = @ECM_QCH_DOXYGEN_IMAGEDIRS@ INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO USE_MDFILE_AS_MAINPAGE = @ECM_QCH_DOXYGEN_MAINPAGE_MDFILE@ #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # do NOT generate any formats other than qhp #--------------------------------------------------------------------------- SOURCE_BROWSER = NO GENERATE_HTML = YES GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO GENERATE_XML = NO GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO DISABLE_INDEX = YES HTML_DYNAMIC_SECTIONS = NO #--------------------------------------------------------------------------- # configuration options related to the qhp output #--------------------------------------------------------------------------- GENERATE_QHP = YES QCH_FILE = @ECM_QCH_DOXYGEN_FILEPATH@ QHP_NAMESPACE = @ECM_QCH_DOXYGEN_FULLNAMESPACE@ QHP_VIRTUAL_FOLDER = @ECM_QCH_DOXYGEN_VIRTUALFOLDER@ QHG_LOCATION = @ECM_QCH_DOXYGEN_QHELPGENERATOR_EXECUTABLE@ #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- ALLEXTERNALS = NO EXTERNAL_GROUPS = YES TAGFILES = @ECM_QCH_DOXYGEN_TAGFILES@ #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO CLASS_GRAPH = NO COLLABORATION_GRAPH = NO GROUP_GRAPHS = NO UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = NO INCLUDED_BY_GRAPH = NO CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = NO DIRECTORY_GRAPH = NO GENERATE_LEGEND = NO #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO ### KDE Settings ALIASES = "intern=\parInternal use only." \ "reimp=\parReimplemented from superclass." \ "obsolete=@deprecated" \ "feature=\xrefitem features \"Feature(s)\" \"Features\"" \ "unmaintained=\xrefitem unmaintained \"Unmaintained\" \"Unmaintained\"" \ "requirement=\xrefitem requirements \"Requirement(s)\" \"Requirements\"" \ "faq=\xrefitem FAQ \"F.A.Q.\" \"F.A.Q.\"" \ "authors=\xrefitem authors \"Author(s)\" \"Authors\"" \ "maintainers=\xrefitem maintainers \"Maintainer(s)\" \"Maintainers\"" \ "glossary=\xrefitem glossary \"Glossary\" \"Glossary\"" \ "acronym=\b " \ "licenses=\xrefitem licenses \"License(s)\" \"Licenses\"" \ "FIXME=\xrefitem fixme \"Fixme\" \"Fixme\"" \ "bc=\xrefitem bc \"Binary Compatible\" \"Binary Compatible\"" \ "threadsafe=\xrefitem threadsafe \"Threadsafe\" \"Threadsafe\"" \ - "artistic=Artistic" \ - "bsd=BSD" \ - "x11=X11" \ - "gpl=GPLv2" \ - "lgpl=LGPLv2" \ - "mit=MIT" \ - "qpl=QPL" + "artistic=Artistic" \ + "bsd=BSD" \ + "x11=X11" \ + "gpl=GPLv2" \ + "lgpl=LGPLv2" \ + "mit=MIT" \ + "qpl=QPL" PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ \ Q_WS_X11="" \ Q_WS_WIN="" \ Q_WS_MAC="" \ Q_WS_QWS="" \ Q_WS_MAEMO_5="" \ Q_OS_LINUX="" \ Q_OS_UNIX="" \ Q_OS_WIN="" \ Q_OS_MAC="" \ Q_OS_MACX="" \ Q_OS_DARWIN="" \ Q_OS_FREEBSD="" \ Q_OS_NETBSD="" \ Q_OS_OPENBSD="" \ Q_OS_BSD4="" \ Q_OS_SOLARIS="" \ Q_OS_IRIX="" \ \ Q_SLOTS="slots" \ Q_SIGNALS="signals" \ Q_DECL_CONSTEXPR="" \ Q_DECL_RELAXED_CONSTEXPR="" \ Q_DECL_OVERRIDE="override" \ Q_DECL_FINAL="final" \ Q_DECL_EQ_DEFAULT="= default" \ Q_DECL_EQ_DELETE="= delete" \ Q_DECL_NOEXCEPT="" \ Q_DECL_DEPRECATED="" \ Q_DECL_UNUSED_MEMBER="" \ Q_DECL_VARIABLE_DEPRECATED="" \ Q_DECL_EXPORT="" \ Q_DECL_IMPORT="" \ Q_DECL_HIDDEN="" \ Q_DECL_NULLPTR="nullptr" \ Q_REQUIRED_RESULT="" \ Q_SCRIPTABLE="" \ Q_INVOKABLE="" \ @ECM_QCH_DOXYGEN_PREDEFINED_MACROS@ \ @ECM_QCH_DOXYGEN_BLANK_MACROS@ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 864ce3a..9df03eb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,223 +1,223 @@ #============================================================================= # Copyright 2011 Alex Neundorf # Copyright 2014-2015 Alex Merry # # 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. #============================================================================= # We need to set a language to find CMake packages installed in # architecture-dependent locations (like /usr/lib64). # We only set this for the tests, making sure it does not interfere # with other files (as ECM itself is architecture-independent). project(ECMTests C) find_package(Qt5LinguistTools CONFIG) set_package_properties( Qt5LinguistTools PROPERTIES - URL "http://www.qt.io/" + URL "https://www.qt.io/" DESCRIPTION "Qt5 linguist tools." TYPE OPTIONAL PURPOSE "Required to run tests for the ECMPoQmTools module." ) find_package(Qt5Core CONFIG) set_package_properties( Qt5Core PROPERTIES - URL "http://www.qt.io/" + URL "https://www.qt.io/" DESCRIPTION "Qt5 core library." TYPE OPTIONAL PURPOSE "Required to run tests for the ECMQtDeclareLoggingCategory module, and for some tests of the KDEInstallDirs module." ) add_subdirectory(ECMAddTests) add_subdirectory(ECMGenerateHeadersTest) add_subdirectory(ECMSetupVersionTest) add_subdirectory(ECMGeneratePkgConfigFile) # a macro for tests that have a simple format where the name matches the # directory and project macro(add_test_variant NAME BASE COMMAND) string(REPLACE "." "/" src_dir "${BASE}") string(REPLACE "." "/" build_dir "${NAME}") string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") add_test(${NAME} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMAKE_CURRENT_SOURCE_DIR}/${src_dir}" "${CMAKE_CURRENT_BINARY_DIR}/${build_dir}" --build-two-config --build-generator ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM} --build-project ${proj} ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) endmacro() macro(add_test_macro NAME) add_test_variant("${NAME}" "${NAME}" ${ARGN}) endmacro() list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/find-modules) # Skip if PyQt not available find_file(SIP_Qt5Core_Mod_FILE NAMES QtCoremod.sip PATH_SUFFIXES share/sip/PyQt5/QtCore ) if(NOT SIP_Qt5Core_Mod_FILE) message(STATUS "WARNING: skipping tests that require PyQt") else() find_package(PythonModuleGeneration) foreach(pyversion 2 3) if (GPB_PYTHON${pyversion}_COMMAND) if (pythonCommands) list(APPEND pythonCommands " && ") endif() set(pythonCommands ${GPB_PYTHON${pyversion}_COMMAND} "${CMAKE_CURRENT_SOURCE_DIR}/GenerateSipBindings/testscript.py" "${CMAKE_CURRENT_BINARY_DIR}/GenerateSipBindings/py${pyversion}" ) endif() endforeach() if (pythonCommands) add_test_macro(GenerateSipBindings ${pythonCommands}) else() message(STATUS "WARNING: skipping GenerateSipBindings test") endif() endif() add_test_macro(ExecuteCoreModules dummy) add_test_macro(ExecuteKDEModules dummy) add_test_macro(KDEFetchTranslations dummy) add_test_macro(KDEInstallDirsTest.relative_or_absolute dummy) add_test_variant(KDEInstallDirsTest.vars_in_sync_no_args KDEInstallDirsTest.vars_in_sync dummy) add_test_macro(KDEInstallDirsTest.not_cache_variable dummy) set(KDEInstallDirsTest.vars_in_sync_kde_arg_EXTRA_OPTIONS --build-options -DKDE_INSTALL_BINDIR=altbin -DBINDIR_expected_value=altbin -DCMAKE_WARN_DEPRECATED=TRUE ) add_test_variant(KDEInstallDirsTest.vars_in_sync_kde_arg KDEInstallDirsTest.vars_in_sync dummy) set(KDEInstallDirsTest.vars_in_sync_cmake_arg_EXTRA_OPTIONS --build-options -DCMAKE_INSTALL_BINDIR=altbin -DBINDIR_expected_value=altbin -DCMAKE_WARN_DEPRECATED=TRUE ) add_test_variant(KDEInstallDirsTest.vars_in_sync_cmake_arg KDEInstallDirsTest.vars_in_sync dummy) set(KDEInstallDirsTest.vars_in_sync_oldstyle_arg_EXTRA_OPTIONS --build-options -DBIN_INSTALL_DIR=altbin -DBINDIR_expected_value=altbin -DCMAKE_WARN_DEPRECATED=TRUE ) add_test_variant(KDEInstallDirsTest.vars_in_sync_oldstyle_arg KDEInstallDirsTest.vars_in_sync dummy) set(KDEInstallDirsTest.relative_or_absolute_usr_EXTRA_OPTIONS --build-options -DCMAKE_INSTALL_PREFIX=/usr -DKDE_INSTALL_USE_QT_SYS_PATHS=FALSE -DAUTOSTARTDIR_should_be_absolute=TRUE -DCONFDIR_should_be_absolute=TRUE -DSYSCONFDIR_should_be_absolute=TRUE ) add_test_variant(KDEInstallDirsTest.relative_or_absolute_usr KDEInstallDirsTest.relative_or_absolute dummy) if (TARGET Qt5::qmake) set(KDEInstallDirsTest.relative_or_absolute_qt_EXTRA_OPTIONS --build-options -DKDE_INSTALL_USE_QT_SYS_PATHS=TRUE -DPLUGINDIR_should_be_absolute=TRUE -DQMLDIR_should_be_absolute=TRUE -DQTQCHDIR_should_be_absolute=TRUE -DQTPLUGINDIR_should_be_absolute=TRUE -DQTQUICKIMPORTSDIR_should_be_absolute=TRUE ) add_test_variant(KDEInstallDirsTest.relative_or_absolute_qt KDEInstallDirsTest.relative_or_absolute dummy) endif () if (Qt5Core_FOUND) add_test_macro(ECMQtDeclareLoggingCategoryTest testmain) endif() add_test_macro(FindModules dummy) add_test_macro(UseFindModules dummy) set(ECMAddAppIconTest_EXTRA_OPTIONS --build-target all --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMAddAppIconTest/InstallDirectory" ) add_test_macro(ECMAddAppIconTest ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMAddAppIconTest/check_files.cmake" ) set(ECMInstallIconsTest_EXTRA_OPTIONS --build-target install --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMInstallIconsTest/InstallDirectory" ) add_test_macro(ECMInstallIconsTest ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMInstallIconsTest/check_tree.cmake" ) set(KDEPackageAppTemplatesTest_EXTRA_OPTIONS --build-target install --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesTest/InstallDirectory" ) add_test_macro(KDEPackageAppTemplatesTest ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesTest/check.cmake" ) if (Qt5Core_FOUND AND Qt5LinguistTools_FOUND) set(ECMPoQmToolsTest_EXTRA_OPTIONS --build-target install --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/ECMPoQmToolsTest/InstallDirectory" ) add_test_macro(ECMPoQmToolsTest ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/ECMPoQmToolsTest/check.cmake" ) endif() find_package(Qt5Quick CONFIG) set_package_properties( Qt5Quick PROPERTIES - URL "http://www.qt.io/" + URL "https://www.qt.io/" DESCRIPTION "Qt5 Quick library." TYPE OPTIONAL PURPOSE "Required to run tests for the ECMQMLModules module." ) if (TARGET Qt5::Quick) add_test_macro(ECMQMLModules dummy) endif() diff --git a/tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/metadata.desktop b/tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/metadata.desktop index 5fcd677..3a1ec23 100644 --- a/tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/metadata.desktop +++ b/tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/metadata.desktop @@ -1,67 +1,67 @@ [Desktop Entry] Name=%{APPNAME} Name[ca]=%{APPNAME} Name[ca@valencia]=%{APPNAME} Name[da]=%{APPNAME} Name[en_GB]=%{APPNAME} Name[es]=%{APPNAME} Name[fi]=%{APPNAME} Name[gl]=%{APPNAME} Name[it]=%{APPNAME} Name[nb]=%{APPNAME} Name[nl]=%{APPNAME} Name[nn]=%{APPNAME} Name[pl]=%{APPNAME} Name[pt]=%{APPNAME} Name[pt_BR]=%{APPNAME} Name[sl]=%{APPNAME} Name[sr]=%{APPNAME} Name[sr@ijekavian]=%{APPNAME} Name[sr@ijekavianlatin]=%{APPNAME} Name[sr@latin]=%{APPNAME} Name[sv]=%{APPNAME} Name[uk]=%{APPNAME} Name[x-test]=xx%{APPNAME}xx Comment=what your app does in a few words Comment[ca]=Què fa aquesta aplicació en poques paraules Comment[ca@valencia]=Què fa esta aplicació en poques paraules Comment[da]=nogle få ord om hvad din app gør Comment[en_GB]=what your app does in a few words Comment[es]=lo que hace su aplicación, en pocas palabras Comment[fi]=ohjelmasi toiminta muutamalla sanalla Comment[gl]=o que fai o seu programa en poucas palabras Comment[it]=Cosa fa la tua applicazione in poche parole Comment[nb]=hva programmet gjør, med noen få ord Comment[nl]=wat uw app doet in een paar woorden Comment[pl]=w kilku słowach opis co robi twój program Comment[pt]=o que faz a sua aplicação, em poucas palavras Comment[pt_BR]=breve descrição do que o seu aplicativo faz Comment[sl]=kaj vaš program dela, v nekaj besedah Comment[sr]=Укратко о томе шта ваш програм ради Comment[sr@ijekavian]=Укратко о томе шта ваш програм ради Comment[sr@ijekavianlatin]=Ukratko o tome šta vaš program radi Comment[sr@latin]=Ukratko o tome šta vaš program radi Comment[sv]=vad programmet gör med några få ord Comment[uk]=призначення вашої програми у декількох словах Comment[x-test]=xxwhat your app does in a few wordsxx Icon=applications-system Type=Service ServiceTypes=Plasma/Applet X-KDE-PluginInfo-Author=%{AUTHOR} X-KDE-PluginInfo-Email=%{EMAIL} X-KDE-PluginInfo-Name=%{APPNAMELC} X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ +X-KDE-PluginInfo-Website=https://plasma.kde.org/ X-KDE-PluginInfo-Category=Utilities X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true X-KDE-PluginInfo-Name=org.kde.%{APPNAMELC} X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-Requires-FileDialog=Unused X-Plasma-Requires-LaunchApp=Unused X-Plasma-DefaultSize=200,300 diff --git a/toolchain/Android.cmake b/toolchain/Android.cmake index 76b3665..e6bf225 100644 --- a/toolchain/Android.cmake +++ b/toolchain/Android.cmake @@ -1,210 +1,210 @@ #.rst: # AndroidToolchain # ---------------- # # Enable easy compilation of cmake projects on Android. # # By using this android toolchain, the projects will be set up to compile the # specified project targeting an Android platform, depending on its input. # Furthermore, if desired, an APK can be directly generated by using the -# `androiddeployqt `_ tool. +# `androiddeployqt `_ tool. # # CMake upstream has Android support now. This module will still give us some # useful features offering androiddeployqt integration and adequate executables # format for our Android applications. # # Since we are using CMake Android support, any information from CMake documentation # still applies: # https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android # # .. note:: # # This module requires CMake 3.7. # # Since 1.7.0. # # Usage # ===== # # To use this file, you need to set the ``CMAKE_TOOLCHAIN_FILE`` to point to # ``Android.cmake`` on the command line:: # # cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake # # You will also need to provide the locations of the Android NDK and SDK. This # can be done on the commandline or with environment variables; in either case # the variable names are: # # ``CMAKE_ANDROID_NDK`` # The NDK root path. # ``ANDROID_SDK_ROOT`` # The SDK root path. # # Additional options are specified as cache variables (eg: on the command line): # # ``ANDROID_ABI`` # The ABI to use. See the ``sources/cxx-stl/gnu-libstdc++/*/libs`` # directories in the NDK. Default: ``armeabi-v7a``. # ``ANDROID_SDK_BUILD_TOOLS_REVISION`` # The build tools version to use. Default: ``21.1.1``. # ``ANDROID_EXTRA_LIBS`` # The ";"-separated list of full paths to libs to include in resulting APK. # # For integrating other libraries which are not part of the Android toolchain, # like Qt5, and installed to a separate prefix on the host system, the install # prefixes of those libraries would be passed as alternative roots as list via # ``ECM_ADDITIONAL_FIND_ROOT_PATH``. Since 5.30.0. # # For example, for integrating a Qt5 for Android with armv7 target present at # ``/opt/android/Qt5/5.7/android_armv7`` and some other libraries installed to # the prefix ``/opt/android/foo``, you would use:: # # cmake \ # -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \ # -DECM_ADDITIONAL_FIND_ROOT_PATH="/opt/android/Qt5/5.7/android_armv7;/opt/android/foo" # # If your project uses ``find_package()`` to locate build tools on the host # system, make sure to pass ``CMAKE_FIND_ROOT_PATH_BOTH`` or # ``NO_CMAKE_FIND_ROOT_PATH`` as argument in the call. See the # ``find_package()`` documentation for more details. # # Deploying Qt Applications # ========================= # # After building the application, you will need to generate an APK that can be # deployed to an Android device. This module integrates androiddeployqt support # to help with this for Qt-based projects. To enable this, set the # ``QTANDROID_EXPORTED_TARGET`` variable to the targets you wish to export as an # APK (in a ;-separed list), as well as ``ANDROID_APK_DIR`` to a directory # containing some basic information. This will create a ``create-apk-`` # target that will generate the APK file. See the `Qt on Android deployment -# documentation `_ for more +# documentation `_ for more # information. # # For example, you could do:: # # cmake \ # -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \ # -DQTANDROID_EXPORTED_TARGET=myapp \ # -DANDROID_APK_DIR=myapp-apk # make # make create-apk-myapp # # The APK would then be found in ``myapp_build_apk/bin`` in the build directory. # # The create-apk-myapp target will be able to take an ARGS parameter with further # arguments for androiddeployqt. For example, one can use:: # # make create-apk-myapp ARGS="--install" # # To install the apk to test. To generate a signed apk, one can do it with the # following syntax:: # # make create-apk-myapp ARGS="--sign ~/my.keystore alias_name" # # In case it's needed for your application to set the APK directory from cmake # scripting you can also set the directory as the ANDROID_APK_DIR property of # the create-apk-myapp target. # # See Android documentation on how to create a keystore to use # ============================================================================= # Copyright 2014 Aleix Pol i Gonzalez # # 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. cmake_minimum_required(VERSION "3.7") macro(set_deprecated_variable actual_variable deprecated_variable default_value) set(${deprecated_variable} "${default_value}" CACHE STRING "Deprecated. Use ${actual_variable}") if (NOT DEFINED ${actual_variable}) set(${actual_variable} ${${deprecated_variable}}) endif() endmacro() set_deprecated_variable(CMAKE_ANDROID_NDK ANDROID_NDK "$ENV{ANDROID_NDK}") set_deprecated_variable(CMAKE_ANDROID_ARCH ANDROID_ARCHITECTURE "arm") set_deprecated_variable(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ANDROID_GCC_VERSION "4.9") set_deprecated_variable(CMAKE_ANDROID_ARCH_ABI ANDROID_ABI "armeabi-v7a") set_deprecated_variable(CMAKE_ANDROID_API ANDROID_API_LEVEL "14") set(ANDROID_SDK_ROOT "$ENV{ANDROID_SDK_ROOT}" CACHE path "Android SDK path") file(GLOB build-tools LIST_DIRECTORIES TRUE RELATIVE ${ANDROID_SDK_ROOT}/build-tools ${ANDROID_SDK_ROOT}/build-tools/*) list(GET build-tools 0 _default_sdk) set(ANDROID_SDK_BUILD_TOOLS_REVISION "${_default_sdk}" CACHE string "Android API Level") set(CMAKE_SYSTEM_VERSION ${CMAKE_ANDROID_API}) set(CMAKE_SYSTEM_NAME Android) if (NOT CMAKE_ANDROID_STL_TYPE) set(CMAKE_ANDROID_STL_TYPE gnustl_shared) endif() include(${CMAKE_ROOT}/Modules/Platform/Android-GNU.cmake REQUIRED) include(${CMAKE_ROOT}/Modules/Platform/Android-Initialize.cmake REQUIRED) if (NOT DEFINED ECM_ADDITIONAL_FIND_ROOT_PATH) SET(ECM_ADDITIONAL_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH}) endif() SET(CMAKE_FIND_ROOT_PATH ${CMAKE_ANDROID_NDK} ${CMAKE_ANDROID_NDK}/sysroot ${CMAKE_SYSROOT} ${ECM_ADDITIONAL_FIND_ROOT_PATH}) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) #we want executables to be shared libraries, hooks will invoke the exported cmake function set(CMAKE_CXX_LINK_EXECUTABLE " -o " ) set(ECM_DIR "${CMAKE_CURRENT_LIST_DIR}/../cmake" CACHE STRING "") ######### generation # Need to ensure we only get in here once, as this file is included twice: # from CMakeDetermineSystem.cmake and from CMakeSystem.cmake generated within the # build directory. if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET "create-apk") get_filename_component(_CMAKE_ANDROID_DIR "${CMAKE_TOOLCHAIN_FILE}" PATH) list(LENGTH QTANDROID_EXPORTED_TARGET targetsCount) include(${_CMAKE_ANDROID_DIR}/ECMAndroidDeployQt.cmake) math(EXPR last "${targetsCount}-1") foreach(idx RANGE 0 ${last}) list(GET QTANDROID_EXPORTED_TARGET ${idx} exportedTarget) list(GET ANDROID_APK_DIR ${idx} APK_DIR) if(APK_DIR AND NOT EXISTS "${ANDROID_APK_DIR}/AndroidManifest.xml" AND IS_ABSOLUTE ANDROID_APK_DIR) message(FATAL_ERROR "Cannot find ${APK_DIR}/AndroidManifest.xml according to ANDROID_APK_DIR. ${ANDROID_APK_DIR} ${exportedTarget}") elseif(NOT APK_DIR) get_filename_component(_qt5Core_install_prefix "${Qt5Core_DIR}/../../../" ABSOLUTE) set(APK_DIR "${_qt5Core_install_prefix}/src/android/templates/") endif() ecm_androiddeployqt("${exportedTarget}" "${ECM_ADDITIONAL_FIND_ROOT_PATH}") set_target_properties(create-apk-${exportedTarget} PROPERTIES ANDROID_APK_DIR "${APK_DIR}") endforeach() else() message(STATUS "You can export a target by specifying -DQTANDROID_EXPORTED_TARGET= and -DANDROID_APK_DIR=") endif()