2018-10-24 13:20:27 +00:00
|
|
|
@PACKAGE_INIT@
|
|
|
|
|
2020-11-30 07:46:49 +00:00
|
|
|
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
|
|
|
|
|
2019-02-11 10:34:35 +00:00
|
|
|
include(CMakeFindDependencyMacro)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2019-02-11 10:34:35 +00:00
|
|
|
get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
get_filename_component(_import_prefix "${_import_prefix}" REALPATH)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2019-05-16 09:34:06 +00:00
|
|
|
# Extra cmake code begin
|
|
|
|
@extra_cmake_code@
|
|
|
|
# Extra cmake code end
|
|
|
|
|
2019-06-11 13:46:31 +00:00
|
|
|
# Find required dependencies, if any.
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake")
|
2022-07-14 15:00:56 +00:00
|
|
|
_qt_internal_suggest_dependency_debugging(@target@
|
2022-07-14 13:28:12 +00:00
|
|
|
__qt_@target@_pkg ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE)
|
2019-06-11 13:46:31 +00:00
|
|
|
endif()
|
2019-06-04 15:08:47 +00:00
|
|
|
|
2020-09-14 07:06:58 +00:00
|
|
|
# If *ConfigDependencies.cmake exists, the variable value will be defined there.
|
|
|
|
# Don't override it in that case.
|
|
|
|
if(NOT DEFINED "@INSTALL_CMAKE_NAMESPACE@@target@_FOUND")
|
|
|
|
set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" TRUE)
|
|
|
|
endif()
|
|
|
|
|
2021-11-01 09:41:11 +00:00
|
|
|
if (NOT QT_NO_CREATE_TARGETS AND @INSTALL_CMAKE_NAMESPACE@@target@_FOUND)
|
2019-06-04 15:08:47 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake")
|
2020-09-22 20:16:20 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@AdditionalTargetInfo.cmake")
|
2022-05-13 16:24:22 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@ExtraProperties.cmake"
|
|
|
|
OPTIONAL)
|
2019-12-05 12:54:07 +00:00
|
|
|
if(NOT QT_NO_CREATE_VERSIONLESS_TARGETS)
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake")
|
|
|
|
endif()
|
2020-07-14 16:08:07 +00:00
|
|
|
|
|
|
|
# DEPRECATED
|
|
|
|
# Provide old style variables for includes, compile definitions, etc.
|
|
|
|
# These variables are deprecated and only provided on a best-effort basis to facilitate porting.
|
|
|
|
# Consider using target_link_libraries(app PRIVATE @QT_CMAKE_EXPORT_NAMESPACE@@target@) instead.
|
|
|
|
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_LIBRARIES "@QT_CMAKE_EXPORT_NAMESPACE@::@target@")
|
|
|
|
|
|
|
|
get_target_property(_@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_INCLUDE_DIRS
|
|
|
|
@QT_CMAKE_EXPORT_NAMESPACE@::@target@ INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
if(NOT _@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_INCLUDE_DIRS)
|
|
|
|
set(_@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_INCLUDE_DIRS "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::@target@Private)
|
|
|
|
get_target_property(_@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_PRIVATE_INCLUDE_DIRS
|
|
|
|
@QT_CMAKE_EXPORT_NAMESPACE@::@target@Private INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
if(NOT _@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_PRIVATE_INCLUDE_DIRS)
|
|
|
|
set(_@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_PRIVATE_INCLUDE_DIRS "")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
get_target_property(@QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS
|
|
|
|
@QT_CMAKE_EXPORT_NAMESPACE@::@target@ INTERFACE_COMPILE_DEFINITIONS)
|
|
|
|
if(NOT @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS)
|
|
|
|
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS "")
|
|
|
|
else()
|
|
|
|
list(TRANSFORM @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS PREPEND "-D")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
get_target_property(@QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS
|
|
|
|
@QT_CMAKE_EXPORT_NAMESPACE@::@target@ INTERFACE_COMPILE_DEFINITIONS)
|
|
|
|
if(NOT @QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS)
|
|
|
|
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_INCLUDE_DIRS
|
|
|
|
${_@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_PRIVATE_INCLUDE_DIRS
|
|
|
|
${_@QT_CMAKE_EXPORT_NAMESPACE@@target@_OWN_PRIVATE_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
foreach(_module_dep ${_@QT_CMAKE_EXPORT_NAMESPACE@@target@_MODULE_DEPENDENCIES})
|
|
|
|
list(APPEND @QT_CMAKE_EXPORT_NAMESPACE@@target@_INCLUDE_DIRS
|
|
|
|
${@QT_CMAKE_EXPORT_NAMESPACE@${_module_dep}_INCLUDE_DIRS})
|
|
|
|
list(APPEND @QT_CMAKE_EXPORT_NAMESPACE@@target@_PRIVATE_INCLUDE_DIRS
|
|
|
|
${@QT_CMAKE_EXPORT_NAMESPACE@${_module_dep}_PRIVATE_INCLUDE_DIRS})
|
|
|
|
list(APPEND @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS
|
|
|
|
${@QT_CMAKE_EXPORT_NAMESPACE@${_module_dep}_DEFINITIONS})
|
|
|
|
list(APPEND @QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS
|
|
|
|
${@QT_CMAKE_EXPORT_NAMESPACE@${_module_dep}_COMPILE_DEFINITIONS})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
list(REMOVE_DUPLICATES @QT_CMAKE_EXPORT_NAMESPACE@@target@_INCLUDE_DIRS)
|
|
|
|
list(REMOVE_DUPLICATES @QT_CMAKE_EXPORT_NAMESPACE@@target@_PRIVATE_INCLUDE_DIRS)
|
|
|
|
list(REMOVE_DUPLICATES @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS)
|
|
|
|
list(REMOVE_DUPLICATES @QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS)
|
Write find_dependency() calls in Qt Module config files
This change introduces a new function called qt_find_package()
which can take an extra option called PROVIDED_TARGETS, which
associates targets with the package that defines those targets.
This is done by setting the INTERFACE_QT_PACKAGE_NAME and
INTERFACE_QT_PACKAGE_VERSION properties on the imported targets.
This information allows us to generate appropriate find_dependency()
calls in a module's Config file for third party libraries.
For example when an application links against QtCore, it should also
link against zlib and atomic libraries. In order to do that, the
library locations first have to be found by CMake. This is achieved by
embedding find_dependency(ZLIB) and find_dependency(Atomic) in
Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake.
The latter is picked up when an application project contains
find_package(Qt5Core), and thus all linking dependencies are resolved.
The information 'which package provides which targets' is contained
in the python json2cmake conversion script. The generated output of
the script contains qt_find_package() calls that represent that
information.
The Qt5CoreDependencies.cmake file and which which dependencies it
contains is generated at the QtPostProcess stop.
Note that for non-static Qt builds, we only need to propagate public
3rd party libraries. For static builds, we need all third party
libraries.
In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any
scope, the targets on which the property is set, have to be GLOBAL.
Also for applications and other modules to find all required third
party libraries, we have to install all our custom Find modules, and
make sure they define INTERFACE IMPORTED libraries, and not just
IMPORTED libraries.
Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-24 15:14:25 +00:00
|
|
|
endif()
|
|
|
|
|
2020-12-11 15:11:35 +00:00
|
|
|
if (TARGET @QT_CMAKE_EXPORT_NAMESPACE@::@target@)
|
2022-05-10 13:02:43 +00:00
|
|
|
qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@)
|
|
|
|
|
2020-12-11 15:11:35 +00:00
|
|
|
foreach(extra_cmake_include @extra_cmake_includes@)
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}")
|
|
|
|
endforeach()
|
2019-01-14 10:35:53 +00:00
|
|
|
|
2020-12-11 15:11:35 +00:00
|
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake")
|
|
|
|
endif()
|
2019-06-05 20:26:12 +00:00
|
|
|
|
2020-12-11 15:11:35 +00:00
|
|
|
list(APPEND QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE "@target@")
|
2019-09-23 14:57:06 +00:00
|
|
|
|
2020-12-11 15:11:35 +00:00
|
|
|
get_target_property(_qt_module_target_type "@INSTALL_CMAKE_NAMESPACE@::@target@" TYPE)
|
|
|
|
if(NOT _qt_module_target_type STREQUAL "INTERFACE_LIBRARY")
|
|
|
|
get_target_property(_qt_module_plugin_types
|
|
|
|
@INSTALL_CMAKE_NAMESPACE@::@target@ MODULE_PLUGIN_TYPES)
|
|
|
|
if(_qt_module_plugin_types)
|
|
|
|
list(APPEND QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE "${_qt_module_plugin_types}")
|
|
|
|
endif()
|
2019-11-04 10:26:22 +00:00
|
|
|
endif()
|
2020-01-27 13:56:40 +00:00
|
|
|
|
2020-02-05 16:35:49 +00:00
|
|
|
|
2020-12-11 15:11:35 +00:00
|
|
|
# Load Module's BuildInternals should any exist
|
|
|
|
if (@INSTALL_CMAKE_NAMESPACE@BuildInternals_DIR AND
|
2020-02-05 16:35:49 +00:00
|
|
|
EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
|
2020-12-11 15:11:35 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
|
|
|
|
endif()
|
|
|
|
else()
|
2021-08-02 14:02:04 +00:00
|
|
|
|
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
|
|
|
|
if(NOT DEFINED @INSTALL_CMAKE_NAMESPACE@@target@_NOT_FOUND_MESSAGE)
|
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@@target@_NOT_FOUND_MESSAGE
|
2022-07-12 12:22:24 +00:00
|
|
|
"Target \"@QT_CMAKE_EXPORT_NAMESPACE@::@target@\" was not found.")
|
2021-08-02 14:02:04 +00:00
|
|
|
|
|
|
|
if(QT_NO_CREATE_TARGETS)
|
|
|
|
string(APPEND @INSTALL_CMAKE_NAMESPACE@@target@_NOT_FOUND_MESSAGE
|
|
|
|
"Possibly due to QT_NO_CREATE_TARGETS being set to TRUE and thus "
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake was not "
|
|
|
|
"included to define the target.")
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-02-05 16:35:49 +00:00
|
|
|
endif()
|