c5e2838b64
Introduce a new cached variable INSTALL_CMAKE_NAMESPACE for defining the prefix used for CMake config files (c.f. "${PREFIX}Core/${PREFIX}CoreConfig.cmake") Also make sure to `find_dependency(...)` the required packages inside the individual CMake config files. I.e. in Qt5WidgetsConfig.cmake, search for Qt5Core, etc. pp.. Change-Id: Idc027925fe9d5323091c4853803ad5ce44b1afc6 Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
35 lines
1.0 KiB
CMake
35 lines
1.0 KiB
CMake
@PACKAGE_INIT@
|
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
get_filename_component(_import_prefix "${_import_prefix}" REALPATH)
|
|
|
|
# note: target_deps example: "Qt5Core\;5.12.0;Qt5Gui\;5.12.0"
|
|
set(_target_deps "@target_deps@")
|
|
foreach(_target_dep ${_target_deps})
|
|
list(GET _target_dep 0 pkg)
|
|
list(GET _target_dep 1 version)
|
|
|
|
if (NOT ${pkg}_FOUND)
|
|
find_dependency(${pkg} ${version}
|
|
PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH
|
|
)
|
|
endif()
|
|
|
|
if (NOT ${pkg}_FOUND)
|
|
set(@target@_FOUND FALSE)
|
|
return()
|
|
endif()
|
|
endforeach()
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake")
|
|
|
|
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Macros.cmake")
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Macros.cmake")
|
|
endif()
|
|
|
|
include(${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/QtFeature.cmake)
|
|
|
|
qt_make_features_available(Qt::@target@)
|