summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-10 14:45:27 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-11 14:30:12 (GMT)
commitc62cd3e2aeb9ed7e3021bd9e5863294fd0441790 (patch)
tree321e22067125372bd322f64a4d04de04c49e8ee4
parent035b6908829f524936a6819a342cdff145708529 (diff)
downloadCMake-c62cd3e2aeb9ed7e3021bd9e5863294fd0441790.zip
CMake-c62cd3e2aeb9ed7e3021bd9e5863294fd0441790.tar.gz
CMake-c62cd3e2aeb9ed7e3021bd9e5863294fd0441790.tar.bz2
Constify autogen handling.
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmQtAutoGenerators.cxx22
-rw-r--r--Source/cmQtAutoGenerators.h8
3 files changed, 18 insertions, 15 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index b7bc475..f60d24d 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -334,7 +334,8 @@ protected:
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
bool CheckTargets();
- typedef std::vector<std::pair<cmQtAutoGenerators, cmTarget*> > AutogensType;
+ typedef std::vector<std::pair<cmQtAutoGenerators,
+ cmTarget const*> > AutogensType;
void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
std::string SelectMakeProgram(const char* makeProgram,
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 1988c5d..2b4bb8a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -138,14 +138,14 @@ cmQtAutoGenerators::cmQtAutoGenerators()
}
}
-static std::string getAutogenTargetName(cmTarget *target)
+static std::string getAutogenTargetName(cmTarget const* target)
{
std::string autogenTargetName = target->GetName();
autogenTargetName += "_automoc";
return autogenTargetName;
}
-static std::string getAutogenTargetDir(cmTarget *target)
+static std::string getAutogenTargetDir(cmTarget const* target)
{
cmMakefile* makefile = target->GetMakefile();
std::string targetDir = makefile->GetCurrentOutputDirectory();
@@ -296,7 +296,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
return true;
}
-static void GetCompileDefinitionsAndDirectories(cmTarget *target,
+static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
const char * config,
std::string &incs,
std::string &defs)
@@ -304,10 +304,12 @@ static void GetCompileDefinitionsAndDirectories(cmTarget *target,
cmMakefile* makefile = target->GetMakefile();
cmLocalGenerator* localGen = makefile->GetLocalGenerator();
std::vector<std::string> includeDirs;
- cmGeneratorTarget gtgt(target);
+ cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(target);
// Get the include dirs for this target, without stripping the implicit
// include dirs off, see http://public.kitware.com/Bug/view.php?id=13667
- localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX", config, false);
+ localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false);
const char* sep = "";
incs = "";
for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
@@ -333,7 +335,7 @@ static void GetCompileDefinitionsAndDirectories(cmTarget *target,
}
}
-void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
+void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
{
cmMakefile* makefile = target->GetMakefile();
@@ -436,7 +438,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
}
}
-void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
+void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
const std::string &autogenTargetName,
std::map<std::string, std::string> &configIncludes,
std::map<std::string, std::string> &configDefines)
@@ -615,7 +617,7 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
}
-static void GetUicOpts(cmTarget *target, const char * config,
+static void GetUicOpts(cmTarget const* target, const char * config,
std::string &optString)
{
std::vector<std::string> opts;
@@ -632,7 +634,7 @@ static void GetUicOpts(cmTarget *target, const char * config,
}
}
-void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget* target,
+void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
std::map<std::string, std::string> &configUicOptions)
{
cmMakefile *makefile = target->GetMakefile();
@@ -837,7 +839,7 @@ void cmQtAutoGenerators::InitializeAutoRccTarget(cmTarget* target)
}
}
-void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget* target)
+void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
{
std::string _rcc_files;
const char* sepRccFiles = "";
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 0888ea4..80123d8 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -24,17 +24,17 @@ public:
bool Run(const char* targetDirectory, const char *config);
bool InitializeAutogenTarget(cmTarget* target);
- void SetupAutoGenerateTarget(cmTarget* target);
+ void SetupAutoGenerateTarget(cmTarget const* target);
private:
- void SetupAutoMocTarget(cmTarget* target,
+ void SetupAutoMocTarget(cmTarget const* target,
const std::string &autogenTargetName,
std::map<std::string, std::string> &configIncludes,
std::map<std::string, std::string> &configDefines);
- void SetupAutoUicTarget(cmTarget* target,
+ void SetupAutoUicTarget(cmTarget const* target,
std::map<std::string, std::string> &configUicOptions);
void InitializeAutoRccTarget(cmTarget* target);
- void SetupAutoRccTarget(cmTarget* target);
+ void SetupAutoRccTarget(cmTarget const* target);
cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
const char* targetDirectory);