diff options
Diffstat (limited to 'find-modules')
-rw-r--r-- | find-modules/FindEGL.cmake | 15 | ||||
-rw-r--r-- | find-modules/FindKF5.cmake | 11 | ||||
-rw-r--r-- | find-modules/FindLibGit2.cmake | 13 | ||||
-rw-r--r-- | find-modules/FindOpenEXR.cmake | 7 | ||||
-rw-r--r-- | find-modules/FindPng2Ico.cmake | 117 | ||||
-rw-r--r-- | find-modules/FindQtWaylandScanner.cmake | 4 | ||||
-rw-r--r-- | find-modules/FindSharedMimeInfo.cmake | 11 | ||||
-rw-r--r-- | find-modules/FindWayland.cmake | 4 | ||||
-rw-r--r-- | find-modules/FindWaylandScanner.cmake | 2 | ||||
-rw-r--r-- | find-modules/FindX11_XCB.cmake | 11 | ||||
-rw-r--r-- | find-modules/FindXCB.cmake | 2 |
11 files changed, 159 insertions, 38 deletions
diff --git a/find-modules/FindEGL.cmake b/find-modules/FindEGL.cmake index 99d268df..b8787d8b 100644 --- a/find-modules/FindEGL.cmake +++ b/find-modules/FindEGL.cmake @@ -29,6 +29,8 @@ # 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 <alex.merry@kde.org> @@ -58,12 +60,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -if(CMAKE_VERSION VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by FindEGL.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 FindEGL.cmake") -endif() +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(EGL) # Use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls @@ -96,14 +95,14 @@ if(EGL_INCLUDE_DIR) # finding all these defines and selecting the highest numbered. file(READ "${EGL_INCLUDE_DIR}/egl.h" _EGL_header_contents) string(REGEX MATCHALL - "[ \\t]EGL_VERSION_[0-9_]+" + "[ \t]EGL_VERSION_[0-9_]+" _EGL_version_lines "${_EGL_header_contents}" ) unset(_EGL_header_contents) foreach(_EGL_version_line ${_EGL_version_lines}) string(REGEX REPLACE - "[ \\t]EGL_VERSION_([0-9_]+)" + "[ \t]EGL_VERSION_([0-9_]+)" "\\1" _version_candidate "${_EGL_version_line}" diff --git a/find-modules/FindKF5.cmake b/find-modules/FindKF5.cmake index 2e1fca87..b0ba9f6b 100644 --- a/find-modules/FindKF5.cmake +++ b/find-modules/FindKF5.cmake @@ -16,6 +16,8 @@ # If all the required components (those given in the COMPONENTS argument, but # not those given in the OPTIONAL_COMPONENTS argument) are found, ``KF5_FOUND`` # will be set to true. Otherwise, it will be set to false. +# +# Since pre-1.0.0. #============================================================================= # Copyright 2014 Alex Merry <alex.merry@kde.org> @@ -45,12 +47,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -if(CMAKE_VERSION VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by FindKF5.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 FindKF5.cmake") -endif() +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(KF5) if (NOT KF5_FIND_COMPONENTS) set(KF5_NOT_FOUND_MESSAGE "The KF5 package requires at least one component") diff --git a/find-modules/FindLibGit2.cmake b/find-modules/FindLibGit2.cmake index 3bb87c29..eaf227fc 100644 --- a/find-modules/FindLibGit2.cmake +++ b/find-modules/FindLibGit2.cmake @@ -1,6 +1,6 @@ #.rst: # FindLibGit2 -# ------- +# ----------- # # Try to find libgit2 on a Unix system. # @@ -28,6 +28,8 @@ # In general we recommend using the imported target, as it is easier to use. # Bear in mind, however, that if the target is in the link interface of an # exported library, it must be made available by the package config file. +# +# Since 1.3.0. #============================================================================= # Copyright 2014 Alex Merry <alex.merry@kde.org> @@ -58,12 +60,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -if(CMAKE_VERSION VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by FindLibGit2.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 FindLibGit2.cmake") -endif() +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(LibGit2) # Use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls diff --git a/find-modules/FindOpenEXR.cmake b/find-modules/FindOpenEXR.cmake index 85afebdf..d80caadd 100644 --- a/find-modules/FindOpenEXR.cmake +++ b/find-modules/FindOpenEXR.cmake @@ -23,6 +23,8 @@ # 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 2013-2014 Alex Merry <alex.merry@kdemail.net> @@ -52,10 +54,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) -if(${CMAKE_VERSION} VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by FindOpenEXR.cmake") -endif() +ecm_find_package_version_check(OpenEXR) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls diff --git a/find-modules/FindPng2Ico.cmake b/find-modules/FindPng2Ico.cmake new file mode 100644 index 00000000..d84f6673 --- /dev/null +++ b/find-modules/FindPng2Ico.cmake @@ -0,0 +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 <http://www.winterdrache.de/freeware/png2ico/>`_ does, while the +# version of png2ico from the `"KDE On Windows" (kdewin) +# <https://projects.kde.org/projects/kdesupport/kdewin>`_ project does not. +# +# ``Png2Ico_HAS_RCFILE_ARGUMENT`` +# Whether png2ico accepts an ``--rcfile`` argument. The version of png2ico +# from the `"KDE On Windows" (kdewin) +# <https://projects.kde.org/projects/kdesupport/kdewin>`_ project does, +# while `Matthias Benkmann's tool +# <http://www.winterdrache.de/freeware/png2ico/>`_ does not. +# +# Since 1.7.0. + +#============================================================================= +# Copyright 2014 Alex Merry <alex.merry@kde.org> +# +# 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" + DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file" +) + diff --git a/find-modules/FindQtWaylandScanner.cmake b/find-modules/FindQtWaylandScanner.cmake index 7fb8a009..79a1b051 100644 --- a/find-modules/FindQtWaylandScanner.cmake +++ b/find-modules/FindQtWaylandScanner.cmake @@ -55,6 +55,8 @@ # 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 <pierluigi.fiorini@gmail.com> @@ -88,7 +90,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) ecm_find_package_version_check(QtWaylandScanner) # Find qtwaylandscanner -find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner) +find_program(QtWaylandScanner_EXECUTABLE NAMES qtwaylandscanner HINTS /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/qt5/bin/) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(QtWaylandScanner diff --git a/find-modules/FindSharedMimeInfo.cmake b/find-modules/FindSharedMimeInfo.cmake index 263a5028..00bebf16 100644 --- a/find-modules/FindSharedMimeInfo.cmake +++ b/find-modules/FindSharedMimeInfo.cmake @@ -23,6 +23,8 @@ # 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 <alex.merry@kdemail.net> @@ -52,12 +54,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -if(CMAKE_VERSION VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by FindSharedMimeInfo.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 FindSharedMimeInfo.cmake") -endif() +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(SharedMimeInfo) find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database) diff --git a/find-modules/FindWayland.cmake b/find-modules/FindWayland.cmake index 490ab1be..c5a56c16 100644 --- a/find-modules/FindWayland.cmake +++ b/find-modules/FindWayland.cmake @@ -44,6 +44,8 @@ # 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 <alex.merry@kde.org> @@ -115,7 +117,7 @@ if(NOT Wayland_VERSION) if(Wayland_VERSION_HEADER) file(READ ${Wayland_VERSION_HEADER} _wayland_version_header_contents) string(REGEX REPLACE - "^.*[ \\t]+WAYLAND_VERSION[ \\t]+\"([0-9.]*)\".*$" + "^.*[ \t]+WAYLAND_VERSION[ \t]+\"([0-9.]*)\".*$" "\\1" Wayland_VERSION "${_wayland_version_header_contents}" diff --git a/find-modules/FindWaylandScanner.cmake b/find-modules/FindWaylandScanner.cmake index 33c46f9b..4052cdab 100644 --- a/find-modules/FindWaylandScanner.cmake +++ b/find-modules/FindWaylandScanner.cmake @@ -47,6 +47,8 @@ # Generate Wayland server protocol files from ``<xmlfile>`` XML # definition for the ``<basename>`` interface and append those files # to ``<source_files_var>``. +# +# Since 1.4.0. #============================================================================= # Copyright 2012-2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> diff --git a/find-modules/FindX11_XCB.cmake b/find-modules/FindX11_XCB.cmake index eafa08e2..dd55fd7b 100644 --- a/find-modules/FindX11_XCB.cmake +++ b/find-modules/FindX11_XCB.cmake @@ -30,6 +30,8 @@ # 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 <alex.merry@kde.org> @@ -61,12 +63,9 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -if(CMAKE_VERSION VERSION_LESS 2.8.12) - message(FATAL_ERROR "CMake 2.8.12 is required by FindX11_XCB.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 FindX11_XCB.cmake") -endif() +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 diff --git a/find-modules/FindXCB.cmake b/find-modules/FindXCB.cmake index 781b15c5..b2a800f7 100644 --- a/find-modules/FindXCB.cmake +++ b/find-modules/FindXCB.cmake @@ -51,6 +51,8 @@ # 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 <fredrik@kde.org> |