summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-09-20 15:00:58 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-09-26 17:32:53 (GMT)
commitc3c20d3ce3acbf6afd6a54dd846fd78b82623312 (patch)
treeb58f670fa7ec2b9630b29d55b63f496c19decf2a /Source
parent8b6ec29d4096b4ea59ef502360845e25a9bcb47e (diff)
downloadCMake-c3c20d3ce3acbf6afd6a54dd846fd78b82623312.zip
CMake-c3c20d3ce3acbf6afd6a54dd846fd78b82623312.tar.gz
CMake-c3c20d3ce3acbf6afd6a54dd846fd78b82623312.tar.bz2
QtAutogen: Add _automoc.cpp sources before initializing.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx1
-rw-r--r--Source/cmQtAutoGenerators.cxx17
-rw-r--r--Source/cmQtAutoGenerators.h1
3 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 435b769..6627bcc 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1456,6 +1456,7 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
cmTarget& target = *this->LocalGenerators[i]
->GetMakefile()->FindTarget(*ti, true);
+ cmQtAutoGenerators::InitializeAutogenSources(&target);
cmQtAutoGenerators::InitializeAutogenTarget(
this->LocalGenerators[i], &target);
cmQtAutoGenerators autogen;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 04d7bbc..9bec68a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -286,8 +286,8 @@ std::string cmQtAutoGenerators::ListQt4RccInputs(cmSourceFile* sf,
return entriesList;
}
-void cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
- cmTarget* target)
+
+void cmQtAutoGenerators::InitializeAutogenSources(cmTarget* target)
{
cmMakefile* makefile = target->GetMakefile();
@@ -304,6 +304,19 @@ void cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
target->AddSource(mocCppFile);
}
+}
+
+void cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
+ cmTarget* target)
+{
+ cmMakefile* makefile = target->GetMakefile();
+
+ std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
+ if (qtMajorVersion == "")
+ {
+ qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
+ }
+
// create a custom target for running generators at buildtime:
std::string autogenTargetName = getAutogenTargetName(target);
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index ff048c8..5f8ee62 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -31,6 +31,7 @@ public:
cmQtAutoGenerators();
bool Run(const std::string& targetDirectory, const std::string& config);
+ static void InitializeAutogenSources(cmTarget* target);
static void InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
static void SetupAutoGenerateTarget(cmTarget const* target);