[Cmake-commits] CMake branch, next, updated. v2.8.12.2-7430-ga542ffe
Stephen Kelly
steveire at gmail.com
Wed Feb 5 04:14:02 EST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via a542ffea3e34a9f62d7d73722b324483ff1ec263 (commit)
via 8f8edeb09bef3065c0a344bfa00f20a843cf1a32 (commit)
from 0efeabcbbf7707c267f544a14ec306e619dc0632 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a542ffea3e34a9f62d7d73722b324483ff1ec263
commit a542ffea3e34a9f62d7d73722b324483ff1ec263
Merge: 0efeabc 8f8edeb
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 5 04:14:01 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 5 04:14:01 2014 -0500
Merge topic 'fix-Qt-autogen' into next
8f8edeb0 QtAutogen: Only add source files to the target if AUTORCC is ON.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f8edeb09bef3065c0a344bfa00f20a843cf1a32
commit 8f8edeb09bef3065c0a344bfa00f20a843cf1a32
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Feb 5 09:55:51 2014 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Feb 5 10:13:39 2014 +0100
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
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 7e44c26..ab194c3 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -487,19 +487,23 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* target)
}
std::string ext = sf->GetExtension();
- if (ext == "qrc"
- && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
+
+ if (target->GetPropertyAsBool("AUTORCC"))
{
- std::string basename = cmsys::SystemTools::
- GetFilenameWithoutLastExtension(absFile);
-
- std::string rcc_output_file = makefile->GetCurrentOutputDirectory();
- rcc_output_file += "/qrc_" + basename + ".cpp";
- makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
- rcc_output_file.c_str(), false);
- cmSourceFile* rccCppSource
- = makefile->GetOrCreateSource(rcc_output_file.c_str(), true);
- newRccFiles.push_back(rccCppSource);
+ if (ext == "qrc"
+ && !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")))
+ {
+ std::string basename = cmsys::SystemTools::
+ GetFilenameWithoutLastExtension(absFile);
+
+ std::string rcc_output_file = makefile->GetCurrentOutputDirectory();
+ rcc_output_file += "/qrc_" + basename + ".cpp";
+ makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
+ rcc_output_file.c_str(), false);
+ cmSourceFile* rccCppSource
+ = makefile->GetOrCreateSource(rcc_output_file.c_str(), true);
+ newRccFiles.push_back(rccCppSource);
+ }
}
if (!generated)
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>
-----------------------------------------------------------------------
Summary of changes:
Source/cmQtAutoGenerators.cxx | 28 +++++++++++---------
Tests/QtAutogen/CMakeLists.txt | 8 +++++-
.../QtAutogen/{test.qrc => not_generated_file.qrc} | 2 +-
3 files changed, 24 insertions(+), 14 deletions(-)
copy Tests/QtAutogen/{test.qrc => not_generated_file.qrc} (67%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list