summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Kitware/modules/FindICU.cmake438
-rw-r--r--cmake/Kitware/modules/SelectLibraryConfigurations.cmake80
-rw-r--r--cmake/Toolchain-Linux-GCC-i686.cmake29
-rw-r--r--cmake/Toolchain-OSX-GCC-i686.cmake29
-rw-r--r--cmake/Toolchain-QNX-common.cmake (renamed from cmake/Toolchain-QNX66.cmake)30
-rw-r--r--cmake/Toolchain-QNX650-armv7.cmake (renamed from cmake/Toolchain-QNX65.cmake)24
-rw-r--r--cmake/Toolchain-QNX650-x86.cmake88
-rw-r--r--cmake/Toolchain-QNX660-armv7.cmake21
-rw-r--r--cmake/Toolchain-QNX660-common.cmake23
-rw-r--r--cmake/Toolchain-QNX660-x86.cmake21
-rw-r--r--cmake/Toolchain-QNX700-aarch64.cmake22
-rw-r--r--cmake/Toolchain-QNX700-armv7.cmake22
-rw-r--r--cmake/Toolchain-QNX700-common.cmake27
-rw-r--r--cmake/Toolchain-QNX700-x86.cmake22
-rw-r--r--cmake/Toolchain-QNX700-x86_64.cmake22
-rw-r--r--cmake/Toolchain-RPI.cmake30
-rw-r--r--cmake/Toolchain-Yocto.cmake30
-rw-r--r--cmake/Toolchain-blackberry-armv7le.cmake30
-rw-r--r--cmake/Toolchain-iMX6.cmake31
-rw-r--r--cmake/Toolchain-iOS.cmake130
-rw-r--r--cmake/Toolchain-jetson-tk1.cmake29
-rw-r--r--cmake/modules/FindBDB.cmake4
-rw-r--r--cmake/modules/FindBerkeleyDB.cmake240
-rw-r--r--cmake/modules/FindGLib.cmake5
-rw-r--r--cmake/modules/FindGObjectIntrospection.cmake8
-rw-r--r--cmake/modules/FindLibXML.cmake5
-rw-r--r--cmake/modules/FindWcecompat.cmake6
-rw-r--r--cmake/modules/GObjectIntrospectionMacros.cmake97
-rw-r--r--cmake/modules/GtkDoc.cmake56
-rw-r--r--cmake/modules/LibIcalMacrosInternal.cmake49
-rw-r--r--cmake/run_test.cmake9
31 files changed, 644 insertions, 1013 deletions
diff --git a/cmake/Kitware/modules/FindICU.cmake b/cmake/Kitware/modules/FindICU.cmake
deleted file mode 100644
index 4fa16bf1..00000000
--- a/cmake/Kitware/modules/FindICU.cmake
+++ /dev/null
@@ -1,438 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#[=======================================================================[.rst:
-FindICU
--------
-
-.. versionadded:: 3.7
-
-Find the International Components for Unicode (ICU) libraries and
-programs.
-
-This module supports multiple components.
-Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
-``lx``, ``test``, ``tu`` and ``uc``.
-
-Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
-``in``; any of the names may be used, and the appropriate
-platform-specific library name will be automatically selected.
-
-.. versionadded:: 3.11
- Added support for static libraries on Windows.
-
-This module reports information about the ICU installation in
-several variables. General variables::
-
- ICU_VERSION - ICU release version
- ICU_FOUND - true if the main programs and libraries were found
- ICU_LIBRARIES - component libraries to be linked
- ICU_INCLUDE_DIRS - the directories containing the ICU headers
-
-Imported targets::
-
- ICU::<C>
-
-Where ``<C>`` is the name of an ICU component, for example
-``ICU::i18n``; ``<C>`` is lower-case.
-
-ICU programs are reported in::
-
- ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
- ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
- ICU_GENBRK_EXECUTABLE - path to genbrk executable
- ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
- ICU_GENRB_EXECUTABLE - path to genrb executable
- ICU_GENDICT_EXECUTABLE - path to gendict executable
- ICU_DERB_EXECUTABLE - path to derb executable
- ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
- ICU_UCONV_EXECUTABLE - path to uconv executable
- ICU_GENCFU_EXECUTABLE - path to gencfu executable
- ICU_MAKECONV_EXECUTABLE - path to makeconv executable
- ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
- ICU_GENCCODE_EXECUTABLE - path to genccode executable
- ICU_GENSPREP_EXECUTABLE - path to gensprep executable
- ICU_ICUPKG_EXECUTABLE - path to icupkg executable
- ICU_GENCMN_EXECUTABLE - path to gencmn executable
-
-ICU component libraries are reported in::
-
- ICU_<C>_FOUND - ON if component was found; ``<C>`` is upper-case.
- ICU_<C>_LIBRARIES - libraries for component; ``<C>`` is upper-case.
-
-ICU datafiles are reported in::
-
- ICU_MAKEFILE_INC - Makefile.inc
- ICU_PKGDATA_INC - pkgdata.inc
-
-This module reads hints about search results from::
-
- ICU_ROOT - the root of the ICU installation
-
-The environment variable ``ICU_ROOT`` may also be used; the
-ICU_ROOT variable takes precedence.
-
-The following cache variables may also be set::
-
- ICU_<P>_EXECUTABLE - the path to executable <P>; ``<P>`` is upper-case.
- ICU_INCLUDE_DIR - the directory containing the ICU headers
- ICU_<C>_LIBRARY - the library for component <C>; ``<C>`` is upper-case.
-
-.. note::
-
- In most cases none of the above variables will require setting,
- unless multiple ICU versions are available and a specific version
- is required.
-
-Other variables one may set to control this module are::
-
- ICU_DEBUG - Set to ON to enable debug output from FindICU.
-#]=======================================================================]
-
-# Written by Roger Leigh <rleigh@codelibre.net>
-
-set(icu_programs
- gencnval
- icuinfo
- genbrk
- icu-config
- genrb
- gendict
- derb
- pkgdata
- uconv
- gencfu
- makeconv
- gennorm2
- genccode
- gensprep
- icupkg
- gencmn)
-
-set(icu_data
- Makefile.inc
- pkgdata.inc)
-
-# The ICU checks are contained in a function due to the large number
-# of temporary variables needed.
-function(_ICU_FIND)
- # Set up search paths, taking compiler into account. Search ICU_ROOT,
- # with ICU_ROOT in the environment as a fallback if unset.
- if(ICU_ROOT)
- list(APPEND icu_roots "${ICU_ROOT}")
- else()
- if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
- file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
- list(APPEND icu_roots "${NATIVE_PATH}")
- set(ICU_ROOT "${NATIVE_PATH}"
- CACHE PATH "Location of the ICU installation" FORCE)
- endif()
- endif()
-
- # Find include directory
- list(APPEND icu_include_suffixes "include")
- find_path(ICU_INCLUDE_DIR
- NAMES "unicode/utypes.h"
- HINTS ${icu_roots}
- PATH_SUFFIXES ${icu_include_suffixes}
- DOC "ICU include directory")
- set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
-
- # Get version
- if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
- file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
- REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
-
- string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
- "\\1" icu_version_string "${icu_header_str}")
- set(ICU_VERSION "${icu_version_string}")
- set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
- unset(icu_header_str)
- unset(icu_version_string)
- endif()
-
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- # 64-bit binary directory
- set(_bin64 "bin64")
- # 64-bit library directory
- set(_lib64 "lib64")
- endif()
-
-
- # Find all ICU programs
- list(APPEND icu_binary_suffixes "${_bin64}" "bin" "sbin")
- foreach(program ${icu_programs})
- string(TOUPPER "${program}" program_upcase)
- set(cache_var "ICU_${program_upcase}_EXECUTABLE")
- set(program_var "ICU_${program_upcase}_EXECUTABLE")
- find_program("${cache_var}"
- NAMES "${program}"
- HINTS ${icu_roots}
- PATH_SUFFIXES ${icu_binary_suffixes}
- DOC "ICU ${program} executable"
- NO_PACKAGE_ROOT_PATH
- )
- mark_as_advanced(cache_var)
- set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
- endforeach()
-
- # Find all ICU libraries
- list(APPEND icu_library_suffixes "${_lib64}" "lib")
- set(ICU_REQUIRED_LIBS_FOUND ON)
- set(static_prefix )
- # static icu libraries compiled with MSVC have the prefix 's'
- if(MSVC)
- set(static_prefix "s")
- endif()
- foreach(component ${ICU_FIND_COMPONENTS})
- string(TOUPPER "${component}" component_upcase)
- set(component_cache "ICU_${component_upcase}_LIBRARY")
- set(component_cache_release "${component_cache}_RELEASE")
- set(component_cache_debug "${component_cache}_DEBUG")
- set(component_found "ICU_${component_upcase}_FOUND")
- set(component_found_compat "${component_upcase}_FOUND")
- set(component_libnames "icu${component}")
- set(component_debug_libnames "icu${component}d")
-
- # Special case deliberate library naming mismatches between Unix
- # and Windows builds
- unset(component_libnames)
- unset(component_debug_libnames)
- list(APPEND component_libnames "icu${component}")
- list(APPEND component_debug_libnames "icu${component}d")
- if(component STREQUAL "data")
- list(APPEND component_libnames "icudt")
- # Note there is no debug variant at present
- list(APPEND component_debug_libnames "icudtd")
- endif()
- if(component STREQUAL "dt")
- list(APPEND component_libnames "icudata")
- # Note there is no debug variant at present
- list(APPEND component_debug_libnames "icudatad")
- endif()
- if(component STREQUAL "i18n")
- list(APPEND component_libnames "icuin")
- list(APPEND component_debug_libnames "icuind")
- endif()
- if(component STREQUAL "in")
- list(APPEND component_libnames "icui18n")
- list(APPEND component_debug_libnames "icui18nd")
- endif()
-
- if(static_prefix)
- unset(static_component_libnames)
- unset(static_component_debug_libnames)
- foreach(component_libname ${component_libnames})
- list(APPEND static_component_libnames
- ${static_prefix}${component_libname})
- endforeach()
- foreach(component_libname ${component_debug_libnames})
- list(APPEND static_component_debug_libnames
- ${static_prefix}${component_libname})
- endforeach()
- list(APPEND component_libnames ${static_component_libnames})
- list(APPEND component_debug_libnames ${static_component_debug_libnames})
- endif()
- find_library("${component_cache_release}"
- NAMES ${component_libnames}
- HINTS ${icu_roots}
- PATH_SUFFIXES ${icu_library_suffixes}
- DOC "ICU ${component} library (release)"
- NO_PACKAGE_ROOT_PATH
- )
- find_library("${component_cache_debug}"
- NAMES ${component_debug_libnames}
- HINTS ${icu_roots}
- PATH_SUFFIXES ${icu_library_suffixes}
- DOC "ICU ${component} library (debug)"
- NO_PACKAGE_ROOT_PATH
- )
- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
- select_library_configurations(ICU_${component_upcase})
- mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
- if(${component_cache})
- set("${component_found}" ON)
- set("${component_found_compat}" ON)
- list(APPEND ICU_LIBRARY "${${component_cache}}")
- endif()
- mark_as_advanced("${component_found}")
- mark_as_advanced("${component_found_compat}")
- set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
- set("${component_found}" "${${component_found}}" PARENT_SCOPE)
- set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
- if(component_found OR component_found_compat)
- if (ICU_FIND_REQUIRED_${component})
- list(APPEND ICU_LIBS_FOUND "${component} (required)")
- else()
- list(APPEND ICU_LIBS_FOUND "${component} (optional)")
- endif()
- else()
- if (ICU_FIND_REQUIRED_${component})
- set(ICU_REQUIRED_LIBS_FOUND OFF)
- list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
- else()
- list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
- endif()
- endif()
- endforeach()
- set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
- set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
-
- # Find all ICU data files
- if(CMAKE_LIBRARY_ARCHITECTURE)
- list(APPEND icu_data_suffixes
- "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
- "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
- "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
- "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
- endif()
- list(APPEND icu_data_suffixes
- "${_lib64}/icu/${ICU_VERSION}"
- "lib/icu/${ICU_VERSION}"
- "${_lib64}/icu"
- "lib/icu")
- foreach(data ${icu_data})
- string(TOUPPER "${data}" data_upcase)
- string(REPLACE "." "_" data_upcase "${data_upcase}")
- set(cache_var "ICU_${data_upcase}")
- set(data_var "ICU_${data_upcase}")
- find_file("${cache_var}"
- NAMES "${data}"
- HINTS ${icu_roots}
- PATH_SUFFIXES ${icu_data_suffixes}
- DOC "ICU ${data} data file")
- mark_as_advanced(cache_var)
- set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
- endforeach()
-
- if(NOT ICU_FIND_QUIETLY)
- if(ICU_LIBS_FOUND)
- message(STATUS "Found the following ICU libraries:")
- foreach(found ${ICU_LIBS_FOUND})
- message(STATUS " ${found}")
- endforeach()
- endif()
- if(ICU_LIBS_NOTFOUND)
- message(STATUS "The following ICU libraries were not found:")
- foreach(notfound ${ICU_LIBS_NOTFOUND})
- message(STATUS " ${notfound}")
- endforeach()
- endif()
- endif()
-
- if(ICU_DEBUG)
- message(STATUS "--------FindICU.cmake search debug--------")
- message(STATUS "ICU binary path search order: ${icu_roots}")
- message(STATUS "ICU include path search order: ${icu_roots}")
- message(STATUS "ICU library path search order: ${icu_roots}")
- message(STATUS "----------------")
- endif()
-endfunction()
-
-_ICU_FIND()
-
-#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
- FOUND_VAR ICU_FOUND
- REQUIRED_VARS ICU_INCLUDE_DIR
- ICU_LIBRARY
- _ICU_REQUIRED_LIBS_FOUND
- VERSION_VAR ICU_VERSION
- FAIL_MESSAGE "Failed to find all ICU components")
-
-unset(_ICU_REQUIRED_LIBS_FOUND)
-
-if(ICU_FOUND)
- set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
- set(ICU_LIBRARIES "${ICU_LIBRARY}")
- foreach(_ICU_component ${ICU_FIND_COMPONENTS})
- string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
- set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
- set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
- set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
- set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
- set(_ICU_component_found "ICU_${_ICU_component_upcase}_FOUND")
- set(_ICU_imported_target "ICU::${_ICU_component}")
- if(${_ICU_component_found})
- set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
- if(NOT TARGET ${_ICU_imported_target})
- add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
- if(ICU_INCLUDE_DIR)
- set_target_properties(${_ICU_imported_target} PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
- endif()
- if(EXISTS "${${_ICU_component_cache}}")
- set_target_properties(${_ICU_imported_target} PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
- IMPORTED_LOCATION "${${_ICU_component_cache}}")
- endif()
- if(EXISTS "${${_ICU_component_cache_release}}")
- set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
- IMPORTED_CONFIGURATIONS RELEASE)
- set_target_properties(${_ICU_imported_target} PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
- IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
- endif()
- if(EXISTS "${${_ICU_component_cache_debug}}")
- set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
- IMPORTED_CONFIGURATIONS DEBUG)
- set_target_properties(${_ICU_imported_target} PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
- IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
- endif()
- if(CMAKE_DL_LIBS AND _ICU_component STREQUAL "uc")
- set_target_properties(${_ICU_imported_target} PROPERTIES
- INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
- endif()
- endif()
- endif()
- unset(_ICU_component_upcase)
- unset(_ICU_component_cache)
- unset(_ICU_component_lib)
- unset(_ICU_component_found)
- unset(_ICU_imported_target)
- endforeach()
-endif()
-
-if(ICU_DEBUG)
- message(STATUS "--------FindICU.cmake results debug--------")
- message(STATUS "ICU found: ${ICU_FOUND}")
- message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
- message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
- message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
- message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
-
- foreach(program IN LISTS icu_programs)
- string(TOUPPER "${program}" program_upcase)
- set(program_lib "ICU_${program_upcase}_EXECUTABLE")
- message(STATUS "${program} program: ${program_lib}=${${program_lib}}")
- unset(program_upcase)
- unset(program_lib)
- endforeach()
-
- foreach(data IN LISTS icu_data)
- string(TOUPPER "${data}" data_upcase)
- string(REPLACE "." "_" data_upcase "${data_upcase}")
- set(data_lib "ICU_${data_upcase}")
- message(STATUS "${data} data: ${data_lib}=${${data_lib}}")
- unset(data_upcase)
- unset(data_lib)
- endforeach()
-
- foreach(component IN LISTS ICU_FIND_COMPONENTS)
- string(TOUPPER "${component}" component_upcase)
- set(component_lib "ICU_${component_upcase}_LIBRARIES")
- set(component_found "ICU_${component_upcase}_FOUND")
- set(component_found_compat "${component_upcase}_FOUND")
- message(STATUS "${component} library found: ${component_found}=${${component_found}}")
- message(STATUS "${component} library found (compat name): ${component_found_compat}=${${component_found_compat}}")
- message(STATUS "${component} library: ${component_lib}=${${component_lib}}")
- unset(component_upcase)
- unset(component_lib)
- unset(component_found)
- unset(component_found_compat)
- endforeach()
- message(STATUS "----------------")
-endif()
-
-unset(icu_programs)
diff --git a/cmake/Kitware/modules/SelectLibraryConfigurations.cmake b/cmake/Kitware/modules/SelectLibraryConfigurations.cmake
deleted file mode 100644
index 50ee9fe7..00000000
--- a/cmake/Kitware/modules/SelectLibraryConfigurations.cmake
+++ /dev/null
@@ -1,80 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#[=======================================================================[.rst:
-SelectLibraryConfigurations
----------------------------
-
-.. code-block:: cmake
-
- select_library_configurations(basename)
-
-This macro takes a library base name as an argument, and will choose
-good values for the variables
-
-::
-
- basename_LIBRARY
- basename_LIBRARIES
- basename_LIBRARY_DEBUG
- basename_LIBRARY_RELEASE
-
-depending on what has been found and set.
-
-If only ``basename_LIBRARY_RELEASE`` is defined, ``basename_LIBRARY`` will
-be set to the release value, and ``basename_LIBRARY_DEBUG`` will be set
-to ``basename_LIBRARY_DEBUG-NOTFOUND``. If only ``basename_LIBRARY_DEBUG``
-is defined, then ``basename_LIBRARY`` will take the debug value, and
-``basename_LIBRARY_RELEASE`` will be set to ``basename_LIBRARY_RELEASE-NOTFOUND``.
-
-If the generator supports configuration types, then ``basename_LIBRARY``
-and ``basename_LIBRARIES`` will be set with debug and optimized flags
-specifying the library to be used for the given configuration. If no
-build type has been set or the generator in use does not support
-configuration types, then ``basename_LIBRARY`` and ``basename_LIBRARIES``
-will take only the release value, or the debug value if the release one
-is not set.
-#]=======================================================================]
-
-# This macro was adapted from the FindQt4 CMake module and is maintained by Will
-# Dicharry <wdicharry@stellarscience.com>.
-
-macro(select_library_configurations basename)
- if(NOT ${basename}_LIBRARY_RELEASE)
- set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
- endif()
- if(NOT ${basename}_LIBRARY_DEBUG)
- set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
- endif()
-
- get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
- if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
- NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
- ( _isMultiConfig OR CMAKE_BUILD_TYPE ) )
- # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
- # single-config generators, set optimized and debug libraries
- set( ${basename}_LIBRARY "" )
- foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
- list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
- endforeach()
- foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
- list( APPEND ${basename}_LIBRARY debug "${_libname}" )
- endforeach()
- elseif( ${basename}_LIBRARY_RELEASE )
- set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
- elseif( ${basename}_LIBRARY_DEBUG )
- set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
- else()
- set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
- endif()
-
- set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
-
- if( ${basename}_LIBRARY )
- set( ${basename}_FOUND TRUE )
- endif()
-
- mark_as_advanced( ${basename}_LIBRARY_RELEASE
- ${basename}_LIBRARY_DEBUG
- )
-endmacro()
diff --git a/cmake/Toolchain-Linux-GCC-i686.cmake b/cmake/Toolchain-Linux-GCC-i686.cmake
index 4fe6d1c0..8bf12272 100644
--- a/cmake/Toolchain-Linux-GCC-i686.cmake
+++ b/cmake/Toolchain-Linux-GCC-i686.cmake
@@ -1,34 +1,11 @@
# Toolchain file for 32bit builds on 64bit Linux hosts
#
-# Copyright (c) 2013-2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
-# All rights reserved.
-#
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Volker Krause <volker.krause@kdab.com>
# Author: Filipe Azevedo <filipe.azevedo@kdab.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# SPDX-License-Identifier: BSD-3-Clause
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "i686")
diff --git a/cmake/Toolchain-OSX-GCC-i686.cmake b/cmake/Toolchain-OSX-GCC-i686.cmake
index 42644b01..d76b27af 100644
--- a/cmake/Toolchain-OSX-GCC-i686.cmake
+++ b/cmake/Toolchain-OSX-GCC-i686.cmake
@@ -1,34 +1,11 @@
# Toolchain file for 32bit builds on 64bit OSX hosts
#
-# Copyright (c) 2013-2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
-# All rights reserved.
-#
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Volker Krause <volker.krause@kdab.com>
# Author: Filipe Azevedo <filipe.azevedo@kdab.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# SPDX-License-Identifier: BSD-3-Clause
set(CMAKE_SYSTEM_NAME "Darwin")
set(CMAKE_SYSTEM_PROCESSOR "i686")
diff --git a/cmake/Toolchain-QNX66.cmake b/cmake/Toolchain-QNX-common.cmake
index dafeb610..fa6899a3 100644
--- a/cmake/Toolchain-QNX66.cmake
+++ b/cmake/Toolchain-QNX-common.cmake
@@ -1,18 +1,18 @@
#
-# (C) Copyright 2009 Johns Hopkins University (JHU), All Rights
-# Reserved.
-#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-FileCopyrightText: 2012-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# SPDX-License-Identifier: LicenseRef-CISST
+
# --- begin cisst license - do not edit ---
#
-# This software is provided "as is" under an open source license, with
-# no warranty. The complete license can be found in license.txt and
-# https://www.cisst.org/cisst/license.txt.
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
#
# --- end cisst license ---
SET(CMAKE_SYSTEM_NAME QNX)
-SET(CMAKE_SYSTEM_VERSION 6.6.0)
-SET(CMAKE_SYSTEM_PROCESSOR armv7)
+SET(CMAKE_SYSTEM_VERSION ${QNX_VERSION})
+SET(CMAKE_SYSTEM_PROCESSOR ${QNX_PROCESSOR})
SET(TOOLCHAIN QNX)
#SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".a")
@@ -28,14 +28,14 @@ ENDIF(CMAKE_HOST_WIN32)
FIND_PATH(QNX_HOST
NAME usr/bin/qcc${HOST_EXECUTABLE_SUFFIX}
- PATHS $ENV{QNX_HOST} C:/qnx660/host/win32/x86
+ PATHS $ENV{QNX_HOST} ${QNX_HOST_HINT}
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
)
FIND_PATH(QNX_TARGET
NAME usr/include/qconfig.mk
- PATHS $ENV{QNX_TARGET} C:/qnx660/target/qnx6
+ PATHS $ENV{QNX_TARGET} ${QNX_TARGET_HINT}
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
)
@@ -58,7 +58,9 @@ IF(CMAKE_HOST_WIN32)
SET(ENV{PATH} "$ENV{PATH};${QNX_HOST}/usr/bin")
ENDIF(CMAKE_HOST_WIN32)
-SET(CMAKE_MAKE_PROGRAM "${QNX_HOST}/usr/bin/make${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Make Program")
+if(CMAKE_GENERATOR MATCHES "Makefiles")
+ SET(CMAKE_MAKE_PROGRAM "${QNX_HOST}/usr/bin/make${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Make Program")
+endif()
SET(CMAKE_SH "${QNX_HOST}/usr/bin/sh${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX shell Program")
SET(CMAKE_AR "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ar${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX ar Program")
SET(CMAKE_RANLIB "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ranlib${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX ranlib Program")
@@ -80,10 +82,8 @@ SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
-SET(CMAKE_FIND_ROOT_PATH ${QNX_TARGET})
+LIST(APPEND CMAKE_FIND_ROOT_PATH ${QNX_TARGET})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-SET(CMAKE_C_FLAGS "-Vgcc_ntoarmv7le" CACHE STRING "qcc c flags" FORCE)
-SET(CMAKE_CXX_FLAGS "-Vgcc_ntoarmv7le -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
diff --git a/cmake/Toolchain-QNX65.cmake b/cmake/Toolchain-QNX650-armv7.cmake
index 2c5772e4..4ba1dc89 100644
--- a/cmake/Toolchain-QNX65.cmake
+++ b/cmake/Toolchain-QNX650-armv7.cmake
@@ -1,18 +1,17 @@
#
-# (C) Copyright 2009 Johns Hopkins University (JHU), All Rights
-# Reserved.
-#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-License-Identifier: LicenseRef-CISST
+
# --- begin cisst license - do not edit ---
#
-# This software is provided "as is" under an open source license, with
-# no warranty. The complete license can be found in license.txt and
-# https://www.cisst.org/cisst/license.txt.
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
#
# --- end cisst license ---
SET(CMAKE_SYSTEM_NAME QNX)
SET(CMAKE_SYSTEM_VERSION 6.5.0)
-SET(CMAKE_SYSTEM_PROCESSOR x86)
+SET(CMAKE_SYSTEM_PROCESSOR armv7)
SET(TOOLCHAIN QNX)
#SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".a")
@@ -67,22 +66,23 @@ SET(CMAKE_OBJDUMP "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-objdump
SET(CMAKE_LINKER "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ld" CACHE PATH "QNX Linker Program")
SET(CMAKE_STRIP "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-strip${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Strip Program")
-SET(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/qcc)
+SET(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/qcc${HOST_EXECUTABLE_SUFFIX})
SET(CMAKE_C_FLAGS_DEBUG "-g")
SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
-SET(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/qcc)
+SET(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/qcc${HOST_EXECUTABLE_SUFFIX})
SET(CMAKE_CXX_FLAGS_DEBUG "-g")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
SET(CMAKE_FIND_ROOT_PATH ${QNX_TARGET})
-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_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_C_FLAGS "-Vgcc_ntoarmv7le" CACHE STRING "qcc c flags" FORCE)
SET(CMAKE_CXX_FLAGS "-Vgcc_ntoarmv7le -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
diff --git a/cmake/Toolchain-QNX650-x86.cmake b/cmake/Toolchain-QNX650-x86.cmake
new file mode 100644
index 00000000..550abd47
--- /dev/null
+++ b/cmake/Toolchain-QNX650-x86.cmake
@@ -0,0 +1,88 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+SET(CMAKE_SYSTEM_NAME QNX)
+SET(CMAKE_SYSTEM_VERSION 6.5.0)
+SET(CMAKE_SYSTEM_PROCESSOR x86)
+SET(TOOLCHAIN QNX)
+
+#SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".a")
+
+SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
+SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
+SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+
+IF(CMAKE_HOST_WIN32)
+ SET(HOST_EXECUTABLE_SUFFIX ".exe")
+ENDIF(CMAKE_HOST_WIN32)
+
+FIND_PATH(QNX_HOST
+ NAME usr/bin/qcc${HOST_EXECUTABLE_SUFFIX}
+ PATHS $ENV{QNX_HOST} C:/QNX650/host/win32/x86
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+)
+
+FIND_PATH(QNX_TARGET
+ NAME usr/include/qnx_errno.h
+ PATHS $ENV{QNX_TARGET} C:/QNX650/target/qnx6
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+)
+
+IF(CMAKE_HOST_WIN32)
+ FIND_PATH(QNX_CONFIGURATION
+ NAME bin/qnxactivate.exe
+ PATHS $ENV{QNX_CONFIGURATION}
+ "C:/Program Files/QNX Software Systems/qconfig"
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ )
+ENDIF(CMAKE_HOST_WIN32)
+
+SET(ENV{QNX_HOST} ${QNX_HOST})
+SET(ENV{QNX_TARGET} ${QNX_TARGET})
+IF(CMAKE_HOST_WIN32)
+ SET(ENV{QNX_CONFIGURATION} ${QNX_CONFIGURATION})
+ SET(ENV{PATH} "$ENV{PATH};${QNX_HOST}/usr/bin")
+ENDIF(CMAKE_HOST_WIN32)
+
+SET(CMAKE_MAKE_PROGRAM "${QNX_HOST}/usr/bin/make${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Make Program")
+SET(CMAKE_SH "${QNX_HOST}/usr/bin/sh${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX shell Program")
+SET(CMAKE_AR "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ar${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX ar Program")
+SET(CMAKE_RANLIB "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ranlib${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX ranlib Program")
+SET(CMAKE_NM "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-nm${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX nm Program")
+SET(CMAKE_OBJCOPY "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-objcopy${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX objcopy Program")
+SET(CMAKE_OBJDUMP "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-objdump${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX objdump Program")
+SET(CMAKE_LINKER "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ld" CACHE PATH "QNX Linker Program")
+SET(CMAKE_STRIP "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-strip${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Strip Program")
+
+SET(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/qcc${HOST_EXECUTABLE_SUFFIX})
+SET(CMAKE_C_FLAGS_DEBUG "-g")
+SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
+SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
+SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
+
+SET(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/qcc${HOST_EXECUTABLE_SUFFIX})
+SET(CMAKE_CXX_FLAGS_DEBUG "-g")
+SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+
+SET(CMAKE_FIND_ROOT_PATH ${QNX_TARGET})
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET(CMAKE_C_FLAGS "-Vgcc_ntox86" CACHE STRING "qcc c flags" FORCE)
+SET(CMAKE_CXX_FLAGS "-Vgcc_ntox86 -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
diff --git a/cmake/Toolchain-QNX660-armv7.cmake b/cmake/Toolchain-QNX660-armv7.cmake
new file mode 100644
index 00000000..690448be
--- /dev/null
+++ b/cmake/Toolchain-QNX660-armv7.cmake
@@ -0,0 +1,21 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+set(QNX_VERSION 6.6.0)
+set(QNX_PROCESSOR armv7)
+
+set(QNX_HOST_HINT "C:/qnx660/host/win32/x86")
+set(QNX_TARGET_HINT "C:/qnx660/target/qnx6")
+
+set(CMAKE_C_FLAGS "-Vgcc_ntoarmv7le" CACHE STRING "qcc c flags" FORCE)
+set(CMAKE_CXX_FLAGS "-Vgcc_ntoarmv7le -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX660-common.cmake")
diff --git a/cmake/Toolchain-QNX660-common.cmake b/cmake/Toolchain-QNX660-common.cmake
new file mode 100644
index 00000000..2ef67777
--- /dev/null
+++ b/cmake/Toolchain-QNX660-common.cmake
@@ -0,0 +1,23 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX-common.cmake")
+
+# QNX 6.6.0 ships with a QCC 4.7.3 (based on the same GCC version)
+#
+# HACK: CMake does not support getting compile features from QCC
+# work-around by telling CMake the available compile features manually
+
+set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
+set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
+set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
diff --git a/cmake/Toolchain-QNX660-x86.cmake b/cmake/Toolchain-QNX660-x86.cmake
new file mode 100644
index 00000000..05385213
--- /dev/null
+++ b/cmake/Toolchain-QNX660-x86.cmake
@@ -0,0 +1,21 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+set(QNX_VERSION 6.6.0)
+set(QNX_PROCESSOR x86)
+
+set(QNX_HOST_HINT "C:/qnx660/host/win32/x86")
+set(QNX_TARGET_HINT "C:/qnx660/target/qnx6")
+
+set(CMAKE_C_FLAGS "-Vgcc_ntox86" CACHE STRING "qcc c flags" FORCE)
+set(CMAKE_CXX_FLAGS "-Vgcc_ntox86 -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX660-common.cmake")
diff --git a/cmake/Toolchain-QNX700-aarch64.cmake b/cmake/Toolchain-QNX700-aarch64.cmake
new file mode 100644
index 00000000..26137535
--- /dev/null
+++ b/cmake/Toolchain-QNX700-aarch64.cmake
@@ -0,0 +1,22 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-FileCopyrightText: 2018-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+set(QNX_VERSION 7.0.0)
+set(QNX_PROCESSOR aarch64)
+
+set(QNX_HOST_HINT "C:/qnx700/host/win32/x86")
+set(QNX_TARGET_HINT "C:/qnx700/target/qnx6")
+
+set(CMAKE_C_FLAGS "-Vgcc_ntoaarch64le" CACHE STRING "qcc c flags" FORCE)
+set(CMAKE_CXX_FLAGS "-Vgcc_ntoaarch64le -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX700-common.cmake")
diff --git a/cmake/Toolchain-QNX700-armv7.cmake b/cmake/Toolchain-QNX700-armv7.cmake
new file mode 100644
index 00000000..37557f03
--- /dev/null
+++ b/cmake/Toolchain-QNX700-armv7.cmake
@@ -0,0 +1,22 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-FileCopyrightText: 2018-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+set(QNX_VERSION 7.0.0)
+set(QNX_PROCESSOR armv7)
+
+set(QNX_HOST_HINT "C:/qnx700/host/win32/x86")
+set(QNX_TARGET_HINT "C:/qnx700/target/qnx6")
+
+set(CMAKE_C_FLAGS "-Vgcc_ntoarmv7le" CACHE STRING "qcc c flags" FORCE)
+set(CMAKE_CXX_FLAGS "-Vgcc_ntoarmv7le -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX700-common.cmake")
diff --git a/cmake/Toolchain-QNX700-common.cmake b/cmake/Toolchain-QNX700-common.cmake
new file mode 100644
index 00000000..a94f7655
--- /dev/null
+++ b/cmake/Toolchain-QNX700-common.cmake
@@ -0,0 +1,27 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-FileCopyrightText: 2018-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX-common.cmake")
+
+# QNX 7.0.0 ships with a QCC 5.4.0 (based on the same GCC version)
+#
+# HACK: CMake does not support getting compile features from QCC
+# work-around by telling CMake the available compile features manually
+
+# Easy to figure out by forcing GCC onto CMake, e.g. via -DCMAKE_CXX_COMPILER=/opt/qnx700/host/linux/x86_64/usr/bin/arm-unknown-nto-qnx7.0.0eabi-gcc
+# Then read out ./CMakeFiles/*/CMakeCXXCompiler.cmake
+
+set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17")
+set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
+set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
+set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
+set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
diff --git a/cmake/Toolchain-QNX700-x86.cmake b/cmake/Toolchain-QNX700-x86.cmake
new file mode 100644
index 00000000..c674da95
--- /dev/null
+++ b/cmake/Toolchain-QNX700-x86.cmake
@@ -0,0 +1,22 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-FileCopyrightText: 2018-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+set(QNX_VERSION 7.0.0)
+set(QNX_PROCESSOR x86)
+
+set(QNX_HOST_HINT "C:/qnx700/host/win32/x86")
+set(QNX_TARGET_HINT "C:/qnx700/target/qnx6")
+
+set(CMAKE_C_FLAGS "-Vgcc_ntox86" CACHE STRING "qcc c flags" FORCE)
+set(CMAKE_CXX_FLAGS "-Vgcc_ntox86 -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX700-common.cmake")
diff --git a/cmake/Toolchain-QNX700-x86_64.cmake b/cmake/Toolchain-QNX700-x86_64.cmake
new file mode 100644
index 00000000..3b0e7bc6
--- /dev/null
+++ b/cmake/Toolchain-QNX700-x86_64.cmake
@@ -0,0 +1,22 @@
+#
+# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved.
+# SPDX-FileCopyrightText: 2018-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# SPDX-License-Identifier: LicenseRef-CISST
+
+# --- begin cisst license - do not edit ---
+#
+# This software is provided "as is" under an open source license, with no warranty.
+# The complete license can be found in LICENSES/LicenseRef-CISST.txt.
+#
+# --- end cisst license ---
+
+set(QNX_VERSION 7.0.0)
+set(QNX_PROCESSOR x86_64)
+
+set(QNX_HOST_HINT "C:/qnx700/host/win32/x86")
+set(QNX_TARGET_HINT "C:/qnx700/target/qnx6")
+
+set(CMAKE_C_FLAGS "-Vgcc_ntox86_64" CACHE STRING "qcc c flags" FORCE)
+set(CMAKE_CXX_FLAGS "-Vgcc_ntox86_64 -lang-c++" CACHE STRING "qcc cxx flags" FORCE)
+
+include("${CMAKE_CURRENT_LIST_DIR}/Toolchain-QNX700-common.cmake")
diff --git a/cmake/Toolchain-RPI.cmake b/cmake/Toolchain-RPI.cmake
index 923fe58e..5c94d6a6 100644
--- a/cmake/Toolchain-RPI.cmake
+++ b/cmake/Toolchain-RPI.cmake
@@ -2,33 +2,10 @@
# Assumptions: toolchain is in path, $SYSROOT points to the sysroot
#
-# Copyright (c) 2013-2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
-# All rights reserved.
-#
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Volker Krause <volker.krause@kdab.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# SPDX-License-Identifier: BSD-3-Clause
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv6l")
@@ -41,5 +18,6 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --sysroot=$ENV{SYSRO
set(CMAKE_FIND_ROOT_PATH "$ENV{SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/cmake/Toolchain-Yocto.cmake b/cmake/Toolchain-Yocto.cmake
new file mode 100644
index 00000000..bc09bd77
--- /dev/null
+++ b/cmake/Toolchain-Yocto.cmake
@@ -0,0 +1,30 @@
+# Basic cmake toolchain file for Qt for Yocto Environment
+# Assumptions: toolchain script is sourced
+#
+
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# Author: Christoph Sterz <christoph.sterz@kdab.com>
+
+# SPDX-License-Identifier: BSD-3-Clause
+
+set(CMAKE_SYSTEM_NAME "Linux")
+
+if(DEFINED ENV{ARCH})
+ #$ARCH is set through the yocto environment script, use this
+ set(CMAKE_SYSTEM_PROCESSOR "$ENV{ARCH}")
+elseif(DEFINED ENV{CC})
+ #No $ARCH found, trying to deduce processor from -march=<name> flag in CC
+ string(REGEX MATCH "-march=([^\ ]+)" DUMMY "$ENV{CC}")
+ set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_MATCH_1})
+else()
+ message(FATAL_ERROR "Could not find processor architecture (no ARCH or CC found in environment).")
+endif()
+
+set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS "$ENV{OE_QMAKE_PATH_HOST_BINS}")
+set(CMAKE_FIND_ROOT_PATH "$ENV{SDKTARGETSYSROOT}")
+set(CMAKE_SYSROOT "$ENV{SDKTARGETSYSROOT}")
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/cmake/Toolchain-blackberry-armv7le.cmake b/cmake/Toolchain-blackberry-armv7le.cmake
index 9ee9c36c..60cc1ed9 100644
--- a/cmake/Toolchain-blackberry-armv7le.cmake
+++ b/cmake/Toolchain-blackberry-armv7le.cmake
@@ -1,32 +1,9 @@
# Basic cmake toolchain file for BlackBerry 10
-# Copyright (c) 2013-2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
-# All rights reserved.
-#
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Rafael Roquetto <rafael.roquetto@kdab.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# SPDX-License-Identifier: BSD-3-Clause
# the name of the target operating system
set(CMAKE_SYSTEM_NAME QNX)
@@ -51,5 +28,6 @@ set(CMAKE_RANLIB "$ENV{QNX_HOST}/usr/bin/ntoarmv7-ranlib${HOST_EXECUTABLE_SUFFIX
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/cmake/Toolchain-iMX6.cmake b/cmake/Toolchain-iMX6.cmake
index d5da1d20..f27146c5 100644
--- a/cmake/Toolchain-iMX6.cmake
+++ b/cmake/Toolchain-iMX6.cmake
@@ -2,37 +2,15 @@
# Assumptions: toolchain is in path, $SYSROOT points to the sysroot
#
-# Copyright (c) 2013-2016 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
-# All rights reserved.
-#
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Volker Krause <volker.krause@kdab.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# SPDX-License-Identifier: BSD-3-Clause
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7-a")
set(CMAKE_C_COMPILER "arm-linux-gcc")
+set(CMAKE_CXX_COMPILER "arm-linux-g++")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=$ENV{SYSROOT} -march=armv7-a -mfpu=neon")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=$ENV{SYSROOT} -march=armv7-a -mfpu=neon")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=$ENV{SYSROOT}")
@@ -42,5 +20,6 @@ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --sysroot=$ENV{SYSRO
set(CMAKE_FIND_ROOT_PATH "$ENV{SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/cmake/Toolchain-iOS.cmake b/cmake/Toolchain-iOS.cmake
deleted file mode 100644
index 5bef083b..00000000
--- a/cmake/Toolchain-iOS.cmake
+++ /dev/null
@@ -1,130 +0,0 @@
-# This file is based off of the Platform/Darwin.cmake and Platform/UnixPaths.cmake
-# files which are included with CMake 2.8.4
-# It has been altered for iOS development
-
-# Options:
-#
-# IOS_PLATFORM = OS (default) or SIMULATOR
-# This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders
-# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch.
-# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
-#
-# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
-# By default this location is automatcially chosen based on the IOS_PLATFORM value above.
-# If set manually, it will override the default location and force the user of a particular Developer Platform
-#
-# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder
-# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
-# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.
-# If set manually, this will force the use of a specific SDK version
-
-# Standard settings
-set (CMAKE_SYSTEM_NAME Darwin)
-set (CMAKE_SYSTEM_VERSION 1 )
-set (UNIX True)
-set (APPLE True)
-set (IOS True)
-
-# Force the compilers to gcc for iOS
-include (CMakeForceCompiler)
-CMAKE_FORCE_C_COMPILER (gcc gcc)
-CMAKE_FORCE_CXX_COMPILER (g++ g++)
-
-# Skip the platform compiler checks for cross compiling
-set (CMAKE_CXX_COMPILER_WORKS TRUE)
-set (CMAKE_C_COMPILER_WORKS TRUE)
-
-# All iOS/Darwin specific settings - some may be redundant
-set (CMAKE_SHARED_LIBRARY_PREFIX "lib")
-set (CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
-set (CMAKE_SHARED_MODULE_PREFIX "lib")
-set (CMAKE_SHARED_MODULE_SUFFIX ".so")
-set (CMAKE_MODULE_EXISTS 1)
-set (CMAKE_DL_LIBS "")
-
-set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
-set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
-set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
-set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
-
-# Hidden visibility is required for cxx on iOS
-set (CMAKE_C_FLAGS "")
-set (CMAKE_CXX_FLAGS "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
-
-set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
-set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
-
-set (CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
-set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
-set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
-set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
-set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
-
-# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
-# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
-# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
-# hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex
-if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
- find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
-endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
-
-# Setup iOS platform
-if (NOT DEFINED IOS_PLATFORM)
- set (IOS_PLATFORM "OS")
-endif (NOT DEFINED IOS_PLATFORM)
-set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")
-
-# Check the platform selection and setup for developer root
-if (${IOS_PLATFORM} STREQUAL "OS")
- set (IOS_PLATFORM_LOCATION "iPhoneOS.platform")
-elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
- set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
-else (${IOS_PLATFORM} STREQUAL "OS")
- message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR")
-endif (${IOS_PLATFORM} STREQUAL "OS")
-
-# Setup iOS developer location
-if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
- set (CMAKE_IOS_DEVELOPER_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
-endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
-set (CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} CACHE PATH "Location of iOS Platform")
-
-# Find and use the most recent iOS sdk
-if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
- file (GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
- if (_CMAKE_IOS_SDKS)
- list (SORT _CMAKE_IOS_SDKS)
- list (REVERSE _CMAKE_IOS_SDKS)
- list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
- else (_CMAKE_IOS_SDKS)
- message (FATAL_ERROR "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
- endif (_CMAKE_IOS_SDKS)
- message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
-endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
-set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK")
-
-# Set the sysroot default to the most recent SDK
-set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")
-
-# set the architecture for iOS - using ARCHS_STANDARD_32_BIT sets armv6,armv7 and appears to be XCode's standard.
-# The other value that works is ARCHS_UNIVERSAL_IPHONE_OS but that sets armv7 only
-set (CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)" CACHE string "Build architecture for iOS")
-
-# Set the find root to the iOS developer roots and to user defined paths
-set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE string "iOS find search path root")
-
-# default to searching for frameworks first
-set (CMAKE_FIND_FRAMEWORK FIRST)
-
-# set up the default search directories for frameworks
-set (CMAKE_SYSTEM_FRAMEWORK_PATH
- ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
- ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
- ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
-)
-
-# only search the iOS sdks, not the remainder of the host filesystem
-set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
-set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/cmake/Toolchain-jetson-tk1.cmake b/cmake/Toolchain-jetson-tk1.cmake
index bfd08505..14c984b9 100644
--- a/cmake/Toolchain-jetson-tk1.cmake
+++ b/cmake/Toolchain-jetson-tk1.cmake
@@ -2,33 +2,10 @@
# Assumptions: toolchain is in path, $SYSROOT points to the sysroot
#
-# Copyright (c) 2013-2018 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
-# All rights reserved.
-#
+# SPDX-FileCopyrightText: 2013-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
# Author: Volker Krause <volker.krause@kdab.com>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# SPDX-License-Identifier: BSD-3-Clause
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7-a")
diff --git a/cmake/modules/FindBDB.cmake b/cmake/modules/FindBDB.cmake
index 8c9616eb..312901c0 100644
--- a/cmake/modules/FindBDB.cmake
+++ b/cmake/modules/FindBDB.cmake
@@ -1,3 +1,7 @@
+#
+# SPDX-FileCopyrightText: Allen Winter <winter@kde.org>
+# SPDX-License-Identifier: BSD-3-Clause
+#
# Finds the Berkeley DB Library
#
# BDB_FOUND - True if Berkeley DB found.
diff --git a/cmake/modules/FindBerkeleyDB.cmake b/cmake/modules/FindBerkeleyDB.cmake
index 0d83b4ef..63ffe9dc 100644
--- a/cmake/modules/FindBerkeleyDB.cmake
+++ b/cmake/modules/FindBerkeleyDB.cmake
@@ -1,137 +1,123 @@
-# Author: sum01 <sum01@protonmail.com>
-# Git: https://github.com/sum01/FindBerkeleyDB
-#
-# This is free and unencumbered software released into the public domain.
-#
-# Anyone is free to copy, modify, publish, use, compile, sell, or distribute
-# this software, either in source code form or as a compiled binary, for any
-# purpose, commercial or non-commercial, and by any means.
-#
-# In jurisdictions that recognize copyright laws, the author or authors of this
-# software dedicate any and all copyright interest in the software to the public
-# domain. We make this dedication for the benefit of the public at large and to
-# the detriment of our heirs and successors. We intend this dedication to be an
-# overt act of relinquishment in perpetuity of all present and future rights to
-# this software under copyright law.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# For more information, please refer to <http://unlicense.org>
-#
+# SPDX-FileCopyrightText: sum01 <sum01@protonmail.com>
+# SPDX-License-Identifier: Unlicense
+
+# Git: https://github.com/sum01/FindBerkeleyDB
# NOTE: If Berkeley DB ever gets a Pkg-config ".pc" file, add pkg_check_modules() here
# Checks if environment paths are empty, set them if they aren't
-if(NOT "$ENV{BERKELEYDB_ROOT}" STREQUAL "")
- set(_BERKELEYDB_PATHS "$ENV{BERKELEYDB_ROOT}")
-elseif(NOT "$ENV{Berkeleydb_ROOT}" STREQUAL "")
- set(_BERKELEYDB_PATHS "$ENV{Berkeleydb_ROOT}")
-elseif(NOT "$ENV{BERKELEYDBROOT}" STREQUAL "")
- set(_BERKELEYDB_PATHS "$ENV{BERKELEYDBROOT}")
-else()
- # Set just in case, as it's used regardless if it's empty or not
- set(_BERKELEYDB_PATHS "")
+set(_BERKELEYDB_PATHS "")
+if(NOT _BERKELEYDB_PATHS AND DEFINED BERKELEYDB_ROOT)
+ if($ENV{BERKELEYDB_ROOT} AND NOT "$ENV{BERKELEYDB_ROOT}" STREQUAL "")
+ set(_BERKELEYDB_PATHS "$ENV{BERKELEYDB_ROOT}")
+ endif()
+endif()
+if(NOT _BERKELEYDB_PATHS AND DEFINED Berkeleydb_ROOT)
+ if($ENV{Berkeleydb_ROOT} AND NOT "$ENV{Berkeleydb_ROOT}" STREQUAL "")
+ set(_BERKELEYDB_PATHS "$ENV{Berkeleydb_ROOT}")
+ endif()
+endif()
+if(NOT _BERKELEYDB_PATHS AND DEFINED BERKELEYDBROOT)
+ if($ENV{BERKELEYDBROOT} AND NOT "$ENV{BERKELEYDBROOT}" STREQUAL "")
+ set(_BERKELEYDB_PATHS "$ENV{BERKELEYDBROOT}")
+ endif()
endif()
# Allow user to pass a path instead of guessing
if(BerkeleyDB_ROOT_DIR)
- set(_BERKELEYDB_PATHS "${BerkeleyDB_ROOT_DIR}")
+ set(_BERKELEYDB_PATHS "${BerkeleyDB_ROOT_DIR}")
elseif(CMAKE_SYSTEM_NAME MATCHES ".*[wW]indows.*")
- # MATCHES is used to work on any devies with windows in the name
- # Shameless copy-paste from FindOpenSSL.cmake v3.8
- file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
- list(APPEND _BERKELEYDB_PATHS "${_programfiles}")
-
- # There's actually production release and version numbers in the file path.
- # For example, if they're on v6.2.32: C:/Program Files/Oracle/Berkeley DB 12cR1 6.2.32/
- # But this still works to find it, so I'm guessing it can accept partial path matches.
-
- foreach(_TARGET_BERKELEYDB_PATH "Oracle/Berkeley DB" "Berkeley DB")
- list(APPEND _BERKELEYDB_PATHS
- "${_programfiles}/${_TARGET_BERKELEYDB_PATH}"
- "C:/Program Files (x86)/${_TARGET_BERKELEYDB_PATH}"
- "C:/Program Files/${_TARGET_BERKELEYDB_PATH}"
- "C:/${_TARGET_BERKELEYDB_PATH}"
- )
- endforeach()
+ # MATCHES is used to work on any devies with windows in the name
+ # Shameless copy-paste from FindOpenSSL.cmake v3.8
+ file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
+ list(APPEND _BERKELEYDB_PATHS "${_programfiles}")
+
+ # There's actually production release and version numbers in the file path.
+ # For example, if they're on v6.2.32: C:/Program Files/Oracle/Berkeley DB 12cR1 6.2.32/
+ # But this still works to find it, so I'm guessing it can accept partial path matches.
+
+ foreach(_target_berkeleydb_path "Oracle/Berkeley DB" "Berkeley DB")
+ list(APPEND _BERKELEYDB_PATHS
+ "${_programfiles}/${_target_berkeleydb_path}"
+ "C:/Program Files (x86)/${_target_berkeleydb_path}"
+ "C:/Program Files/${_target_berkeleydb_path}"
+ "C:/${_target_berkeleydb_path}"
+ )
+ endforeach()
else()
- # Paths for anything other than Windows
- # Cellar/berkeley-db is for macOS from homebrew installation
- list(APPEND _BERKELEYDB_PATHS
- "/usr"
- "/usr/local"
- "/usr/local/Cellar/berkeley-db"
- "/opt"
- "/opt/local"
- )
+ # Paths for anything other than Windows
+ # Cellar/berkeley-db is for macOS from homebrew installation
+ list(APPEND _BERKELEYDB_PATHS
+ "/usr"
+ "/usr/local"
+ "/usr/local/Cellar/berkeley-db"
+ "/opt"
+ "/opt/local"
+ )
endif()
# Find includes path
find_path(BerkeleyDB_INCLUDE_DIRS
- NAMES "db.h"
- HINTS ${_BERKELEYDB_PATHS}
- PATH_SUFFIXES "include" "includes"
+ NAMES "db.h"
+ HINTS ${_BERKELEYDB_PATHS}
+ PATH_SUFFIXES "include" "includes"
)
# Checks if the version file exists, save the version file to a var, and fail if there's no version file
if(BerkeleyDB_INCLUDE_DIRS)
- # Read the version file db.h into a variable
- file(READ "${BerkeleyDB_INCLUDE_DIRS}/db.h" _BERKELEYDB_DB_HEADER)
- # Parse the DB version into variables to be used in the lib names
- string(REGEX REPLACE ".*DB_VERSION_MAJOR ([0-9]+).*" "\\1" BerkeleyDB_VERSION_MAJOR "${_BERKELEYDB_DB_HEADER}")
- string(REGEX REPLACE ".*DB_VERSION_MINOR ([0-9]+).*" "\\1" BerkeleyDB_VERSION_MINOR "${_BERKELEYDB_DB_HEADER}")
- # Patch version example on non-crypto installs: x.x.xNC
- string(REGEX REPLACE ".*DB_VERSION_PATCH ([0-9]+(NC)?).*" "\\1" BerkeleyDB_VERSION_PATCH "${_BERKELEYDB_DB_HEADER}")
+ # Read the version file db.h into a variable
+ file(READ "${BerkeleyDB_INCLUDE_DIRS}/db.h" _BERKELEYDB_DB_HEADER)
+ # Parse the DB version into variables to be used in the lib names
+ string(REGEX REPLACE ".*DB_VERSION_MAJOR ([0-9]+).*" "\\1" BerkeleyDB_VERSION_MAJOR "${_BERKELEYDB_DB_HEADER}")
+ string(REGEX REPLACE ".*DB_VERSION_MINOR ([0-9]+).*" "\\1" BerkeleyDB_VERSION_MINOR "${_BERKELEYDB_DB_HEADER}")
+ # Patch version example on non-crypto installs: x.x.xNC
+ string(REGEX REPLACE ".*DB_VERSION_PATCH ([0-9]+(NC)?).*" "\\1" BerkeleyDB_VERSION_PATCH "${_BERKELEYDB_DB_HEADER}")
else()
- if(BerkeleyDB_FIND_REQUIRED)
- # If the find_package(BerkeleyDB REQUIRED) was used, fail since we couldn't find the header
- message(FATAL_ERROR "Failed to find Berkeley DB's header file \"db.h\"! Try setting \"BerkeleyDB_ROOT_DIR\" when initiating Cmake.")
- #elseif(NOT BerkeleyDB_FIND_QUIETLY)
- # message(WARNING "Failed to find Berkeley DB's header file \"db.h\"! Try setting \"BerkeleyDB_ROOT_DIR\" when initiating Cmake.")
- endif()
- # Set some garbage values to the versions since we didn't find a file to read
- set(BerkeleyDB_VERSION_MAJOR "0")
- set(BerkeleyDB_VERSION_MINOR "0")
- set(BerkeleyDB_VERSION_PATCH "0")
+ if(BerkeleyDB_FIND_REQUIRED)
+ # If the find_package(BerkeleyDB REQUIRED) was used, fail since we couldn't find the header
+ message(FATAL_ERROR
+ "Failed to find Berkeley DB's header file \"db.h\"! Try setting \"BerkeleyDB_ROOT_DIR\" when initiating Cmake.")
+ endif()
+ # Set some garbage values to the versions since we didn't find a file to read
+ set(BerkeleyDB_VERSION_MAJOR "0")
+ set(BerkeleyDB_VERSION_MINOR "0")
+ set(BerkeleyDB_VERSION_PATCH "0")
endif()
# The actual returned/output version variable (the others can be used if needed)
set(BerkeleyDB_VERSION "${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}.${BerkeleyDB_VERSION_PATCH}")
+set(BerkeleyDB_LIBRARIES "")
# Finds the target library for berkeley db, since they all follow the same naming conventions
-macro(findpackage_berkeleydb_get_lib _BERKELEYDB_OUTPUT_VARNAME _TARGET_BERKELEYDB_LIB)
- # Different systems sometimes have a version in the lib name...
- # and some have a dash or underscore before the versions.
- # CMake recommends to put unversioned names before versioned names
- find_library(${_BERKELEYDB_OUTPUT_VARNAME}
- NAMES
- "${_TARGET_BERKELEYDB_LIB}"
- "lib${_TARGET_BERKELEYDB_LIB}"
- "lib${_TARGET_BERKELEYDB_LIB}${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}"
- "lib${_TARGET_BERKELEYDB_LIB}-${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}"
- "lib${_TARGET_BERKELEYDB_LIB}_${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}"
- "lib${_TARGET_BERKELEYDB_LIB}${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}"
- "lib${_TARGET_BERKELEYDB_LIB}-${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}"
- "lib${_TARGET_BERKELEYDB_LIB}_${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}"
- "lib${_TARGET_BERKELEYDB_LIB}${BerkeleyDB_VERSION_MAJOR}"
- "lib${_TARGET_BERKELEYDB_LIB}-${BerkeleyDB_VERSION_MAJOR}"
- "lib${_TARGET_BERKELEYDB_LIB}_${BerkeleyDB_VERSION_MAJOR}"
- HINTS ${_BERKELEYDB_PATHS}
- PATH_SUFFIXES "lib" "lib64" "libs" "libs64"
- )
- # If the library was found, add it to our list of libraries
- if(${_BERKELEYDB_OUTPUT_VARNAME})
- # If found, append to our libraries variable
- # The ${{}} is because the first expands to target the real variable, the second expands the variable's contents...
- # and the real variable's contents is the path to the lib. Thus, it appends the path of the lib to BerkeleyDB_LIBRARIES.
- list(APPEND BerkeleyDB_LIBRARIES "${${_BERKELEYDB_OUTPUT_VARNAME}}")
- endif()
+macro(findpackage_berkeleydb_get_lib _berkeleydb_output_varname _target_berkeleydb_lib)
+ # Different systems sometimes have a version in the lib name...
+ # and some have a dash or underscore before the versions.
+ # CMake recommends to put unversioned names before versioned names
+ find_library(${_berkeleydb_output_varname}
+ NAMES
+ "${_target_berkeleydb_lib}"
+ "lib${_target_berkeleydb_lib}"
+ "lib${_target_berkeleydb_lib}${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}"
+ "lib${_target_berkeleydb_lib}-${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}"
+ "lib${_target_berkeleydb_lib}_${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}"
+ "lib${_target_berkeleydb_lib}${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}"
+ "lib${_target_berkeleydb_lib}-${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}"
+ "lib${_target_berkeleydb_lib}_${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}"
+ "lib${_target_berkeleydb_lib}${BerkeleyDB_VERSION_MAJOR}"
+ "lib${_target_berkeleydb_lib}-${BerkeleyDB_VERSION_MAJOR}"
+ "lib${_target_berkeleydb_lib}_${BerkeleyDB_VERSION_MAJOR}"
+ HINTS ${_BERKELEYDB_PATHS}
+ PATH_SUFFIXES "lib" "lib64" "libs" "libs64"
+ )
+ # If the library was found, add it to our list of libraries
+ if(${_berkeleydb_output_varname})
+ # If found, append to our libraries variable
+ # The ${{}} is because the first expands to target the real variable, the second expands
+ # the variable's contents... and the real variable's contents is the path to the lib. Thus,
+ # it appends the path of the lib to BerkeleyDB_LIBRARIES.
+ list(APPEND BerkeleyDB_LIBRARIES "${${_berkeleydb_output_varname}}")
+ endif()
endmacro()
# Find and set the paths of the specific library to the variable
@@ -146,37 +132,37 @@ findpackage_berkeleydb_get_lib(BerkeleyDB_Stl_LIBRARY "db_stl")
include(FindPackageHandleStandardArgs)
# Fails if required vars aren't found, or if the version doesn't meet specifications.
find_package_handle_standard_args(BerkeleyDB
- FOUND_VAR BerkeleyDB_FOUND
- REQUIRED_VARS
- BerkeleyDB_INCLUDE_DIRS
- BerkeleyDB_LIBRARY
- VERSION_VAR BerkeleyDB_VERSION
+ FOUND_VAR BerkeleyDB_FOUND
+ REQUIRED_VARS
+ BerkeleyDB_INCLUDE_DIRS
+ BerkeleyDB_LIBRARY
+ VERSION_VAR BerkeleyDB_VERSION
)
# Create an imported lib for easy linking by external projects
if(BerkeleyDB_FOUND AND BerkeleyDB_LIBRARIES AND NOT TARGET Oracle::BerkeleyDB)
- add_library(Oracle::BerkeleyDB UNKNOWN IMPORTED)
- set_target_properties(Oracle::BerkeleyDB PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${BerkeleyDB_INCLUDE_DIRS}"
- IMPORTED_LOCATION "${BerkeleyDB_LIBRARY}"
- INTERFACE_LINK_LIBRARIES "${BerkeleyDB_LIBRARIES}"
- )
+ add_library(Oracle::BerkeleyDB UNKNOWN IMPORTED)
+ set_target_properties(Oracle::BerkeleyDB PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${BerkeleyDB_INCLUDE_DIRS}"
+ IMPORTED_LOCATION "${BerkeleyDB_LIBRARY}"
+ INTERFACE_LINK_LIBRARIES "${BerkeleyDB_LIBRARIES}"
+ )
endif()
# Only show the includes path and libraries in the GUI if they click "advanced".
# Does nothing when using the CLI
mark_as_advanced(FORCE
- BerkeleyDB_INCLUDE_DIRS
- BerkeleyDB_LIBRARIES
- BerkeleyDB_LIBRARY
- BerkeleyDB_Cxx_LIBRARY
- BerkeleyDB_Sql_LIBRARY
- BerkeleyDB_Stl_LIBRARY
+ BerkeleyDB_INCLUDE_DIRS
+ BerkeleyDB_LIBRARIES
+ BerkeleyDB_LIBRARY
+ BerkeleyDB_Cxx_LIBRARY
+ BerkeleyDB_Sql_LIBRARY
+ BerkeleyDB_Stl_LIBRARY
)
include(FindPackageMessage)
# A message that tells the user what includes/libs were found, and obeys the QUIET command.
find_package_message(BerkeleyDB
- "Found BerkeleyDB libraries: ${BerkeleyDB_LIBRARIES}"
- "[${BerkeleyDB_LIBRARIES}[${BerkeleyDB_INCLUDE_DIRS}]]"
+ "Found BerkeleyDB libraries: ${BerkeleyDB_LIBRARIES}"
+ "[${BerkeleyDB_LIBRARIES}[${BerkeleyDB_INCLUDE_DIRS}]]"
)
diff --git a/cmake/modules/FindGLib.cmake b/cmake/modules/FindGLib.cmake
index 1092dc14..9dabe310 100644
--- a/cmake/modules/FindGLib.cmake
+++ b/cmake/modules/FindGLib.cmake
@@ -1,5 +1,8 @@
-# - try to find glib
#
+# SPDX-FileCopyrightText: Milan Crha <mcrha@redhat.com>
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# - try to find glib
# Once done this will define
#
# GLIB_FOUND - system has GLib 2.0
diff --git a/cmake/modules/FindGObjectIntrospection.cmake b/cmake/modules/FindGObjectIntrospection.cmake
index 02841f4f..2eb289a9 100644
--- a/cmake/modules/FindGObjectIntrospection.cmake
+++ b/cmake/modules/FindGObjectIntrospection.cmake
@@ -11,11 +11,11 @@
# GObjectIntrospection_CFLAGS
# GObjectIntrospection_LIBS
#
-# Copyright (C) 2010, Pino Toscano, <pino@kde.org>
+# SPDX-FileCopyrightText: 2010, Pino Toscano, <pino@kde.org>
+# SPDX-License-Identifier: BSD-3-Clause
#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# Get gobject-introspection's specified pkg-config variable
macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0
@@ -27,7 +27,7 @@ macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname)
else()
string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
string(REGEX REPLACE " +$" "" _result "${_result}")
- separate_arguments(_result)
+ separate_arguments(_result UNIX_COMMAND ${_result})
set(${_outvar} ${_result} CACHE INTERNAL "")
endif()
endmacro(_GIR_GET_PKGCONFIG_VAR)
diff --git a/cmake/modules/FindLibXML.cmake b/cmake/modules/FindLibXML.cmake
index 3c418b67..891a8004 100644
--- a/cmake/modules/FindLibXML.cmake
+++ b/cmake/modules/FindLibXML.cmake
@@ -1,5 +1,8 @@
-# - try to find libxml
#
+# SPDX-FileCopyrightText: Milan Crha <mcrha@redhat.com>
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# - try to find libxml
# Once done this will define
#
# LIBXML_FOUND - system has libxml 2.0
diff --git a/cmake/modules/FindWcecompat.cmake b/cmake/modules/FindWcecompat.cmake
index 4af53aa5..c054dc4d 100644
--- a/cmake/modules/FindWcecompat.cmake
+++ b/cmake/modules/FindWcecompat.cmake
@@ -5,9 +5,11 @@
# WCECOMPAT_INCLUDE_DIR - Wcecompat include directory
# WCECOMPAT_LIBRARIES - Libraries needed to use Wcecompat
#
-# Copyright (c) 2010, Andreas Holzammer, <andy@kdab.com>
+# SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
+# Author: Andreas Holzammer, <andy@kdab.com>
+#
+# SPDX-License-Identifier: BSD-3-Clause
#
-# Redistribution and use is allowed according to the terms of the BSD license.
if(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND)
set(Wcecompat_FIND_QUIETLY TRUE)
diff --git a/cmake/modules/GObjectIntrospectionMacros.cmake b/cmake/modules/GObjectIntrospectionMacros.cmake
index 83aff931..3af08ee8 100644
--- a/cmake/modules/GObjectIntrospectionMacros.cmake
+++ b/cmake/modules/GObjectIntrospectionMacros.cmake
@@ -1,8 +1,7 @@
-# Copyright (C) 2010, Pino Toscano, <pino at kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# SPDX-FileCopyrightText: 2010, Pino Toscano, <pino at kde.org>
+# SPDX-License-Identifier: BSD-3-Clause
+# Generate list from another list, but with each item prepended with a prefix
macro(_gir_list_prefix _outvar _listvar _prefix)
set(${_outvar})
foreach(_item IN LISTS ${_listvar})
@@ -10,13 +9,12 @@ macro(_gir_list_prefix _outvar _listvar _prefix)
endforeach()
endmacro(_gir_list_prefix)
+# cmake-lint: disable=R0915
macro(gir_add_introspections introspections_girs)
-
set(_gir_girs)
set(_gir_typelibs)
foreach(gir IN LISTS ${introspections_girs})
-
set(_gir_name "${gir}")
## Transform the gir filename to something which can reference through a variable
@@ -26,20 +24,44 @@ macro(gir_add_introspections introspections_girs)
# Namespace and Version is either fetched from the gir filename
# or the _NAMESPACE/_VERSION variable combo
- set(_gir_namespace "${${_gir_name}_NAMESPACE}")
+ set(_gir_namespace "")
+ if(DEFINED ${_gir_name}_NAMESPACE)
+ set(_gir_namespace "${${_gir_name}_NAMESPACE}")
+ endif()
if (_gir_namespace STREQUAL "")
string(REGEX REPLACE "([^-]+)-.*" "\\1" _gir_namespace "${gir}")
endif ()
- set(_gir_version "${${_gir_name}_VERSION}")
+
+ set(_gir_version "")
+ if(DEFINED ${_gir_name}_VERSION)
+ set(_gir_version "${${_gir_name}_VERSION}")
+ endif()
if (_gir_version STREQUAL "")
string(REGEX REPLACE ".*-([^-]+).gir" "\\1" _gir_version "${gir}")
endif ()
# _PROGRAM is an optional variable which needs its own --program argument
- set(_gir_program "${${_gir_name}_PROGRAM}")
+ set(_gir_program "")
+ if(DEFINED ${_gir_name}_PROGRAM)
+ set(_gir_program "${${_gir_name}_PROGRAM}")
+ endif()
if (NOT _gir_program STREQUAL "")
set(_gir_program "--program=${_gir_program}")
- endif ()
+ endif()
+
+ # _SCANNERFLAGS is optional
+ set(_gir_scannerflags "")
+ if(DEFINED ${_gir_name}_SCANNERFLAGS)
+ set(_gir_scannerflags "${${_gir_name}_SCANNERFLAGS}")
+ endif()
+
+ # _FILES
+ set(_gir_files "")
+ if(DEFINED ${_gir_name}_FILES)
+ set(_gir_files "${${_gir_name}_FILES}")
+ else()
+ message(ERROR "Unspecified or empty ${_gir_name}_FILES variable")
+ endif()
# Variables which provides a list of things
_gir_list_prefix(_gir_libraries ${_gir_name}_LIBS "--library=")
@@ -50,47 +72,54 @@ macro(gir_add_introspections introspections_girs)
set(_gir_libtool "--no-libtool")
add_custom_command(
- COMMAND ${CMAKE_COMMAND} -E env "CC='${CMAKE_C_COMPILER}'"
- ${GObjectIntrospection_SCANNER}
- ${GObjectIntrospection_SCANNER_ARGS}
- --namespace=${_gir_namespace}
- --nsversion=${_gir_version}
- ${_gir_libtool}
- ${_gir_program}
- ${_gir_libraries}
- ${_gir_packages}
- ${_gir_includes}
- ${${_gir_name}_SCANNERFLAGS}
- ${${_gir_name}_CFLAGS}
- ${${_gir_name}_FILES}
- --output ${CMAKE_CURRENT_BINARY_DIR}/${gir}
- --accept-unprefixed
- DEPENDS ${${_gir_name}_FILES}
- ${${_gir_name}_LIBS}
OUTPUT ${gir}
+ COMMAND ${GObjectIntrospection_SCANNER}
+ ${GObjectIntrospection_SCANNER_ARGS}
+ --namespace=${_gir_namespace}
+ --nsversion=${_gir_version}
+ ${_gir_libtool}
+ ${_gir_program}
+ ${_gir_libraries}
+ ${_gir_packages}
+ ${_gir_includes}
+ ${_gir_scannerflags}
+ ${${_gir_name}_CFLAGS}
+ ${_gir_files}
+ --output ${CMAKE_CURRENT_BINARY_DIR}/${gir}
+ --accept-unprefixed
+ DEPENDS ${_gir_files} ${${_gir_name}_LIBS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
+ COMMENT "Run the gobject introspection scanner"
)
list(APPEND _gir_girs ${CMAKE_CURRENT_BINARY_DIR}/${gir})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${gir} DESTINATION ${SHARE_INSTALL_DIR}/gir-1.0)
string(REPLACE ".gir" ".typelib" _typelib "${gir}")
add_custom_command(
+ OUTPUT ${_typelib}
COMMAND ${GObjectIntrospection_COMPILER}
- ${GObjectIntrospection_COMPILER_ARGS}
- --includedir=.
- ${CMAKE_CURRENT_BINARY_DIR}/${gir}
- -o ${CMAKE_CURRENT_BINARY_DIR}/${_typelib}
+ --includedir=.
+ ${CMAKE_CURRENT_BINARY_DIR}/${gir}
+ -o ${CMAKE_CURRENT_BINARY_DIR}/${_typelib}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${gir}
- OUTPUT ${_typelib}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Run the gobject introspection compiler"
)
list(APPEND _gir_typelibs ${CMAKE_CURRENT_BINARY_DIR}/${_typelib})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} DESTINATION ${LIB_INSTALL_DIR}/girepository-1.0)
endforeach()
- add_custom_target(gir-girs-${_gir_name} ALL DEPENDS ${_gir_girs})
- add_custom_target(gir-typelibs-${_gir_name} ALL DEPENDS ${_gir_typelibs})
+ add_custom_target(gir-girs-${_gir_name}
+ ALL
+ DEPENDS ${_gir_girs}
+ COMMENT "Target for the gobject introspection compiler"
+ )
+ add_custom_target(gir-typelibs-${_gir_name}
+ ALL
+ DEPENDS ${_gir_typelibs}
+ COMMENT "Target for the gobject introspection typelibs"
+ )
endmacro(gir_add_introspections)
diff --git a/cmake/modules/GtkDoc.cmake b/cmake/modules/GtkDoc.cmake
index 8a787841..c7d88546 100644
--- a/cmake/modules/GtkDoc.cmake
+++ b/cmake/modules/GtkDoc.cmake
@@ -1,5 +1,8 @@
# GtkDoc.cmake
#
+# SPDX-FileCopyrightText: Milan Crha <mcrha@redhat.com>
+# SPDX-License-Identifier: BSD-3-Clause
+#
# Macros to support developer documentation build from sources with gtk-doc.
#
# Note that every target and dependency should be defined before the macro is
@@ -30,13 +33,14 @@ if(NOT (GTKDOC_SCAN AND GTKDOC_MKDB AND GTKDOC_MKHTML AND GTKDOC_FIXXREF))
endif()
if(NOT TARGET gtkdocs)
- add_custom_target(gtkdocs ALL)
+ add_custom_target(gtkdocs ALL COMMENT "Target to run gtkdoc for all modules")
endif()
if(NOT TARGET gtkdoc-rebuild-sgmls)
- add_custom_target(gtkdoc-rebuild-sgmls)
+ add_custom_target(gtkdoc-rebuild-sgmls COMMENT "Target to rebuild sgml for all modules")
endif()
+# cmake-lint: disable=R0912,R0915
macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ignoreheadersvar)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in
@@ -55,7 +59,10 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
if(APPLE)
if(NOT DEFINED ENV{XML_CATALOG_FILES})
- message(FATAL_ERROR "On OSX, please run \'export XML_CATALOG_FILES=/usr/local/etc/xml/catalog\' first; else the gtk entities cannot be located.")
+ message(FATAL_ERROR
+ "On OSX, please run \'export XML_CATALOG_FILES=/usr/local/etc/xml/catalog\' first; "
+ "else the gtk entities cannot be located."
+ )
endif()
endif()
@@ -69,7 +76,9 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
if(TARGET ${opt})
set(_target_type)
get_target_property(_target_type ${opt} TYPE)
- if((_target_type STREQUAL "STATIC_LIBRARY") OR (_target_type STREQUAL "SHARED_LIBRARY") OR (_target_type STREQUAL "MODULE_LIBRARY"))
+ if((_target_type STREQUAL "STATIC_LIBRARY") OR
+ (_target_type STREQUAL "SHARED_LIBRARY") OR
+ (_target_type STREQUAL "MODULE_LIBRARY"))
set(_compile_options)
set(_link_libraries)
@@ -107,7 +116,9 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
if(TARGET ${opt})
set(_target_type)
get_target_property(_target_type ${opt} TYPE)
- if((_target_type STREQUAL "STATIC_LIBRARY") OR (_target_type STREQUAL "SHARED_LIBRARY") OR (_target_type STREQUAL "MODULE_LIBRARY"))
+ if((_target_type STREQUAL "STATIC_LIBRARY") OR
+ (_target_type STREQUAL "SHARED_LIBRARY") OR
+ (_target_type STREQUAL "MODULE_LIBRARY"))
set(_output_name "")
get_target_property(_output_name ${opt} OUTPUT_NAME)
if(NOT _output_name)
@@ -136,7 +147,18 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
# Add it as the last, thus in-tree libs have precedence
set(_scangobj_ldflags "${_scangobj_ldflags} -L${LIB_INSTALL_DIR}")
- set(_scangobj_prefix ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH="${_scangobj_ld_lib_dirs}:${LIB_INSTALL_DIR}:$ENV{LD_LIBRARY_PATH}")
+ if(APPLE)
+ set(ld_lib_path "DYLD_LIBRARY_PATH=${_scangobj_ld_lib_dirs}:${LIB_INSTALL_DIR}")
+ if(DEFINED DYLD_LIBRARY_PATH)
+ set(ld_lib_path "${ld_lib_path}:$ENV{DYLD_LIBRARY_PATH}")
+ endif()
+ elseif(NOT WIN32 AND NOT WINCE) #ie. unix-like
+ set(ld_lib_path "LD_LIBRARY_PATH=${_scangobj_ld_lib_dirs}:${LIB_INSTALL_DIR}")
+ if(DEFINED LD_LIBRARY_PATH)
+ set(ld_lib_path "${ld_lib_path}:$ENV{LD_LIBRARY_PATH}")
+ endif()
+ endif()
+ set(_scangobj_prefix ${CMAKE_COMMAND} -E env "${ld_lib_path}")
# if(NOT (_scangobj_cflags STREQUAL ""))
# set(_scangobj_cflags --cflags "${_scangobj_cflags}")
@@ -170,7 +192,11 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/html"
- COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/html" ${GTKDOC_MKHTML} --path=.. ${_module} ../${_module}-docs.sgml
+ COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/html"
+ ${GTKDOC_MKHTML}
+ --path=..
+ ${_module}
+ ../${_module}-docs.sgml
COMMAND ${GTKDOC_FIXXREF}
--module=${_module}
@@ -186,6 +212,7 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
add_custom_target(gtkdoc-${_module}
DEPENDS html/index.html
+ COMMENT "Target for running gtkdoc for module"
)
if(${_depsvar})
@@ -210,12 +237,14 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
${GTKDOC_SCAN}
--module=${_module}
--deprecated-guards="${_deprecated_guards}"
- --ignore-headers="${_ignore_headers}"
+ --ignore-headers="${${_ignoreheadersvar}}"
--rebuild-sections
--rebuild-types
${_srcdirs}
- COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}" ${_scangobj_prefix} ${GTKDOC_SCANGOBJ}
+ COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}"
+ ${_scangobj_prefix}
+ ${GTKDOC_SCANGOBJ}
--module=${_module}
${_scangobj_cflags}
${_scangobj_ldflags}
@@ -229,9 +258,14 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
--output-format=xml
${_srcdirs}
- COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/tmp/${_module}-docs.sgml ${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in
+ COMMAND ${CMAKE_COMMAND} -E rename
+ ${CMAKE_CURRENT_BINARY_DIR}/tmp/${_module}-docs.sgml
+ ${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in
- COMMAND ${CMAKE_COMMAND} -E echo "File '${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in' overwritten, make sure you replace generated strings with proper content before committing."
+ COMMAND ${CMAKE_COMMAND} -E echo
+ "File '${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in' overwritten, "
+ "make sure to replace generated strings with proper content before committing."
+ COMMENT "Target to rebuild the sgml for the specified module"
)
add_dependencies(gtkdoc-rebuild-sgmls gtkdoc-rebuild-${_module}-sgml)
diff --git a/cmake/modules/LibIcalMacrosInternal.cmake b/cmake/modules/LibIcalMacrosInternal.cmake
new file mode 100644
index 00000000..acf020eb
--- /dev/null
+++ b/cmake/modules/LibIcalMacrosInternal.cmake
@@ -0,0 +1,49 @@
+# CMake support macros and functions for the libical project
+
+# SPDX-FileCopyrightText: Allen Winter <winter@kde.org>
+# SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
+
+include(CheckCCompilerFlag)
+include(CheckCXXCompilerFlag)
+
+# Call option() and then add_feature_info()
+function(libical_option option description)
+ set(extra_option_arguments ${ARGN})
+ option(${option} "${description}" ${extra_option_arguments})
+ add_feature_info("Option ${option}" ${option} "${description}")
+endfunction()
+
+# Warn about deprecated cmake options then call libical_option
+function(libical_deprecated_option deprecated_option option description)
+ set(extra_option_arguments ${ARGN})
+ if(${deprecated_option})
+ message(WARNING "${deprecated_option} is deprecated. Use ${option} instead")
+ set(${option} ${deprecated_option} CACHE BOOL "${description}")
+ endif()
+ libical_option(${option} "${description}" ${extra_option_arguments})
+endfunction()
+
+# If condition is True, append the specified value to each ARGN
+function(libical_append_if condition value)
+ if(${condition})
+ foreach(variable ${ARGN})
+ set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
+ endforeach()
+ endif()
+endfunction()
+
+# Create a variable C_SUPPORTS_<flag> with a boolean denoting
+# if the C compiler supports that flag; if so, append the flag
+# to the global CMAKE_C_FLAGS variable.
+macro(libical_add_cflag flag name)
+ check_c_compiler_flag("${flag}" "C_SUPPORTS_${name}")
+ libical_append_if("C_SUPPORTS_${name}" "${flag}" CMAKE_C_FLAGS)
+endmacro()
+
+# Create a variable CXX_SUPPORTS_<flag> with a boolean denoting
+# if the C++ compiler supports that flag; if so, append the flag
+# to the global CMAKE_CXX_FLAGS variable.
+macro(libical_add_cxxflag flag name)
+ check_cxx_compiler_flag("${flag}" "CXX_SUPPORTS_${name}")
+ libical_append_if("CXX_SUPPORTS_${name}" "${flag}" CMAKE_CXX_FLAGS)
+endmacro()
diff --git a/cmake/run_test.cmake b/cmake/run_test.cmake
index db6c5c4d..8e76dbb2 100644
--- a/cmake/run_test.cmake
+++ b/cmake/run_test.cmake
@@ -1,3 +1,6 @@
+# SPDX-FileCopyrightText: Allen Winter <winter@kde.org>
+# SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
+
#-------------------------------------------------
# some argument checking:
# test_cmd is the command to run with all its arguments
@@ -16,7 +19,7 @@ if(NOT output_test)
endif()
# convert the space-separated string to a list
-separate_arguments(test_args)
+separate_arguments(test_args UNIX_COMMAND ${test_args})
execute_process(
COMMAND ${test_cmd} ${test_args}
@@ -40,5 +43,7 @@ execute_process(
)
if(test_not_successful)
- message(SEND_ERROR "Output does not match for ${output_blessed} and ${output_test}: ${err} : shell output: ${test_not_successful}!")
+ message(SEND_ERROR
+ "Output does not match for ${output_blessed} and ${output_test}: ${err} : shell output: ${test_not_successful}!"
+ )
endif()