summaryrefslogtreecommitdiffstats
path: root/cmake/Qt3rdPartyLibraryConfig.cmake.in
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-02-11 15:38:47 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-02-12 08:43:29 +0000
commit572c03eb7a583baf1f48e5144d2868e5588d292a (patch)
tree2125b11072cddf76e204619cc571dd009531202f /cmake/Qt3rdPartyLibraryConfig.cmake.in
parenta2eb09a377ff95e3f695937d893c101f9c409e75 (diff)
Add support for qt_helper_lib()
Add qt_add_3rdparty_library() function as a replacement for qmake's qt_helper_lib feature. All 3rdparty libraries will be available under the Qt:: alias when built through this method so that they can properly register as dependencies of a Qt module. This patch also adds Qt3rdPartyLibraryConfig.cmake.in to export the CMake configuration for static builds and shared libraries. Change-Id: I52bf3a95ca22fccd9ab54343468847bb1b570c28 Fixes: QTBUG-81969 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/Qt3rdPartyLibraryConfig.cmake.in')
-rw-r--r--cmake/Qt3rdPartyLibraryConfig.cmake.in26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/Qt3rdPartyLibraryConfig.cmake.in b/cmake/Qt3rdPartyLibraryConfig.cmake.in
new file mode 100644
index 0000000000..0facce906f
--- /dev/null
+++ b/cmake/Qt3rdPartyLibraryConfig.cmake.in
@@ -0,0 +1,26 @@
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+
+get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_import_prefix "${_import_prefix}" REALPATH)
+
+# Extra cmake code begin
+@extra_cmake_code@
+# Extra cmake code end
+
+# 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")
+endif()
+
+if (NOT QT_NO_CREATE_TARGETS)
+ include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake")
+ if(NOT QT_NO_CREATE_VERSIONLESS_TARGETS)
+ include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake")
+ endif()
+endif()
+
+foreach(extra_cmake_include @extra_cmake_includes@)
+ include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}")
+endforeach()