From b8877b1d62599bba7a014e95fbbd670f177243ce Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Sep 2014 16:20:43 +0200 Subject: QtAutogen: Add source files to target when only AUTORCC is used. Add missing entry to if condition. --- Source/cmQtAutoGenerators.cxx | 3 ++- Tests/QtAutogen/CMakeLists.txt | 3 +++ Tests/QtAutogen/rcconly.cpp | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Tests/QtAutogen/rcconly.cpp diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index a8bb317..4b8f810 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -392,7 +392,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target) std::map configUicOptions; if (target->GetPropertyAsBool("AUTOMOC") - || target->GetPropertyAsBool("AUTOUIC")) + || target->GetPropertyAsBool("AUTOUIC") + || target->GetPropertyAsBool("AUTORCC")) { this->SetupSourceFiles(target); } diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index d2116aa..f9aa309 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -37,6 +37,9 @@ else() endif() +add_executable(rcconly rcconly.cpp second_resource.qrc) +set_property(TARGET rcconly PROPERTY AUTORCC ON) +target_link_libraries(rcconly ${QT_QTCORE_TARGET}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Tests/QtAutogen/rcconly.cpp b/Tests/QtAutogen/rcconly.cpp new file mode 100644 index 0000000..854c4c1 --- /dev/null +++ b/Tests/QtAutogen/rcconly.cpp @@ -0,0 +1,9 @@ + +extern int qInitResources_second_resource(); + +int main(int, char**) +{ + // Fails to link if the symbol is not present. + qInitResources_second_resource(); + return 0; +} -- cgit v0.12