From 619c7683d4f177b1179829a3bbe2bdb537758907 Mon Sep 17 00:00:00 2001 From: berrux_dev Date: Fri, 18 Sep 2026 17:45:16 +0200 Subject: [PATCH] Guards pdm_translation stub copy against codegen race --- .../ProjectDataManagement/CMakeLists.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/ProjectDataManagement/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Services/ProjectDataManagement/CMakeLists.txt index 9197e7b0a..0193bc713 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/ProjectDataManagement/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/ProjectDataManagement/CMakeLists.txt @@ -28,11 +28,18 @@ CONFIGURE_FILE( ) # Copy pdm_translation.h to build directory -CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/ProjectDataManagement/pdm_translation.h - ${CMAKE_CURRENT_BINARY_DIR}/pdm_translation.h - COPYONLY -) +# Only when BUILD_GRANTLEE=OFF (stub header). With BUILD_GRANTLEE=ON the +# codegen writes the real pdm_translation.h to the same build-dir path +# (see "Generating ... pdm_translation.h" in CODEGEN_IDL_SVC); copying the +# stub here would overwrite the generated file on every cmake re-configure +# and break incremental builds. Same guard pattern as pdm_enums.hpp below. +IF(NOT BUILD_GRANTLEE) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/ProjectDataManagement/pdm_translation.h + ${CMAKE_CURRENT_BINARY_DIR}/pdm_translation.h + COPYONLY + ) +ENDIF() # Copy pdm_enums.hpp to build directory (when BUILD_RTI=OFF) IF(NOT BUILD_RTI)