summaryrefslogtreecommitdiff
path: root/Source/cmQtAutoGeneratorInitializer.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-05 18:50:00 +0200
committerStephen Kelly <steveire@gmail.com>2015-10-05 18:50:00 +0200
commit59b91107d16c2f2ba68791ae67c53bdcc0d32e05 (patch)
tree91f31c3b05123f2496ec87115192af4171144259 /Source/cmQtAutoGeneratorInitializer.cxx
parent7254f6452596f438f0607ece559be7ad556b190a (diff)
downloadcmake-59b91107d16c2f2ba68791ae67c53bdcc0d32e05.tar.gz
QtAutogen: Move GetRccExecutable method.
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx102
1 files changed, 51 insertions, 51 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index d998ae0996..5cb22e9531 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -340,6 +340,57 @@ void cmQtAutoGeneratorInitializer::SetupAutoUicTarget(cmTarget const* target,
}
}
+std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
+ cmTarget const* target)
+{
+ cmGeneratorTarget *gtgt = target->GetMakefile()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
+ cmMakefile *makefile = target->GetMakefile();
+ const char *qtVersion = makefile->GetDefinition("_target_qt_version");
+ if (!qtVersion)
+ {
+ qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
+ if (!qtVersion)
+ {
+ qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
+ }
+ if (const char *targetQtVersion =
+ gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
+ {
+ qtVersion = targetQtVersion;
+ }
+ }
+
+ std::string targetName = target->GetName();
+ if (strcmp(qtVersion, "5") == 0)
+ {
+ cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
+ if (!qt5Rcc)
+ {
+ cmSystemTools::Error("Qt5::rcc target not found ",
+ targetName.c_str());
+ return std::string();
+ }
+ return qt5Rcc->ImportedGetLocation("");
+ }
+ else if (strcmp(qtVersion, "4") == 0)
+ {
+ cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
+ if (!qt4Rcc)
+ {
+ cmSystemTools::Error("Qt4::rcc target not found ",
+ targetName.c_str());
+ return std::string();
+ }
+ return qt4Rcc->ImportedGetLocation("");
+ }
+
+ cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
+ "Qt 5 ", targetName.c_str());
+ return std::string();
+}
+
std::string cmQtAutoGeneratorInitializer::GetAutogenTargetName(
cmTarget const* target)
{
@@ -1021,54 +1072,3 @@ void cmQtAutoGeneratorInitializer::SetupAutoRccTarget(cmTarget const* target)
makefile->AddDefinition("_qt_rcc_executable",
cmQtAutoGeneratorInitializer::GetRccExecutable(target).c_str());
}
-
-std::string cmQtAutoGeneratorInitializer::GetRccExecutable(
- cmTarget const* target)
-{
- cmGeneratorTarget *gtgt = target->GetMakefile()
- ->GetGlobalGenerator()
- ->GetGeneratorTarget(target);
- cmMakefile *makefile = target->GetMakefile();
- const char *qtVersion = makefile->GetDefinition("_target_qt_version");
- if (!qtVersion)
- {
- qtVersion = makefile->GetDefinition("Qt5Core_VERSION_MAJOR");
- if (!qtVersion)
- {
- qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
- }
- if (const char *targetQtVersion =
- gtgt->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
- {
- qtVersion = targetQtVersion;
- }
- }
-
- std::string targetName = target->GetName();
- if (strcmp(qtVersion, "5") == 0)
- {
- cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc");
- if (!qt5Rcc)
- {
- cmSystemTools::Error("Qt5::rcc target not found ",
- targetName.c_str());
- return std::string();
- }
- return qt5Rcc->ImportedGetLocation("");
- }
- else if (strcmp(qtVersion, "4") == 0)
- {
- cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc");
- if (!qt4Rcc)
- {
- cmSystemTools::Error("Qt4::rcc target not found ",
- targetName.c_str());
- return std::string();
- }
- return qt4Rcc->ImportedGetLocation("");
- }
-
- cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
- "Qt 5 ", targetName.c_str());
- return std::string();
-}