-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.0
-
None
-
Linux archlinux 6.3.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 01 May 2023 17:42:39 +0000 x86_64 GNU/Linux
-
-
4ffea9dd1 (dev), 1c2203bcc (6.5), 8133cba37 (tqtc/lts-6.2)
I generate .spv for shaders using add_custom_command CMake's functionality (this script, used here). Resulting filepaths of .spv files are generated ABSOLUTE (because of GLOB_RECURSE). I add .spv files to QML module using RESOURCES parameter of qt6_target_qml_sources macro (this). In 6.3 or 6.2 all was fine: file level dependencies works fine. But in 6.5 I get an error:
CMake Error at /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2032 (file): file COPY_FILE failed to copy /home/anatoliy/Projects/sah_kd_tree/src/viewer/shaders/barycentric_color.frag.debug.spv to /home/anatoliy/Projects/build-sah_kd_tree-Desktop-Debug/src/viewer/lib/shaders/barycentric_color.frag.spv because: No such file or directory (input) Call Stack (most recent call first): src/viewer/CMakeLists.txt:81 (qt6_target_qml_sources)
Definitely there is some regression in CMake machinery of Qt in the last releases.
Instead of copying here I advice to use add_custom_command like I fix it locally (see in attachment). Correctness should not be sacrificed in the sake of "significant increase in copying speed".
Your developers should know difference between how CMakeLists.txt is interpreted at (so called) "configure step" and at "generate step" and what is the difference between file COPY_FILE or execute_process COMMAND on the one hand and add_custom_command, add_custom_target and add_dependency on the other hand, before they made such an changes.