summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-02-05 08:55:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-02-05 09:13:39 (GMT)
commit8f8edeb09bef3065c0a344bfa00f20a843cf1a32 (patch)
treef5ddb40a06496bdc5d15161d35bed1ba01e3ebf7 /Tests/QtAutogen
parentf748b59e2057d73a25448378442d70b420ed7698 (diff)
downloadCMake-8f8edeb09bef3065c0a344bfa00f20a843cf1a32.zip
CMake-8f8edeb09bef3065c0a344bfa00f20a843cf1a32.tar.gz
CMake-8f8edeb09bef3065c0a344bfa00f20a843cf1a32.tar.bz2
QtAutogen: Only add source files to the target if AUTORCC is ON.
The qtx_add_resources() macro adds the resource file to the output list to maintain file-level dependencies. Having the qrc file in a target sources is a precondition for AUTORCC to function. When processing the source files of a target, only add the generated qrc_<file>.cpp to the target sources if AUTORCC is ON. This avoids pre-porting conflict with the macro. Reported-by: Micha Hergarden
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt8
-rw-r--r--Tests/QtAutogen/not_generated_file.qrc5
2 files changed, 12 insertions, 1 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 546ed02..4da125f 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -82,7 +82,13 @@ target_link_libraries(libC LINK_PUBLIC libB)
target_link_libraries(QtAutogen codeeditorLib ${QT_LIBRARIES} libC)
-add_library(empty STATIC empty.cpp)
+# Add not_generated_file.qrc to the source list to get the file-level
+# dependency, but don't generate a c++ file from it. Disable the AUTORCC
+# feature for this target. This tests that qrc files in the sources don't
+# have an effect on generation if AUTORCC is off.
+add_library(empty STATIC empty.cpp not_generated_file.qrc)
+set_target_properties(empty PROPERTIES AUTORCC OFF)
+
set_target_properties(empty PROPERTIES AUTOMOC TRUE)
target_link_libraries(empty no_link_language)
add_library(no_link_language STATIC empty.h)
diff --git a/Tests/QtAutogen/not_generated_file.qrc b/Tests/QtAutogen/not_generated_file.qrc
new file mode 100644
index 0000000..c769834
--- /dev/null
+++ b/Tests/QtAutogen/not_generated_file.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>abc.cpp</file>
+</qresource>
+</RCC>