qtbase/cmake/QtModuleConfig.cmake.in
Kevin Funk 4bfd6c010b cmake: Create Qt5 compat targets in config files
For now create targets a la "Qt5::Core" to stay compatible with the
current Qt5 naming scheme. The name is controllable via a CMake option.

Change-Id: If43c058221949b1900c2093f39ccc9d0f38028f1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 11:09:03 +00:00

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_CMAKE_EXPORT_NAMESPACE@::@target@)