From 7c04c5427f697bce5f2d7c7f0ae442962df07620 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 20 Mar 2020 15:07:28 +0100 Subject: CMake: Fix creation of forwarding headers to be at configure time qt_add_module checks for the existence of the following directory include/QtFoo/6.0.0/Foo when deciding whether a private module target should contain that path in its INTERFACE_INCLUDE_DIRECTORIES. There are 2 cases when it's created, when running syncqt, and inside qt_install_injections. If syncqt doesn't create it because there are no private headers (like in qttools/src/global), qt_install_injections created it at generation time (for injected configure headers like qttools-config_p.h) Unfortunately that caused the existence check mentioned above to fail, not exporting the path in the QtToolsPrivate's include directories, and failing the qttools build. To fix that, create the injection files (and directories) at configure time, using qt_configure_file instead of file(GENERATE). Change-Id: Idd9b6ec36e986c4de95d11557170e1c70927211c Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmake') diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0455567208..43ee166ce9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1318,7 +1318,8 @@ function(qt_install_injections target build_dir install_dir) "${lower_case_forwarding_header_path}" "${current_repo_build_dir}/${file}") set(main_contents "#include \"${relpath}\"") - file(GENERATE OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" + + qt_configure_file(OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" CONTENT "${main_contents}") if(is_framework) @@ -1348,7 +1349,7 @@ function(qt_install_injections target build_dir install_dir) endif() # Generate upper case forwarding header like QVulkanFunctions or QtConfig. - file(GENERATE OUTPUT "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}" + qt_configure_file(OUTPUT "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}" CONTENT "#include \"${destinationname}\"\n") if(is_framework) -- cgit v1.2.3