From ea96f1860164ff8a6751b21b3fb4d425fc87f5e5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 25 Apr 2021 13:15:20 +0200 Subject: [PATCH] TD: do not delete mtextedit.h for in-source builds --- src/Mod/TechDraw/Gui/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/TechDraw/Gui/CMakeLists.txt b/src/Mod/TechDraw/Gui/CMakeLists.txt index eb9660bcd6..722cc0d3c3 100644 --- a/src/Mod/TechDraw/Gui/CMakeLists.txt +++ b/src/Mod/TechDraw/Gui/CMakeLists.txt @@ -6,9 +6,11 @@ endif(MSVC) # In previous versions this target copied mtextedit.h to the binary directory that causes # automoc to generate linking errors. -if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mtextedit.h) - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/mtextedit.h) - execute_process(COMMAND "${CMAKE_COMMAND}" -E touch_nocreate "${CMAKE_CURRENT_SOURCE_DIR}/mtextedit.h") +if(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mtextedit.h) + file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/mtextedit.h) + execute_process(COMMAND "${CMAKE_COMMAND}" -E touch_nocreate "${CMAKE_CURRENT_SOURCE_DIR}/mtextedit.h") + endif() endif() include_directories(