Browse Source

QtAutogen: Add source files to target when only AUTORCC is used.

Add missing entry to if condition.
Stephen Kelly 11 years ago
parent
commit
b8877b1d62
3 changed files with 14 additions and 1 deletions
  1. 2 1
      Source/cmQtAutoGenerators.cxx
  2. 3 0
      Tests/QtAutogen/CMakeLists.txt
  3. 9 0
      Tests/QtAutogen/rcconly.cpp

+ 2 - 1
Source/cmQtAutoGenerators.cxx

@@ -392,7 +392,8 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
   std::map<std::string, std::string> configUicOptions;
 
   if (target->GetPropertyAsBool("AUTOMOC")
-      || target->GetPropertyAsBool("AUTOUIC"))
+      || target->GetPropertyAsBool("AUTOUIC")
+      || target->GetPropertyAsBool("AUTORCC"))
     {
     this->SetupSourceFiles(target);
     }

+ 3 - 0
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})
 

+ 9 - 0
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;
+}