]> sigrok.org Git - pulseview.git/commitdiff
cmake: don't mangle in-source .qrc file
authoruser <redacted>
Tue, 14 Jan 2020 17:29:30 +0000 (18:29 +0100)
committerUwe Hermann <redacted>
Sat, 18 Jan 2020 13:05:54 +0000 (14:05 +0100)
Only copy the .qrc file for out-of-source builds. For in-source builds
the file is already present, and not touching it avoids data loss.

CMakeLists.txt

index ff052ce1f439036ceaf32fe2e7eff91fb619938d..38252fddecfb024745f801aaf4673dc0df66f3ce 100644 (file)
@@ -429,7 +429,9 @@ qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
 
 file(GLOB TS_FILES ${CMAKE_SOURCE_DIR}/l10n/*.ts)
 set_property(SOURCE ${TS_FILES} PROPERTY OUTPUT_LOCATION ${CMAKE_BINARY_DIR}/l10n)
-configure_file("translations.qrc" "translations.qrc" COPYONLY)
+if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+       configure_file("translations.qrc" "translations.qrc" COPYONLY)
+endif ()
 
 qt5_add_translation(QM_FILES ${TS_FILES})
 qt5_create_translation(QM_FILES ${pulseview_SOURCES} ${TS_FILES})