diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-11-15 16:28:17 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-11-26 10:58:56 +0000 |
commit | 9061f2987213f3b6cc1e6908ba1b0b29daf877f8 (patch) | |
tree | 3ba9caa7267f47d995b22fd573cb1a23209a7d93 /cmake/QtPostProcess.cmake | |
parent | 1c655fb0fc08e89ab5efb23889266b710334f1a5 (diff) |
Provide a way to specify extra tool package dependencies
In the qtwayland repo, both WaylandClient and WaylandCompositor
packages need access to the qtwaylandscanner tool. That means
that the add_qt_tool(qtwaylandscanner) can't use the TOOLS_TARGET
argument to associate a dependency with only one of the above
modules.
Instead add_qt_tool now allows specifying a non-existent module
name for the TOOLS_TARGET argument, which can be manually
depended on by other packages.
Actually, you could specify the non-existent module before as
well, but that didn't do everything that had to be done.
This required a bit of refactoring in how the Dependencies file
for Tools packages is created. Now the file is created in
qt_export_tools.
Two new functions were also added to allow recording additional
dependencies between packages.
Also some bug fixes were done to make it all work. Specifically
the _FOUND variable generated in the Dependencies file was incorrect.
Also there are some quotes missing when appending extra package
dependencies via the QT_EXTRA_PACKAGE_DEPENDENCIES property.
Change-Id: I167efec16dff8d036e191df3572ea72764e22bc5
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtPostProcess.cmake')
-rw-r--r-- | cmake/QtPostProcess.cmake | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index b063562937..2e0fe602a8 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -82,7 +82,7 @@ function(qt_internal_create_module_depends_file target) get_target_property(extra_depends "${target}" QT_EXTRA_PACKAGE_DEPENDENCIES) endif() if(NOT extra_depends STREQUAL "${extra_depends}-NOTFOUND") - list(APPEND target_deps ${extra_depends}) + list(APPEND target_deps "${extra_depends}") endif() # Used for assembling the content of an include/Module/ModuleDepends.h header. @@ -183,23 +183,8 @@ function(qt_internal_create_module_depends_file target) endif() if(tool_deps) - set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}Tools") - qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) - qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) - - # Configure and install ModuleToolDependencies file. - configure_file( - "${QT_CMAKE_DIR}/QtModuleToolsDependencies.cmake.in" - "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" - @ONLY - ) - - qt_install(FILES - "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" - DESTINATION "${config_install_dir}" - COMPONENT Devel - ) - + # The value of the property will be used by qt_export_tools. + set_property(TARGET "${target}" PROPERTY _qt_tools_package_deps "${tool_deps}") endif() endfunction() @@ -378,12 +363,14 @@ function(qt_internal_create_config_file_for_standalone_tests) ) endfunction() -qt_create_tools_config_files() qt_internal_create_depends_files() qt_generate_build_internals_extra_cmake_code() qt_internal_create_plugins_files() qt_internal_create_config_file_for_standalone_tests() +# Needs to run after qt_internal_create_depends_files. +qt_create_tools_config_files() + if (ANDROID) qt_modules_process_android_dependencies() endif() |