[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-687-gf7b2445
Brad King
brad.king at kitware.com
Sat Mar 8 08:21:56 EST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via f7b2445b69a3ab45854952f40de5f8afbc96bc9c (commit)
via fc5ba1f09b42605d43988f995cf1919b48470798 (commit)
via aee8464ebc460b9370a98d42757283e3425175ef (commit)
via ea31d0e057b5c580303ae06e181c240ef6c1a3a0 (commit)
via 8228195f4ee06abbdbe463b847cc96b117b8f8a1 (commit)
via 10d6ac8378de3a734d1521de2eb99829b0517e17 (commit)
via 6b3c37015af7cf066ee8aa366f2eb705a371468d (commit)
via 76217b54af8552202e8135dc1f0174f3bd2fc0f3 (commit)
via 43820d6fabf85dfab87ba3a758fe1c4810a1c704 (commit)
via 2e695d4447dad71285d49ff453258b68142e072a (commit)
via c88ddb0aea36c22ec79cf7ff381c3f5710a66394 (commit)
via 44cccc30926fe7708804fb76851b87dfdf8a332b (commit)
via d320ee820dbf8bac87c54cd787d5d959276728e6 (commit)
via 06ca66688fa30546d5fc09137a1cd6d874de7b1c (commit)
via b6df3ebc39cb0c0334236c4f1c530339a745f37f (commit)
via ef42507a93bdfaae12905994a0f5a9885945b142 (commit)
via 9aea0925b7af1332eabff69ae9c4b62c84f21231 (commit)
via 4f65b08baf52f03c19f65c738adb0fa2948318aa (commit)
via 3332377f569a35c3e73c53083a109141446143a1 (commit)
from 5255ddad3efe93491a72078ac9cadd876f48fbaa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7b2445b69a3ab45854952f40de5f8afbc96bc9c
commit f7b2445b69a3ab45854952f40de5f8afbc96bc9c
Merge: 5255dda fc5ba1f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Mar 8 08:21:49 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Mar 8 08:21:49 2014 -0500
Merge topic 'dev/string-apis' into next
fc5ba1f0 CPackWiX: Fix test to build with expected config
aee8464e stringapi: Prevent a NULL dereference in WiX
ea31d0e0 speedup: Avoid excess iterator dereferences
8228195f speedup: Cache strings for comparisons
10d6ac83 stringapi: Use strings for dependency information
6b3c3701 stringapi: Use strings for cache iterator values
76217b54 stringapi: Command names
43820d6f stringapi: Use strings for program paths
2e695d44 stringapi: Use strings for generator names
c88ddb0a stringapi: Use strings for directories
44cccc30 stringapi: Add string overload for the Def struct
d320ee82 stringapi: Miscellaneous char* parameters
06ca6668 typo: Match argument name with the header
b6df3ebc stringapi: Pass strings as install directories in CPack
ef42507a stringapi: Use strings for feature arguments
9aea0925 stringapi: Return a string reference for the configuration
...
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc5ba1f09b42605d43988f995cf1919b48470798
commit fc5ba1f09b42605d43988f995cf1919b48470798
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 7 10:53:45 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:27 2014 -0500
CPackWiX: Fix test to build with expected config
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 854b239..7b4d149 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -829,6 +829,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
if(WIX_LIGHT_EXECUTABLE)
add_test(CPackWiXGenerator ${CMAKE_CTEST_COMMAND}
+ -C \${CTEST_CONFIGURATION_TYPE}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator"
"${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
@@ -837,6 +838,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-options ${build_options}
--test-command ${CMAKE_CMAKE_COMMAND}
"-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
+ "-Dconfig=\${CTEST_CONFIGURATION_TYPE}"
-P "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake")
endif()
endif()
diff --git a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
index 30e33cf..ca9fd90 100644
--- a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
+++ b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
@@ -10,7 +10,12 @@ message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")
message(STATUS "CMAKE_CPACK_COMMAND: ${CMAKE_CPACK_COMMAND}")
message(STATUS "CPackWiXGenerator_BINARY_DIR: ${CPackWiXGenerator_BINARY_DIR}")
+if(config)
+ set(_C_config -C ${config})
+endif()
+
execute_process(COMMAND "${CMAKE_CPACK_COMMAND}"
+ ${_C_config}
RESULT_VARIABLE CPack_result
OUTPUT_VARIABLE CPack_output
ERROR_VARIABLE CPack_error
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aee8464ebc460b9370a98d42757283e3425175ef
commit aee8464ebc460b9370a98d42757283e3425175ef
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu Mar 6 17:22:09 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:26 2014 -0500
stringapi: Prevent a NULL dereference in WiX
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index a8e104b..3915b31 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1089,7 +1089,7 @@ int cmCPackGenerator::DoPackage()
* may update this during PackageFiles.
* (either putting several names or updating the provided one)
*/
- packageFileNames.push_back(tempPackageFileName);
+ packageFileNames.push_back(tempPackageFileName ? tempPackageFileName : "");
toplevel = tempDirectory;
if ( !this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag())
{
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea31d0e057b5c580303ae06e181c240ef6c1a3a0
commit ea31d0e057b5c580303ae06e181c240ef6c1a3a0
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 20:31:04 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:26 2014 -0500
speedup: Avoid excess iterator dereferences
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index d41cee6..2cdc976 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -477,24 +477,26 @@ cmGlobalUnixMakefileGenerator3
for(cmGeneratorTargetsType::iterator l = targets.begin();
l != targets.end(); ++l)
{
- if((l->second->GetType() == cmTarget::EXECUTABLE) ||
- (l->second->GetType() == cmTarget::STATIC_LIBRARY) ||
- (l->second->GetType() == cmTarget::SHARED_LIBRARY) ||
- (l->second->GetType() == cmTarget::MODULE_LIBRARY) ||
- (l->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
- (l->second->GetType() == cmTarget::UTILITY))
+ cmGeneratorTarget* gtarget = l->second;
+ int type = gtarget->GetType();
+ if((type == cmTarget::EXECUTABLE) ||
+ (type == cmTarget::STATIC_LIBRARY) ||
+ (type == cmTarget::SHARED_LIBRARY) ||
+ (type == cmTarget::MODULE_LIBRARY) ||
+ (type == cmTarget::OBJECT_LIBRARY) ||
+ (type == cmTarget::UTILITY))
{
- if(l->second->Target->IsImported())
+ if(gtarget->Target->IsImported())
{
continue;
}
// Add this to the list of depends rules in this directory.
- if((!check_all || !l->second->GetPropertyAsBool("EXCLUDE_FROM_ALL")) &&
+ if((!check_all || !gtarget->GetPropertyAsBool("EXCLUDE_FROM_ALL")) &&
(!check_relink ||
- l->second->Target
+ gtarget->Target
->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str())))
{
- std::string tname = lg->GetRelativeTargetDirectory(*l->second->Target);
+ std::string tname = lg->GetRelativeTargetDirectory(*gtarget->Target);
tname += "/";
tname += pass;
depends.push_back(tname);
@@ -643,45 +645,48 @@ cmGlobalUnixMakefileGenerator3
for(cmGeneratorTargetsType::iterator t = targets.begin();
t != targets.end(); ++t)
{
- if(t->second->Target->IsImported())
+ cmGeneratorTarget* gtarget = t->second;
+ if(gtarget->Target->IsImported())
{
continue;
}
// Don't emit the same rule twice (e.g. two targets with the same
// simple name)
- if(!t->second->GetName().empty() &&
- emitted.insert(t->second->GetName()).second &&
+ int type = gtarget->GetType();
+ std::string name = gtarget->GetName();
+ if(!name.empty() &&
+ emitted.insert(name).second &&
// Handle user targets here. Global targets are handled in
// the local generator on a per-directory basis.
- ((t->second->GetType() == cmTarget::EXECUTABLE) ||
- (t->second->GetType() == cmTarget::STATIC_LIBRARY) ||
- (t->second->GetType() == cmTarget::SHARED_LIBRARY) ||
- (t->second->GetType() == cmTarget::MODULE_LIBRARY) ||
- (t->second->GetType() == cmTarget::OBJECT_LIBRARY) ||
- (t->second->GetType() == cmTarget::UTILITY)))
+ ((type == cmTarget::EXECUTABLE) ||
+ (type == cmTarget::STATIC_LIBRARY) ||
+ (type == cmTarget::SHARED_LIBRARY) ||
+ (type == cmTarget::MODULE_LIBRARY) ||
+ (type == cmTarget::OBJECT_LIBRARY) ||
+ (type == cmTarget::UTILITY)))
{
// Add a rule to build the target by name.
lg->WriteDivider(ruleFileStream);
ruleFileStream
<< "# Target rules for targets named "
- << t->second->GetName() << "\n\n";
+ << name << "\n\n";
// Write the rule.
commands.clear();
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
tmp += "Makefile2";
commands.push_back(lg->GetRecursiveMakeCall
- (tmp.c_str(),t->second->GetName()));
+ (tmp.c_str(),name));
depends.clear();
depends.push_back("cmake_check_build_system");
lg->WriteMakeRule(ruleFileStream,
"Build rule for target.",
- t->second->GetName(), depends, commands,
+ name, depends, commands,
true);
// Add a fast rule to build the target
std::string localName =
- lg->GetRelativeTargetDirectory(*t->second->Target);
+ lg->GetRelativeTargetDirectory(*gtarget->Target);
std::string makefileName;
makefileName = localName;
makefileName += "/build.make";
@@ -689,7 +694,7 @@ cmGlobalUnixMakefileGenerator3
commands.clear();
std::string makeTargetName = localName;
makeTargetName += "/build";
- localName = t->second->GetName();
+ localName = name;
localName += "/fast";
commands.push_back(lg->GetRecursiveMakeCall
(makefileName.c_str(), makeTargetName.c_str()));
@@ -698,12 +703,12 @@ cmGlobalUnixMakefileGenerator3
// Add a local name for the rule to relink the target before
// installation.
- if(t->second->Target
+ if(gtarget->Target
->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
{
- makeTargetName = lg->GetRelativeTargetDirectory(*t->second->Target);
+ makeTargetName = lg->GetRelativeTargetDirectory(*gtarget->Target);
makeTargetName += "/preinstall";
- localName = t->second->GetName();
+ localName = name;
localName += "/preinstall";
depends.clear();
commands.clear();
@@ -741,25 +746,28 @@ cmGlobalUnixMakefileGenerator3
for(cmGeneratorTargetsType::iterator t = targets.begin();
t != targets.end(); ++t)
{
- if(t->second->Target->IsImported())
+ cmGeneratorTarget* gtarget = t->second;
+ if(gtarget->Target->IsImported())
{
continue;
}
- if (!t->second->GetName().empty()
- && ((t->second->GetType() == cmTarget::EXECUTABLE)
- || (t->second->GetType() == cmTarget::STATIC_LIBRARY)
- || (t->second->GetType() == cmTarget::SHARED_LIBRARY)
- || (t->second->GetType() == cmTarget::MODULE_LIBRARY)
- || (t->second->GetType() == cmTarget::OBJECT_LIBRARY)
- || (t->second->GetType() == cmTarget::UTILITY)))
+ int type = gtarget->GetType();
+ std::string name = gtarget->GetName();
+ if (!name.empty()
+ && ( (type == cmTarget::EXECUTABLE)
+ || (type == cmTarget::STATIC_LIBRARY)
+ || (type == cmTarget::SHARED_LIBRARY)
+ || (type == cmTarget::MODULE_LIBRARY)
+ || (type == cmTarget::OBJECT_LIBRARY)
+ || (type == cmTarget::UTILITY)))
{
std::string makefileName;
// Add a rule to build the target by name.
- localName = lg->GetRelativeTargetDirectory(*t->second->Target);
+ localName = lg->GetRelativeTargetDirectory(*gtarget->Target);
makefileName = localName;
makefileName += "/build.make";
- bool needRequiresStep = this->NeedRequiresStep(*t->second->Target);
+ bool needRequiresStep = this->NeedRequiresStep(*gtarget->Target);
lg->WriteDivider(ruleFileStream);
ruleFileStream
@@ -801,7 +809,7 @@ cmGlobalUnixMakefileGenerator3
cmLocalGenerator::SHELL);
progCmd << " ";
std::vector<unsigned long>& progFiles =
- this->ProgressMap[t->second->Target].Marks;
+ this->ProgressMap[gtarget->Target].Marks;
for (std::vector<unsigned long>::iterator i = progFiles.begin();
i != progFiles.end(); ++i)
{
@@ -810,15 +818,15 @@ cmGlobalUnixMakefileGenerator3
commands.push_back(progCmd.str());
}
progressDir = "Built target ";
- progressDir += t->second->GetName();
+ progressDir += name;
lg->AppendEcho(commands,progressDir.c_str());
- this->AppendGlobalTargetDepends(depends,*t->second->Target);
+ this->AppendGlobalTargetDepends(depends,*gtarget->Target);
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
localName.c_str(), depends, commands, true);
// add the all/all dependency
- if(!this->IsExcluded(this->LocalGenerators[0], *t->second->Target))
+ if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
{
depends.clear();
depends.push_back(localName);
@@ -843,7 +851,7 @@ cmGlobalUnixMakefileGenerator3
//
std::set<cmTarget const*> emitted;
progCmd << " "
- << this->CountProgressMarksInTarget(t->second->Target, emitted);
+ << this->CountProgressMarksInTarget(gtarget->Target, emitted);
commands.push_back(progCmd.str());
}
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
@@ -861,7 +869,7 @@ cmGlobalUnixMakefileGenerator3
}
depends.clear();
depends.push_back("cmake_check_build_system");
- localName = lg->GetRelativeTargetDirectory(*t->second->Target);
+ localName = lg->GetRelativeTargetDirectory(*gtarget->Target);
localName += "/rule";
lg->WriteMakeRule(ruleFileStream,
"Build rule for subdir invocation for target.",
@@ -872,13 +880,13 @@ cmGlobalUnixMakefileGenerator3
depends.clear();
depends.push_back(localName);
lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
- t->second->GetName(), depends, commands, true);
+ name, depends, commands, true);
// Add rules to prepare the target for installation.
- if(t->second->Target
+ if(gtarget->Target
->NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
{
- localName = lg->GetRelativeTargetDirectory(*t->second->Target);
+ localName = lg->GetRelativeTargetDirectory(*gtarget->Target);
localName += "/preinstall";
depends.clear();
commands.clear();
@@ -888,7 +896,7 @@ cmGlobalUnixMakefileGenerator3
"Pre-install relink rule for target.",
localName.c_str(), depends, commands, true);
- if(!this->IsExcluded(this->LocalGenerators[0], *t->second->Target))
+ if(!this->IsExcluded(this->LocalGenerators[0], *gtarget->Target))
{
depends.clear();
depends.push_back(localName);
@@ -899,7 +907,7 @@ cmGlobalUnixMakefileGenerator3
}
// add the clean rule
- localName = lg->GetRelativeTargetDirectory(*t->second->Target);
+ localName = lg->GetRelativeTargetDirectory(*gtarget->Target);
makeTargetName = localName;
makeTargetName += "/clean";
depends.clear();
@@ -1066,18 +1074,21 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
cmTargets& targets = lg2->GetMakefile()->GetTargets();
for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
{
- if((t->second.GetType() == cmTarget::EXECUTABLE) ||
- (t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
- (t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
- (t->second.GetType() == cmTarget::MODULE_LIBRARY) ||
- (t->second.GetType() == cmTarget::OBJECT_LIBRARY) ||
- (t->second.GetType() == cmTarget::GLOBAL_TARGET) ||
- (t->second.GetType() == cmTarget::UTILITY))
+ cmTarget const& target = t->second;
+ cmTarget::TargetType type = target.GetType();
+ if((type == cmTarget::EXECUTABLE) ||
+ (type == cmTarget::STATIC_LIBRARY) ||
+ (type == cmTarget::SHARED_LIBRARY) ||
+ (type == cmTarget::MODULE_LIBRARY) ||
+ (type == cmTarget::OBJECT_LIBRARY) ||
+ (type == cmTarget::GLOBAL_TARGET) ||
+ (type == cmTarget::UTILITY))
{
- if(emittedTargets.insert(t->second.GetName()).second)
+ std::string name = target.GetName();
+ if(emittedTargets.insert(name).second)
{
path = "... ";
- path += t->second.GetName();
+ path += name;
lg->AppendEcho(commands,path.c_str());
}
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8228195f4ee06abbdbe463b847cc96b117b8f8a1
commit 8228195f4ee06abbdbe463b847cc96b117b8f8a1
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 20:47:20 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:26 2014 -0500
speedup: Cache strings for comparisons
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 4a59704..03f59c4 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -414,12 +414,13 @@ void cmExtraCodeBlocksGenerator
std::string lang = (*si)->GetLanguage();
if (lang == "C" || lang == "CXX")
{
+ std::string srcext = (*si)->GetExtension();
for(std::vector<std::string>::const_iterator
ext = mf->GetSourceExtensions().begin();
ext != mf->GetSourceExtensions().end();
++ext)
{
- if ((*si)->GetExtension() == *ext)
+ if (srcext == *ext)
{
isCFile = true;
break;
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 15fe8bb..5a9e125 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -223,12 +223,13 @@ void cmExtraCodeLiteGenerator
std::string lang = (*si)->GetLanguage();
if (lang == "C" || lang == "CXX")
{
+ std::string srcext = (*si)->GetExtension();
for(std::vector<std::string>::const_iterator
ext = mf->GetSourceExtensions().begin();
ext != mf->GetSourceExtensions().end();
++ext)
{
- if ((*si)->GetExtension() == *ext)
+ if (srcext == *ext)
{
isCFile = true;
break;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10d6ac8378de3a734d1521de2eb99829b0517e17
commit 10d6ac8378de3a734d1521de2eb99829b0517e17
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 20:32:55 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:26 2014 -0500
stringapi: Use strings for dependency information
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 4dd81be..dd99c43 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -78,7 +78,7 @@ bool cmFLTKWrapUICommand
commandLines.push_back(commandLine);
// Add command for generating the .h and .cxx files
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
const char* no_comment = 0;
const char* no_working_dir = 0;
this->Makefile->AddCustomCommandToOutput(cxxres.c_str(),
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 08c1397..ab4380c 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -316,7 +316,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
// file as the main dependency because it would get
// overwritten by the CreateVCProjBuildRule.
// (this could be avoided with per-target source files)
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
if(cmSourceFile* file =
mf->AddCustomCommandToOutput(
stamps, listFiles,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index efd1ca0..fabab33 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -747,7 +747,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
this->Makefile->AddCustomCommandToOutput(
targetFullPath.c_str(),
objVector,
- 0,
+ "",
commandLines,
comment.c_str(),
this->Makefile->GetStartOutputDirectory()
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 0e246a5..f1fd994 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -578,7 +578,7 @@ cmLocalVisualStudio6Generator
std::string comment = this->ConstructComment(origCommand, "<hack>");
// Add the rule with the given dependencies and commands.
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
if(cmSourceFile* outsf =
this->Makefile->AddCustomCommandToOutput(
output, depends, no_main_dependency,
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 0bbafd8..4491140 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -141,7 +141,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
force_command.push_back(".");
cmCustomCommandLines force_commands;
force_commands.push_back(force_command);
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
std::string force = this->Makefile->GetStartOutputDirectory();
force += cmake::GetCMakeFilesDirectory();
force += "/";
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a083c78..92177c8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -950,7 +950,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
cmSourceFile*
cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
- const char* main_dependency,
+ const std::string& main_dependency,
const cmCustomCommandLines& commandLines,
const char* comment,
const char* workingDir,
@@ -980,7 +980,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
// Choose a source file on which to store the custom command.
cmSourceFile* file = 0;
- if(main_dependency && main_dependency[0])
+ if(!main_dependency.empty())
{
// The main dependency was specified. Use it unless a different
// custom command already used it.
@@ -1048,7 +1048,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
// Construct a complete list of dependencies.
std::vector<std::string> depends2(depends);
- if(main_dependency && main_dependency[0])
+ if(!main_dependency.empty())
{
depends2.push_back(main_dependency);
}
@@ -1104,7 +1104,7 @@ cmMakefile::UpdateOutputToSourceMap(std::string const& output,
cmSourceFile*
cmMakefile::AddCustomCommandToOutput(const std::string& output,
const std::vector<std::string>& depends,
- const char* main_dependency,
+ const std::string& main_dependency,
const cmCustomCommandLines& commandLines,
const char* comment,
const char* workingDir,
@@ -1123,7 +1123,7 @@ void
cmMakefile::AddCustomCommandOldStyle(const std::string& target,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
- const char* source,
+ const std::string& source,
const cmCustomCommandLines& commandLines,
const char* comment)
{
@@ -1160,7 +1160,7 @@ cmMakefile::AddCustomCommandOldStyle(const std::string& target,
else
{
// The source may not be a real file. Do not use a main dependency.
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
std::vector<std::string> depends2 = depends;
depends2.push_back(source);
sf = this->AddCustomCommandToOutput(output, depends2, no_main_dependency,
@@ -1251,7 +1251,7 @@ cmMakefile::AddUtilityCommand(const std::string& utilityName,
force += cmake::GetCMakeFilesDirectory();
force += "/";
force += utilityName;
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
bool no_replace = false;
this->AddCustomCommandToOutput(force.c_str(), depends,
no_main_dependency,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index fb40c1b..460a85c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -177,7 +177,7 @@ public:
cmSourceFile* AddCustomCommandToOutput(
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
- const char* main_dependency,
+ const std::string& main_dependency,
const cmCustomCommandLines& commandLines,
const char* comment, const char* workingDir,
bool replace = false,
@@ -185,7 +185,7 @@ public:
cmSourceFile* AddCustomCommandToOutput(
const std::string& output,
const std::vector<std::string>& depends,
- const char* main_dependency,
+ const std::string& main_dependency,
const cmCustomCommandLines& commandLines,
const char* comment, const char* workingDir,
bool replace = false,
@@ -193,7 +193,7 @@ public:
void AddCustomCommandOldStyle(const std::string& target,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
- const char* source,
+ const std::string& source,
const cmCustomCommandLines& commandLines,
const char* comment);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f0c9a3f..28a8f04 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1496,8 +1496,9 @@ cmMakefileTargetGenerator
}
//----------------------------------------------------------------------------
-void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
- bool relink)
+void cmMakefileTargetGenerator::WriteTargetDriverRule(
+ const std::string& main_output,
+ bool relink)
{
// Compute the name of the driver target.
std::string dir =
@@ -1510,10 +1511,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
// Build the list of target outputs to drive.
std::vector<std::string> depends;
- if(main_output)
- {
- depends.push_back(main_output);
- }
+ depends.push_back(main_output);
const char* comment = 0;
if(relink)
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 573ce22..bed945b 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -119,7 +119,7 @@ protected:
std::string::size_type limit = std::string::npos);
// write the driver rule to build target outputs
- void WriteTargetDriverRule(const char* main_output, bool relink);
+ void WriteTargetDriverRule(const std::string& main_output, bool relink);
void DriveCustomCommands(std::vector<std::string>& depends);
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index 0d3c994..ca007cb 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -97,7 +97,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& argsIn,
depends.push_back(moc_exe);
depends.push_back(hname);
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
const char* no_working_dir = 0;
this->Makefile->AddCustomCommandToOutput(newName.c_str(),
depends,
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index a6a4b51..2a1129d 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -128,7 +128,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& argsIn,
std::vector<std::string> depends;
depends.push_back(uiName);
- const char* no_main_dependency = 0;
+ std::string no_main_dependency = "";
const char* no_comment = 0;
const char* no_working_dir = 0;
this->Makefile->AddCustomCommandToOutput(hName.c_str(),
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b3c37015af7cf066ee8aa366f2eb705a371468d
commit 6b3c37015af7cf066ee8aa366f2eb705a371468d
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 20:24:01 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:25 2014 -0500
stringapi: Use strings for cache iterator values
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 7929ce7..682f95f 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -51,7 +51,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
{
case cmCacheManager::BOOL:
this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1);
- if (cmSystemTools::IsOn(it.GetValue()))
+ if (cmSystemTools::IsOn(it.GetValue().c_str()))
{
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true);
}
@@ -94,7 +94,8 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
}
break;
case cmCacheManager::UNINITIALIZED:
- cmSystemTools::Error("Found an undefined variable: ", it.GetName());
+ cmSystemTools::Error("Found an undefined variable: ",
+ it.GetName().c_str());
break;
default:
// TODO : put warning message here
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 0fe5f8c..12da320 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -111,7 +111,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
cmCacheManager::CacheIterator itm = cachem->NewIterator();
if ( itm.Find("CMAKE_HOME_DIRECTORY"))
{
- setSourceDirectory(QString::fromLocal8Bit(itm.GetValue()));
+ setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str()));
}
if ( itm.Find("CMAKE_GENERATOR"))
{
@@ -201,11 +201,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
}
QCMakeProperty prop;
- prop.Key = QString::fromLocal8Bit(i.GetName());
+ prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
int idx = props.indexOf(prop);
if(idx == -1)
{
- toremove.append(QString::fromLocal8Bit(i.GetName()));
+ toremove.append(QString::fromLocal8Bit(i.GetName().c_str()));
}
else
{
@@ -286,15 +286,15 @@ QCMakePropertyList QCMake::properties() const
}
QCMakeProperty prop;
- prop.Key = QString::fromLocal8Bit(i.GetName());
+ prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING"));
- prop.Value = QString::fromLocal8Bit(i.GetValue());
+ prop.Value = QString::fromLocal8Bit(i.GetValue().c_str());
prop.Advanced = i.GetPropertyAsBool("ADVANCED");
if(i.GetType() == cmCacheManager::BOOL)
{
prop.Type = QCMakeProperty::BOOL;
- prop.Value = cmSystemTools::IsOn(i.GetValue());
+ prop.Value = cmSystemTools::IsOn(i.GetValue().c_str());
}
else if(i.GetType() == cmCacheManager::PATH)
{
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 07a8675..d9a9112 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -56,8 +56,8 @@ public:
bool Find(const std::string&);
bool IsAtEnd() const;
void Next();
- const char *GetName() const {
- return this->Position->first.c_str(); }
+ std::string GetName() const {
+ return this->Position->first; }
const char* GetProperty(const std::string&) const ;
bool GetPropertyAsBool(const std::string&) const ;
bool PropertyExists(const std::string&) const;
@@ -65,7 +65,7 @@ public:
void AppendProperty(const std::string& property, const char* value,
bool asString=false);
void SetProperty(const std::string& property, bool value);
- const char* GetValue() const { return this->GetEntry().Value.c_str(); }
+ std::string GetValue() const { return this->GetEntry().Value; }
bool GetValueAsBool() const;
void SetValue(const char*);
CacheEntryType GetType() const { return this->GetEntry().Type; }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e8be29f..a083c78 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1796,7 +1796,8 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
cmCacheManager::CacheEntryType type,
bool force)
{
- const char* val = value;
+ bool haveVal = value ? true : false;
+ std::string val = haveVal ? value : "";
cmCacheManager::CacheIterator it =
this->GetCacheManager()->GetCacheIterator(name.c_str());
if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) &&
@@ -1807,6 +1808,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
if(!force)
{
val = it.GetValue();
+ haveVal = true;
}
if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH )
{
@@ -1829,10 +1831,12 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type);
val = it.GetValue();
+ haveVal = true;
}
}
- this->GetCacheManager()->AddCacheEntry(name, val, doc, type);
+ this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, doc,
+ type);
// if there was a definition then remove it
this->Internal->VarStack.top().Set(name, 0);
}
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 776a3a4..dbe2478 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -55,10 +55,7 @@ bool cmOptionCommand
it.SetProperty("HELPSTRING", args[1].c_str());
return true;
}
- if ( it.GetValue() )
- {
- initialValue = it.GetValue();
- }
+ initialValue = it.GetValue();
}
if(args.size() == 3)
{
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76217b54af8552202e8135dc1f0174f3bd2fc0f3
commit 76217b54af8552202e8135dc1f0174f3bd2fc0f3
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 20:19:17 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:25 2014 -0500
stringapi: Command names
diff --git a/Source/CTest/cmCTestBuildCommand.h b/Source/CTest/cmCTestBuildCommand.h
index 08887fe..2632ebc 100644
--- a/Source/CTest/cmCTestBuildCommand.h
+++ b/Source/CTest/cmCTestBuildCommand.h
@@ -43,7 +43,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_build";}
+ virtual std::string GetName() const { return "ctest_build";}
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
diff --git a/Source/CTest/cmCTestConfigureCommand.h b/Source/CTest/cmCTestConfigureCommand.h
index b592c5a..7941d4e 100644
--- a/Source/CTest/cmCTestConfigureCommand.h
+++ b/Source/CTest/cmCTestConfigureCommand.h
@@ -38,7 +38,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_configure";}
+ virtual std::string GetName() const { return "ctest_configure";}
cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand);
diff --git a/Source/CTest/cmCTestCoverageCommand.h b/Source/CTest/cmCTestCoverageCommand.h
index 3731592..5762e07 100644
--- a/Source/CTest/cmCTestCoverageCommand.h
+++ b/Source/CTest/cmCTestCoverageCommand.h
@@ -39,7 +39,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_coverage";}
+ virtual std::string GetName() const { return "ctest_coverage";}
cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand);
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
index 07e59a4..d182d17 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h
@@ -48,7 +48,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_empty_binary_directory";}
+ virtual std::string GetName() const { return "ctest_empty_binary_directory";}
cmTypeMacro(cmCTestEmptyBinaryDirectoryCommand, cmCTestCommand);
diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h
index b50170d..e239d46 100644
--- a/Source/CTest/cmCTestMemCheckCommand.h
+++ b/Source/CTest/cmCTestMemCheckCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_memcheck";}
+ virtual std::string GetName() const { return "ctest_memcheck";}
cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand);
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h
index 9c0af81..c95694a 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.h
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.h
@@ -46,7 +46,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_read_custom_files";}
+ virtual std::string GetName() const { return "ctest_read_custom_files";}
cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand);
diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h
index f34bd13..0998e5c 100644
--- a/Source/CTest/cmCTestRunScriptCommand.h
+++ b/Source/CTest/cmCTestRunScriptCommand.h
@@ -47,7 +47,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_run_script";}
+ virtual std::string GetName() const { return "ctest_run_script";}
cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand);
};
diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h
index c6baf1c..740a7e1 100644
--- a/Source/CTest/cmCTestSleepCommand.h
+++ b/Source/CTest/cmCTestSleepCommand.h
@@ -47,7 +47,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_sleep";}
+ virtual std::string GetName() const { return "ctest_sleep";}
cmTypeMacro(cmCTestSleepCommand, cmCTestCommand);
diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h
index e5535c1..3b8843f 100644
--- a/Source/CTest/cmCTestStartCommand.h
+++ b/Source/CTest/cmCTestStartCommand.h
@@ -55,7 +55,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_start";}
+ virtual std::string GetName() const { return "ctest_start";}
cmTypeMacro(cmCTestStartCommand, cmCTestCommand);
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index 64c6cae..3673fbd 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -48,7 +48,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_submit";}
+ virtual std::string GetName() const { return "ctest_submit";}
cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 451ac99..a1e5f36 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -39,7 +39,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_test";}
+ virtual std::string GetName() const { return "ctest_test";}
cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b1dddcb..5970656 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -60,7 +60,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "subdirs";}
+ virtual std::string GetName() const { return "subdirs";}
cmTypeMacro(cmCTestSubdirCommand, cmCommand);
@@ -157,7 +157,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_subdirectory";}
+ virtual std::string GetName() const { return "add_subdirectory";}
cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand);
@@ -243,7 +243,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_test";}
+ virtual std::string GetName() const { return "add_test";}
cmTypeMacro(cmCTestAddTestCommand, cmCommand);
@@ -287,7 +287,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_tests_properties";}
+ virtual std::string GetName() const { return "set_tests_properties";}
cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand);
diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h
index a785bd8..fb80333 100644
--- a/Source/CTest/cmCTestUpdateCommand.h
+++ b/Source/CTest/cmCTestUpdateCommand.h
@@ -39,7 +39,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_update";}
+ virtual std::string GetName() const { return "ctest_update";}
cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand);
diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h
index e867fb6..4a07608 100644
--- a/Source/CTest/cmCTestUploadCommand.h
+++ b/Source/CTest/cmCTestUploadCommand.h
@@ -43,7 +43,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "ctest_upload";}
+ virtual std::string GetName() const { return "ctest_upload";}
cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand);
diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h
index 38ed208..f147ec0 100644
--- a/Source/cmAddCompileOptionsCommand.h
+++ b/Source/cmAddCompileOptionsCommand.h
@@ -35,7 +35,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "add_compile_options";}
+ virtual std::string GetName() const {return "add_compile_options";}
cmTypeMacro(cmAddCompileOptionsCommand, cmCommand);
};
diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h
index 114957f..1d6ddb2 100644
--- a/Source/cmAddCustomCommandCommand.h
+++ b/Source/cmAddCustomCommandCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "add_custom_command";}
+ virtual std::string GetName() const {return "add_custom_command";}
cmTypeMacro(cmAddCustomCommandCommand, cmCommand);
protected:
diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h
index d0fcdad..d2b00ad 100644
--- a/Source/cmAddCustomTargetCommand.h
+++ b/Source/cmAddCustomTargetCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const
+ virtual std::string GetName() const
{return "add_custom_target";}
cmTypeMacro(cmAddCustomTargetCommand, cmCommand);
diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h
index d05f187..9800fd2 100644
--- a/Source/cmAddDefinitionsCommand.h
+++ b/Source/cmAddDefinitionsCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "add_definitions";}
+ virtual std::string GetName() const {return "add_definitions";}
cmTypeMacro(cmAddDefinitionsCommand, cmCommand);
};
diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h
index 247cc54..db3712a 100644
--- a/Source/cmAddDependenciesCommand.h
+++ b/Source/cmAddDependenciesCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_dependencies";}
+ virtual std::string GetName() const { return "add_dependencies";}
cmTypeMacro(cmAddDependenciesCommand, cmCommand);
};
diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h
index 30ecce3..e134077 100644
--- a/Source/cmAddExecutableCommand.h
+++ b/Source/cmAddExecutableCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_executable";}
+ virtual std::string GetName() const { return "add_executable";}
cmTypeMacro(cmAddExecutableCommand, cmCommand);
};
diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h
index 1001043..350708b 100644
--- a/Source/cmAddLibraryCommand.h
+++ b/Source/cmAddLibraryCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_library";}
+ virtual std::string GetName() const { return "add_library";}
cmTypeMacro(cmAddLibraryCommand, cmCommand);
};
diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h
index 1e5b1ab..abf3efc 100644
--- a/Source/cmAddSubDirectoryCommand.h
+++ b/Source/cmAddSubDirectoryCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_subdirectory";}
+ virtual std::string GetName() const { return "add_subdirectory";}
cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
};
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index 9173454..624288f 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_test";}
+ virtual std::string GetName() const { return "add_test";}
cmTypeMacro(cmAddTestCommand, cmCommand);
private:
diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h
index 8b5fa8a..6615273 100644
--- a/Source/cmAuxSourceDirectoryCommand.h
+++ b/Source/cmAuxSourceDirectoryCommand.h
@@ -44,7 +44,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "aux_source_directory";}
+ virtual std::string GetName() const { return "aux_source_directory";}
cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);
};
diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h
index 52f0e9c..1fcae50 100644
--- a/Source/cmBreakCommand.h
+++ b/Source/cmBreakCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "break";}
+ virtual std::string GetName() const {return "break";}
cmTypeMacro(cmBreakCommand, cmCommand);
};
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index 2160655..3fb618f 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -50,7 +50,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "build_command";}
+ virtual std::string GetName() const {return "build_command";}
cmTypeMacro(cmBuildCommand, cmCommand);
};
diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h
index 2f7acde..8f8038f 100644
--- a/Source/cmBuildNameCommand.h
+++ b/Source/cmBuildNameCommand.h
@@ -21,7 +21,7 @@ public:
virtual cmCommand* Clone() { return new cmBuildNameCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const {return "build_name";}
+ virtual std::string GetName() const {return "build_name";}
virtual bool IsScriptable() const { return true; }
virtual bool IsDiscouraged() const { return true; }
};
diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h
index 27ba638..463b180 100644
--- a/Source/cmCMakeHostSystemInformationCommand.h
+++ b/Source/cmCMakeHostSystemInformationCommand.h
@@ -48,7 +48,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const
+ virtual std::string GetName() const
{
return "cmake_host_system_information";
}
diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h
index 0cdd4c5..31b7271 100644
--- a/Source/cmCMakeMinimumRequired.h
+++ b/Source/cmCMakeMinimumRequired.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "cmake_minimum_required";}
+ virtual std::string GetName() const {return "cmake_minimum_required";}
cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index 7e3f4e6..8dc8fbe 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -46,7 +46,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "cmake_policy";}
+ virtual std::string GetName() const {return "cmake_policy";}
cmTypeMacro(cmCMakePolicyCommand, cmCommand);
private:
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 2378ef0..b15869a 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -124,7 +124,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const = 0;
+ virtual std::string GetName() const = 0;
/**
* Enable the command.
diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h
index 86de92c..8155ef7 100644
--- a/Source/cmConfigureFileCommand.h
+++ b/Source/cmConfigureFileCommand.h
@@ -34,7 +34,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "configure_file";}
+ virtual std::string GetName() const { return "configure_file";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h
index 8b1e4de..2f6b541 100644
--- a/Source/cmCreateTestSourceList.h
+++ b/Source/cmCreateTestSourceList.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "create_test_sourcelist";}
+ virtual std::string GetName() const {return "create_test_sourcelist";}
cmTypeMacro(cmCreateTestSourceList, cmCommand);
};
diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h
index 8dc4d96..bc5c8a4 100644
--- a/Source/cmDefinePropertyCommand.h
+++ b/Source/cmDefinePropertyCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "define_property";}
+ virtual std::string GetName() const { return "define_property";}
cmTypeMacro(cmDefinePropertyCommand, cmCommand);
private:
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index 636860d..d796da8 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -34,8 +34,8 @@ public:
void Clear() { this->Entries.clear(); }
/** Return the name of this section. */
- const char* GetName() const
- { return this->Name.c_str(); }
+ std::string GetName() const
+ { return this->Name; }
/** Return a pointer to the first entry of this section. */
const std::vector<cmDocumentationEntry> &GetEntries() const
diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h
index d472e99..dde5fcc 100644
--- a/Source/cmElseCommand.h
+++ b/Source/cmElseCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "else";}
+ virtual std::string GetName() const { return "else";}
cmTypeMacro(cmElseCommand, cmCommand);
};
diff --git a/Source/cmElseIfCommand.h b/Source/cmElseIfCommand.h
index d811b35..c627cbe 100644
--- a/Source/cmElseIfCommand.h
+++ b/Source/cmElseIfCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "elseif";}
+ virtual std::string GetName() const { return "elseif";}
cmTypeMacro(cmElseIfCommand, cmCommand);
};
diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h
index a248042..2b09e11 100644
--- a/Source/cmEnableLanguageCommand.h
+++ b/Source/cmEnableLanguageCommand.h
@@ -43,7 +43,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "enable_language";}
+ virtual std::string GetName() const {return "enable_language";}
cmTypeMacro(cmEnableLanguageCommand, cmCommand);
};
diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h
index e102f5e..d028c59 100644
--- a/Source/cmEnableTestingCommand.h
+++ b/Source/cmEnableTestingCommand.h
@@ -48,7 +48,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "enable_testing";}
+ virtual std::string GetName() const { return "enable_testing";}
cmTypeMacro(cmEnableTestingCommand, cmCommand);
diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h
index 44d29b5..c3be387 100644
--- a/Source/cmEndForEachCommand.h
+++ b/Source/cmEndForEachCommand.h
@@ -52,7 +52,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "endforeach";}
+ virtual std::string GetName() const { return "endforeach";}
cmTypeMacro(cmEndForEachCommand, cmCommand);
};
diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h
index 4fdca6b..3a42c17 100644
--- a/Source/cmEndFunctionCommand.h
+++ b/Source/cmEndFunctionCommand.h
@@ -52,7 +52,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "endfunction";}
+ virtual std::string GetName() const { return "endfunction";}
cmTypeMacro(cmEndFunctionCommand, cmCommand);
};
diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h
index 634da60..a8248c8 100644
--- a/Source/cmEndIfCommand.h
+++ b/Source/cmEndIfCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "endif";}
+ virtual std::string GetName() const { return "endif";}
cmTypeMacro(cmEndIfCommand, cmCommand);
};
diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h
index db15f27..fdc04ee 100644
--- a/Source/cmEndMacroCommand.h
+++ b/Source/cmEndMacroCommand.h
@@ -52,7 +52,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "endmacro";}
+ virtual std::string GetName() const { return "endmacro";}
cmTypeMacro(cmEndMacroCommand, cmCommand);
};
diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h
index 41138d1..ec1cb65 100644
--- a/Source/cmEndWhileCommand.h
+++ b/Source/cmEndWhileCommand.h
@@ -52,7 +52,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "endwhile";}
+ virtual std::string GetName() const { return "endwhile";}
cmTypeMacro(cmEndWhileCommand, cmCommand);
};
diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h
index 6d28cdc..23d10f9 100644
--- a/Source/cmExecProgramCommand.h
+++ b/Source/cmExecProgramCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const
+ virtual std::string GetName() const
{return "exec_program";}
/**
diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h
index bd0f783..6906a08 100644
--- a/Source/cmExecuteProcessCommand.h
+++ b/Source/cmExecuteProcessCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const
+ virtual std::string GetName() const
{return "execute_process";}
/**
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index c0e445f..f9506bb 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "export";}
+ virtual std::string GetName() const { return "export";}
cmTypeMacro(cmExportCommand, cmCommand);
diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h
index 29b568f..2ea4e79 100644
--- a/Source/cmExportLibraryDependenciesCommand.h
+++ b/Source/cmExportLibraryDependenciesCommand.h
@@ -21,7 +21,7 @@ public:
virtual cmCommand* Clone() { return new cmExportLibraryDependenciesCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const { return "export_library_dependencies";}
+ virtual std::string GetName() const { return "export_library_dependencies";}
virtual bool IsDiscouraged() const { return true; }
virtual void FinalPass();
diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h
index b94390c..617fcd9 100644
--- a/Source/cmFLTKWrapUICommand.h
+++ b/Source/cmFLTKWrapUICommand.h
@@ -52,7 +52,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "fltk_wrap_ui";}
+ virtual std::string GetName() const { return "fltk_wrap_ui";}
private:
/**
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index ba45815..8d66fdf 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -46,7 +46,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "file";}
+ virtual std::string GetName() const { return "file";}
cmTypeMacro(cmFileCommand, cmCommand);
diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h
index 3f0baa2..daf1d65 100644
--- a/Source/cmFindFileCommand.h
+++ b/Source/cmFindFileCommand.h
@@ -33,7 +33,7 @@ public:
{
return new cmFindFileCommand;
}
- virtual const char* GetName() const { return "find_file";}
+ virtual std::string GetName() const { return "find_file";}
cmTypeMacro(cmFindFileCommand, cmFindPathCommand);
};
diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h
index a9ec40e..e257174 100644
--- a/Source/cmFindLibraryCommand.h
+++ b/Source/cmFindLibraryCommand.h
@@ -49,7 +49,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "find_library";}
+ virtual std::string GetName() const {return "find_library";}
cmTypeMacro(cmFindLibraryCommand, cmFindBase);
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 72c1e3c..2249459 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -49,7 +49,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "find_package";}
+ virtual std::string GetName() const { return "find_package";}
cmTypeMacro(cmFindPackageCommand, cmFindCommon);
private:
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index 8df4540..a51da79 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -49,7 +49,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "find_path";}
+ virtual std::string GetName() const {return "find_path";}
cmTypeMacro(cmFindPathCommand, cmFindBase);
bool IncludeFileInPath;
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index 7f4811c..70f758f 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -48,7 +48,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "find_program";}
+ virtual std::string GetName() const { return "find_program";}
cmTypeMacro(cmFindProgramCommand, cmFindBase);
diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h
index e548ba8..9b7c85a 100644
--- a/Source/cmForEachCommand.h
+++ b/Source/cmForEachCommand.h
@@ -59,7 +59,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "foreach";}
+ virtual std::string GetName() const { return "foreach";}
cmTypeMacro(cmForEachCommand, cmCommand);
private:
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 85b89d9..9b981a3 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -64,7 +64,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return this->Args[0].c_str(); }
+ virtual std::string GetName() const { return this->Args[0]; }
cmTypeMacro(cmFunctionHelperCommand, cmCommand);
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index a8bd3e7..2df435e 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -57,7 +57,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "function";}
+ virtual std::string GetName() const { return "function";}
cmTypeMacro(cmFunctionCommand, cmCommand);
};
diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h
index 6c58bb4..1511406 100644
--- a/Source/cmGetCMakePropertyCommand.h
+++ b/Source/cmGetCMakePropertyCommand.h
@@ -37,7 +37,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_cmake_property";}
+ virtual std::string GetName() const { return "get_cmake_property";}
cmTypeMacro(cmGetCMakePropertyCommand, cmCommand);
};
diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h
index aea04ad..6c5750a 100644
--- a/Source/cmGetDirectoryPropertyCommand.h
+++ b/Source/cmGetDirectoryPropertyCommand.h
@@ -37,7 +37,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_directory_property";}
+ virtual std::string GetName() const { return "get_directory_property";}
cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);
};
diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h
index e2cd219..534de53 100644
--- a/Source/cmGetFilenameComponentCommand.h
+++ b/Source/cmGetFilenameComponentCommand.h
@@ -46,7 +46,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_filename_component";}
+ virtual std::string GetName() const { return "get_filename_component";}
cmTypeMacro(cmGetFilenameComponentCommand, cmCommand);
};
diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h
index e1630ff..8c3738f 100644
--- a/Source/cmGetPropertyCommand.h
+++ b/Source/cmGetPropertyCommand.h
@@ -39,7 +39,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_property";}
+ virtual std::string GetName() const { return "get_property";}
cmTypeMacro(cmGetPropertyCommand, cmCommand);
private:
diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h
index 338318e..ab8ce36 100644
--- a/Source/cmGetSourceFilePropertyCommand.h
+++ b/Source/cmGetSourceFilePropertyCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_source_file_property";}
+ virtual std::string GetName() const { return "get_source_file_property";}
cmTypeMacro(cmGetSourceFilePropertyCommand, cmCommand);
};
diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h
index 4985b3c..a35c6fe 100644
--- a/Source/cmGetTargetPropertyCommand.h
+++ b/Source/cmGetTargetPropertyCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_target_property";}
+ virtual std::string GetName() const { return "get_target_property";}
cmTypeMacro(cmGetTargetPropertyCommand, cmCommand);
};
diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h
index 2dccabe..2819492 100644
--- a/Source/cmGetTestPropertyCommand.h
+++ b/Source/cmGetTestPropertyCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "get_test_property";}
+ virtual std::string GetName() const { return "get_test_property";}
cmTypeMacro(cmGetTestPropertyCommand, cmCommand);
};
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 02d87ed..b9de845 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -63,7 +63,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "if";}
+ virtual std::string GetName() const { return "if";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h
index 267723d..0dcd7de 100644
--- a/Source/cmIncludeCommand.h
+++ b/Source/cmIncludeCommand.h
@@ -46,7 +46,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "include";}
+ virtual std::string GetName() const {return "include";}
cmTypeMacro(cmIncludeCommand, cmCommand);
};
diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h
index c621dcb..6cc2c83 100644
--- a/Source/cmIncludeDirectoryCommand.h
+++ b/Source/cmIncludeDirectoryCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "include_directories";}
+ virtual std::string GetName() const { return "include_directories";}
cmTypeMacro(cmIncludeDirectoryCommand, cmCommand);
diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h
index 8ca674f..081f77a 100644
--- a/Source/cmIncludeExternalMSProjectCommand.h
+++ b/Source/cmIncludeExternalMSProjectCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "include_external_msproject";}
+ virtual std::string GetName() const {return "include_external_msproject";}
cmTypeMacro(cmIncludeExternalMSProjectCommand, cmCommand);
};
diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h
index 0c5fa6f..c58f018 100644
--- a/Source/cmIncludeRegularExpressionCommand.h
+++ b/Source/cmIncludeRegularExpressionCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "include_regular_expression";}
+ virtual std::string GetName() const {return "include_regular_expression";}
cmTypeMacro(cmIncludeRegularExpressionCommand, cmCommand);
};
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 9db2490..8e14a08 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "install";}
+ virtual std::string GetName() const { return "install";}
cmTypeMacro(cmInstallCommand, cmCommand);
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index 5583fe4..4551ab1 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "install_files";}
+ virtual std::string GetName() const { return "install_files";}
/**
* This is called at the end after all the information
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 95acfa2..90c7ba3 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "install_programs";}
+ virtual std::string GetName() const { return "install_programs";}
/**
* This is called at the end after all the information
diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h
index 2aa34db..e6cbe6e 100644
--- a/Source/cmInstallTargetsCommand.h
+++ b/Source/cmInstallTargetsCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "install_targets";}
+ virtual std::string GetName() const { return "install_targets";}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index c6eb40c..8e04baf 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/Source/cmLinkDirectoriesCommand.h
@@ -43,7 +43,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "link_directories";}
+ virtual std::string GetName() const { return "link_directories";}
cmTypeMacro(cmLinkDirectoriesCommand, cmCommand);
private:
diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h
index 74de23c..c572439 100644
--- a/Source/cmLinkLibrariesCommand.h
+++ b/Source/cmLinkLibrariesCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "link_libraries";}
+ virtual std::string GetName() const { return "link_libraries";}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h
index b79ff0d..5ea1d9f 100644
--- a/Source/cmListCommand.h
+++ b/Source/cmListCommand.h
@@ -44,7 +44,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "list";}
+ virtual std::string GetName() const { return "list";}
cmTypeMacro(cmListCommand, cmCommand);
protected:
diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h
index ff8625f..04207d0 100644
--- a/Source/cmLoadCacheCommand.h
+++ b/Source/cmLoadCacheCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "load_cache";}
+ virtual std::string GetName() const { return "load_cache";}
cmTypeMacro(cmLoadCacheCommand, cmCommand);
protected:
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 21ee0fe..36e9980 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -69,7 +69,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return info.Name; }
+ virtual std::string GetName() const { return info.Name; }
static const char* LastName;
static void TrapsForSignals(int sig)
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
index 11bcf09..4581269 100644
--- a/Source/cmLoadCommandCommand.h
+++ b/Source/cmLoadCommandCommand.h
@@ -20,7 +20,7 @@ public:
virtual cmCommand* Clone() { return new cmLoadCommandCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const {return "load_command";}
+ virtual std::string GetName() const {return "load_command";}
virtual bool IsDiscouraged() const { return true; }
cmTypeMacro(cmLoadCommandCommand, cmCommand);
};
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 499d3c6..9d253b8 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -65,7 +65,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return this->Args[0].c_str(); }
+ virtual std::string GetName() const { return this->Args[0]; }
cmTypeMacro(cmMacroHelperCommand, cmCommand);
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index 4c585d8..5c1cc00 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -57,7 +57,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "macro";}
+ virtual std::string GetName() const { return "macro";}
cmTypeMacro(cmMacroCommand, cmCommand);
};
diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h
index 49a4009..71b97eb 100644
--- a/Source/cmMakeDirectoryCommand.h
+++ b/Source/cmMakeDirectoryCommand.h
@@ -44,7 +44,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "make_directory";}
+ virtual std::string GetName() const { return "make_directory";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h
index b65e4a8..38064a3 100644
--- a/Source/cmMarkAsAdvancedCommand.h
+++ b/Source/cmMarkAsAdvancedCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "mark_as_advanced";}
+ virtual std::string GetName() const {return "mark_as_advanced";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h
index c826ef1..76dc102 100644
--- a/Source/cmMathCommand.h
+++ b/Source/cmMathCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "math";}
+ virtual std::string GetName() const { return "math";}
cmTypeMacro(cmMathCommand, cmCommand);
protected:
diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h
index fec9a32..c0ae2a3 100644
--- a/Source/cmMessageCommand.h
+++ b/Source/cmMessageCommand.h
@@ -39,7 +39,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "message";}
+ virtual std::string GetName() const { return "message";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h
index 89e3ac1..12a6472 100644
--- a/Source/cmOptionCommand.h
+++ b/Source/cmOptionCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "option";}
+ virtual std::string GetName() const {return "option";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h
index dd5ed6c..95eba38 100644
--- a/Source/cmOutputRequiredFilesCommand.h
+++ b/Source/cmOutputRequiredFilesCommand.h
@@ -22,7 +22,7 @@ public:
virtual cmCommand* Clone() { return new cmOutputRequiredFilesCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const { return "output_required_files";}
+ virtual std::string GetName() const { return "output_required_files";}
virtual bool IsDiscouraged() const { return true; }
void ListDependencies(cmDependInformation const *info,
diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h
index f7d086d..7aacb55 100644
--- a/Source/cmProjectCommand.h
+++ b/Source/cmProjectCommand.h
@@ -43,7 +43,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "project";}
+ virtual std::string GetName() const {return "project";}
cmTypeMacro(cmProjectCommand, cmCommand);
};
diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h
index 868eb91..85729dd 100644
--- a/Source/cmQTWrapCPPCommand.h
+++ b/Source/cmQTWrapCPPCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "qt_wrap_cpp";}
+ virtual std::string GetName() const { return "qt_wrap_cpp";}
};
diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h
index 3406dac..4aa9a61 100644
--- a/Source/cmQTWrapUICommand.h
+++ b/Source/cmQTWrapUICommand.h
@@ -43,7 +43,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "qt_wrap_ui";}
+ virtual std::string GetName() const { return "qt_wrap_ui";}
};
diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h
index ad73908..94161f8 100644
--- a/Source/cmRemoveCommand.h
+++ b/Source/cmRemoveCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "remove";}
+ virtual std::string GetName() const {return "remove";}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h
index 4e291fc..cac94be 100644
--- a/Source/cmRemoveDefinitionsCommand.h
+++ b/Source/cmRemoveDefinitionsCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "remove_definitions";}
+ virtual std::string GetName() const {return "remove_definitions";}
cmTypeMacro(cmRemoveDefinitionsCommand, cmCommand);
};
diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h
index 2822b62..4ff81ef 100644
--- a/Source/cmReturnCommand.h
+++ b/Source/cmReturnCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "return";}
+ virtual std::string GetName() const {return "return";}
cmTypeMacro(cmReturnCommand, cmCommand);
};
diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h
index ce02360..a527ae7 100644
--- a/Source/cmSeparateArgumentsCommand.h
+++ b/Source/cmSeparateArgumentsCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "separate_arguments";}
+ virtual std::string GetName() const {return "separate_arguments";}
cmTypeMacro(cmSeparateArgumentsCommand, cmCommand);
};
diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h
index 6cef0a0..4adc2d9 100644
--- a/Source/cmSetCommand.h
+++ b/Source/cmSetCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "set";}
+ virtual std::string GetName() const {return "set";}
cmTypeMacro(cmSetCommand, cmCommand);
};
diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h
index 6240598..f444a1b 100644
--- a/Source/cmSetDirectoryPropertiesCommand.h
+++ b/Source/cmSetDirectoryPropertiesCommand.h
@@ -37,7 +37,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_directory_properties";}
+ virtual std::string GetName() const { return "set_directory_properties";}
/**
* Static entry point for use by other commands
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index 5757d21..eaa0233 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -34,7 +34,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_property";}
+ virtual std::string GetName() const { return "set_property";}
/**
* This determines if the command is invoked when in script mode.
diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h
index 8541a96..5fa5a3a 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.h
+++ b/Source/cmSetSourceFilesPropertiesCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_source_files_properties";}
+ virtual std::string GetName() const { return "set_source_files_properties";}
cmTypeMacro(cmSetSourceFilesPropertiesCommand, cmCommand);
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index cfe35df..3981ef3 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_target_properties";}
+ virtual std::string GetName() const { return "set_target_properties";}
/**
* Used by this command and cmSetPropertiesCommand
diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h
index 7f8d57d..dabe944 100644
--- a/Source/cmSetTestsPropertiesCommand.h
+++ b/Source/cmSetTestsPropertiesCommand.h
@@ -32,7 +32,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_tests_properties";}
+ virtual std::string GetName() const { return "set_tests_properties";}
cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h
index eb9d4d8..ec63ef8 100644
--- a/Source/cmSiteNameCommand.h
+++ b/Source/cmSiteNameCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "site_name";}
+ virtual std::string GetName() const {return "site_name";}
cmTypeMacro(cmSiteNameCommand, cmCommand);
};
diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h
index 5d8b48c..410411b 100644
--- a/Source/cmSourceGroupCommand.h
+++ b/Source/cmSourceGroupCommand.h
@@ -41,7 +41,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "source_group";}
+ virtual std::string GetName() const {return "source_group";}
cmTypeMacro(cmSourceGroupCommand, cmCommand);
};
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 66b48e6..b8053c5 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -50,7 +50,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "string";}
+ virtual std::string GetName() const { return "string";}
cmTypeMacro(cmStringCommand, cmCommand);
static void ClearMatches(cmMakefile* mf);
diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h
index 8be8335..6addd8f 100644
--- a/Source/cmSubdirCommand.h
+++ b/Source/cmSubdirCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "subdirs";}
+ virtual std::string GetName() const { return "subdirs";}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
index f78cfb7..75a5685 100644
--- a/Source/cmSubdirDependsCommand.h
+++ b/Source/cmSubdirDependsCommand.h
@@ -20,7 +20,7 @@ public:
virtual cmCommand* Clone() { return new cmSubdirDependsCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const { return "subdir_depends";}
+ virtual std::string GetName() const { return "subdir_depends";}
virtual bool IsDiscouraged() const { return true; }
cmTypeMacro(cmSubdirDependsCommand, cmCommand);
};
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index 7405e90..5ba9e03 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -36,7 +36,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "target_compile_definitions";}
+ virtual std::string GetName() const { return "target_compile_definitions";}
cmTypeMacro(cmTargetCompileDefinitionsCommand, cmTargetPropCommandBase);
diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h
index 3713e5a..d58dc07 100644
--- a/Source/cmTargetCompileOptionsCommand.h
+++ b/Source/cmTargetCompileOptionsCommand.h
@@ -36,7 +36,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "target_compile_options";}
+ virtual std::string GetName() const { return "target_compile_options";}
cmTypeMacro(cmTargetCompileOptionsCommand, cmTargetPropCommandBase);
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 6863ee5..c8b22fb 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -37,7 +37,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "target_include_directories";}
+ virtual std::string GetName() const { return "target_include_directories";}
cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmTargetPropCommandBase);
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index e2f3743..47dd8bd 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -42,7 +42,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "target_link_libraries";}
+ virtual std::string GetName() const { return "target_link_libraries";}
cmTypeMacro(cmTargetLinkLibrariesCommand, cmCommand);
private:
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index 8e6bbc1..a09c47f 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "try_compile";}
+ virtual std::string GetName() const { return "try_compile";}
cmTypeMacro(cmTryCompileCommand, cmCoreTryCompile);
diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h
index d0bf9ce..9b97b16 100644
--- a/Source/cmTryRunCommand.h
+++ b/Source/cmTryRunCommand.h
@@ -40,7 +40,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "try_run";}
+ virtual std::string GetName() const { return "try_run";}
cmTypeMacro(cmTryRunCommand, cmCoreTryCompile);
private:
diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h
index 2308139..62c2bd3 100644
--- a/Source/cmUnsetCommand.h
+++ b/Source/cmUnsetCommand.h
@@ -45,7 +45,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const {return "unset";}
+ virtual std::string GetName() const {return "unset";}
cmTypeMacro(cmUnsetCommand, cmCommand);
};
diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h
index dca75a5..da927c7 100644
--- a/Source/cmUseMangledMesaCommand.h
+++ b/Source/cmUseMangledMesaCommand.h
@@ -21,7 +21,7 @@ public:
virtual cmCommand* Clone() { return new cmUseMangledMesaCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const { return "use_mangled_mesa";}
+ virtual std::string GetName() const { return "use_mangled_mesa";}
virtual bool IsScriptable() const { return true; }
virtual bool IsDiscouraged() const { return true; }
protected:
diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h
index 83d115c..23afdbe 100644
--- a/Source/cmUtilitySourceCommand.h
+++ b/Source/cmUtilitySourceCommand.h
@@ -21,7 +21,7 @@ public:
virtual cmCommand* Clone() { return new cmUtilitySourceCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const { return "utility_source";}
+ virtual std::string GetName() const { return "utility_source";}
virtual bool IsDiscouraged() const { return true; }
};
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
index 881b149..7e68de1 100644
--- a/Source/cmVariableRequiresCommand.h
+++ b/Source/cmVariableRequiresCommand.h
@@ -21,7 +21,7 @@ public:
virtual cmCommand* Clone() { return new cmVariableRequiresCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
- virtual const char* GetName() const { return "variable_requires";}
+ virtual std::string GetName() const { return "variable_requires";}
virtual bool IsDiscouraged() const { return true; }
};
diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h
index fb6062c..c1ee9b1 100644
--- a/Source/cmVariableWatchCommand.h
+++ b/Source/cmVariableWatchCommand.h
@@ -54,7 +54,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "variable_watch";}
+ virtual std::string GetName() const { return "variable_watch";}
cmTypeMacro(cmVariableWatchCommand, cmCommand);
diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h
index 45badd0..9fafffc 100644
--- a/Source/cmWhileCommand.h
+++ b/Source/cmWhileCommand.h
@@ -66,7 +66,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "while";}
+ virtual std::string GetName() const { return "while";}
cmTypeMacro(cmWhileCommand, cmCommand);
};
diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h
index 84a38fc..0d06878 100644
--- a/Source/cmWriteFileCommand.h
+++ b/Source/cmWriteFileCommand.h
@@ -44,7 +44,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "write_file";}
+ virtual std::string GetName() const { return "write_file";}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index ab12411..d37bd94 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -221,13 +221,13 @@ void cmake::CleanupCommandsAndMacros()
}
}
-bool cmake::CommandExists(const char* name) const
+bool cmake::CommandExists(const std::string& name) const
{
std::string sName = cmSystemTools::LowerCase(name);
return (this->Commands.find(sName) != this->Commands.end());
}
-cmCommand *cmake::GetCommand(const char *name)
+cmCommand *cmake::GetCommand(const std::string& name)
{
cmCommand* rm = 0;
std::string sName = cmSystemTools::LowerCase(name);
@@ -239,7 +239,8 @@ cmCommand *cmake::GetCommand(const char *name)
return rm;
}
-void cmake::RenameCommand(const char*oldName, const char* newName)
+void cmake::RenameCommand(const std::string& oldName,
+ const std::string& newName)
{
// if the command already exists, free the old one
std::string sOldName = cmSystemTools::LowerCase(oldName);
@@ -262,7 +263,7 @@ void cmake::RenameCommand(const char*oldName, const char* newName)
this->Commands.erase(pos);
}
-void cmake::RemoveCommand(const char* name)
+void cmake::RemoveCommand(const std::string& name)
{
std::string sName = cmSystemTools::LowerCase(name);
RegisteredCommandsMap::iterator pos = this->Commands.find(sName);
diff --git a/Source/cmake.h b/Source/cmake.h
index 3134493..6772740 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -218,20 +218,20 @@ class cmake
* Add a command to this cmake instance
*/
void AddCommand(cmCommand* );
- void RenameCommand(const char* oldName, const char* newName);
- void RemoveCommand(const char* name);
+ void RenameCommand(const std::string& oldName, const std::string& newName);
+ void RemoveCommand(const std::string& name);
void RemoveUnscriptableCommands();
/**
* Get a command by its name
*/
- cmCommand *GetCommand(const char *name);
+ cmCommand *GetCommand(const std::string& name);
/** Get list of all commands */
RegisteredCommandsMap* GetCommands() { return &this->Commands; }
/** Check if a command exists. */
- bool CommandExists(const char* name) const;
+ bool CommandExists(const std::string& name) const;
///! Parse command line arguments
void SetArgs(const std::vector<std::string>&,
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=43820d6fabf85dfab87ba3a758fe1c4810a1c704
commit 43820d6fabf85dfab87ba3a758fe1c4810a1c704
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 17:38:55 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:25 2014 -0500
stringapi: Use strings for program paths
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index d8e1a2c..780ffa8 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -107,7 +107,7 @@ bool cmBuildCommand
std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration,
- 0, true);
+ "", true);
this->Makefile->AddDefinition(variable, makecommand.c_str());
@@ -137,7 +137,7 @@ bool cmBuildCommand
std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateCMakeBuildCommand("", configType.c_str(),
- 0, true);
+ "", true);
if(cacheValue)
{
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5dee5d7..faed66a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -89,19 +89,25 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
return false;
}
-std::string cmGlobalGenerator::SelectMakeProgram(const char* makeProgram,
- std::string makeDefault) const
+std::string cmGlobalGenerator::SelectMakeProgram(
+ const std::string& inMakeProgram,
+ const std::string& makeDefault) const
{
- if(cmSystemTools::IsOff(makeProgram))
+ std::string makeProgram = inMakeProgram;
+ if(cmSystemTools::IsOff(makeProgram.c_str()))
{
- makeProgram =
+ const char* makeProgramCSTR =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- if(cmSystemTools::IsOff(makeProgram))
+ if(cmSystemTools::IsOff(makeProgramCSTR))
{
- makeProgram = makeDefault.c_str();
+ makeProgram = makeDefault;
}
- if(cmSystemTools::IsOff(makeProgram) &&
- !(makeProgram && *makeProgram))
+ else
+ {
+ makeProgram = makeProgramCSTR;
+ }
+ if(cmSystemTools::IsOff(makeProgram.c_str()) &&
+ !makeProgram.empty())
{
makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
}
@@ -1660,13 +1666,14 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir,
mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
return this->Build(srcdir,bindir,projectName,
newTarget.c_str(),
- output,0,config,false,fast,
+ output,"",config,false,fast,
this->TryCompileTimeout);
}
void cmGlobalGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const char*, const std::string&,
- const std::string&, const std::string&, const std::string&, bool,
+ std::vector<std::string>& makeCommand, const std::string&,
+ const std::string&, const std::string&, const std::string&,
+ const std::string&, bool,
std::vector<std::string> const&)
{
makeCommand.push_back(
@@ -1677,7 +1684,7 @@ int cmGlobalGenerator::Build(
const std::string&, const std::string& bindir,
const std::string& projectName, const std::string& target,
std::string *output,
- const char *makeCommandCSTR,
+ const std::string& makeCommandCSTR,
const std::string& config,
bool clean, bool fast,
double timeout,
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 38dc63a..91e71a8 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -120,7 +120,7 @@ public:
int Build(const std::string& srcdir, const std::string& bindir,
const std::string& projectName, const std::string& targetName,
std::string *output,
- const char *makeProgram, const std::string& config,
+ const std::string& makeProgram, const std::string& config,
bool clean, bool fast,
double timeout,
cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
@@ -129,7 +129,7 @@ public:
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
@@ -345,8 +345,8 @@ protected:
cmTarget const*> > AutogensType;
void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
- std::string SelectMakeProgram(const char* makeProgram,
- std::string makeDefault = "") const;
+ std::string SelectMakeProgram(const std::string& makeProgram,
+ const std::string& makeDefault = "") const;
// Fill the ProjectMap, this must be called after LocalGenerators
// has been populated.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 73a6245..785b902 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -551,7 +551,7 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false;
// cmGlobalGenerator::Build()
void cmGlobalNinjaGenerator
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& /*projectName*/,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 2467af9..7725cf3 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -193,7 +193,7 @@ public:
/// Overloaded methods. @see cmGlobalGenerator::GenerateBuildCommand()
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 08a1c62..d41cee6 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -565,7 +565,7 @@ cmGlobalUnixMakefileGenerator3
//----------------------------------------------------------------------------
void cmGlobalUnixMakefileGenerator3
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& /*projectName*/,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index ea2b6c0..8115176 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -109,7 +109,7 @@ public:
// change the build command for speed
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 2dc658e..840e888 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -312,7 +312,7 @@ std::string cmGlobalVisualStudio10Generator::FindDevEnvCommand()
//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index d3ad69e..999a9d5 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -35,7 +35,7 @@ public:
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 3a51fce..7397bbb 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -116,7 +116,7 @@ std::string cmGlobalVisualStudio6Generator::FindMSDevCommand()
void
cmGlobalVisualStudio6Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 14046f0..2797e11 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -54,7 +54,7 @@ public:
*/
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 03772dd..320b440 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -186,7 +186,7 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
//----------------------------------------------------------------------------
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 9ab0462..0d2e410 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -62,7 +62,7 @@ public:
*/
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 30bded5..30a2a1e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -261,7 +261,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
void
cmGlobalXCodeGenerator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 54c6f96..93315ba 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -55,7 +55,7 @@ public:
*/
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index abe27a5..ab12411 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2672,7 +2672,7 @@ int cmake::Build(const std::string& dir,
return gen->Build("", dir.c_str(),
projName.c_str(), target.c_str(),
&output,
- 0,
+ "",
config.c_str(), clean, false, 0,
cmSystemTools::OUTPUT_PASSTHROUGH,
nativeOptions);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e695d4447dad71285d49ff453258b68142e072a
commit 2e695d4447dad71285d49ff453258b68142e072a
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 17:36:27 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:25 2014 -0500
stringapi: Use strings for generator names
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index c60ded0..04eabd2 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -101,8 +101,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
}
if ( this->GlobalGenerator )
{
- if ( strcmp(this->GlobalGenerator->GetName(),
- cmakeGeneratorName) != 0 )
+ if ( this->GlobalGenerator->GetName() != cmakeGeneratorName )
{
delete this->GlobalGenerator;
this->GlobalGenerator = 0;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index e4e2047..62eaec2 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1127,9 +1127,10 @@ void cmComputeLinkInformation::AddFullItem(std::string const& item)
// Full path libraries should specify a valid library file name.
// See documentation of CMP0008.
+ std::string generator = this->GlobalGenerator->GetName();
if(this->Target->GetPolicyStatusCMP0008() != cmPolicies::NEW &&
- (strstr(this->GlobalGenerator->GetName(), "Visual Studio") ||
- strstr(this->GlobalGenerator->GetName(), "Xcode")))
+ (generator.find("Visual Studio") != generator.npos ||
+ generator.find("Xcode") != generator.npos))
{
std::string file = cmSystemTools::GetFilenameName(item);
if(!this->ExtractAnyLibraryName.find(file.c_str()))
diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index 0d42c35..d89a1c8 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -20,13 +20,13 @@ void cmExternalMakefileProjectGenerator
}
std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
- const char* globalGenerator,
- const char* extraGenerator)
+ const std::string& globalGenerator,
+ const std::string& extraGenerator)
{
std::string fullName;
- if (globalGenerator)
+ if (!globalGenerator.empty())
{
- if (extraGenerator && *extraGenerator)
+ if (!extraGenerator.empty())
{
fullName = extraGenerator;
fullName += " - ";
@@ -36,22 +36,22 @@ std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
return fullName;
}
-const char* cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
- const char* fullName)
+std::string cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
+ const std::string& fullName)
{
// at least one global generator must be supported
assert(!this->SupportedGlobalGenerators.empty());
- if (fullName==0)
+ if (fullName.empty())
{
- return 0;
+ return "";
}
std::string currentName = fullName;
// if we get only the short name, take the first global generator as default
if (currentName == this->GetName())
{
- return this->SupportedGlobalGenerators[0].c_str();
+ return this->SupportedGlobalGenerators[0];
}
// otherwise search for the matching global generator
@@ -63,8 +63,8 @@ const char* cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
if (this->CreateFullGeneratorName(it->c_str(), this->GetName())
== currentName)
{
- return it->c_str();
+ return *it;
}
}
- return 0;
+ return "";
}
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index bce441d..cba1c76 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -37,10 +37,10 @@ public:
virtual ~cmExternalMakefileProjectGenerator() {}
///! Get the name for this generator.
- virtual const char* GetName() const = 0;
+ virtual std::string GetName() const = 0;
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const = 0;
+ const std::string& fullName) const = 0;
virtual void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile *, bool optional);
@@ -53,12 +53,13 @@ public:
{return this->SupportedGlobalGenerators;}
///! Get the name of the global generator for the given full name
- const char* GetGlobalGeneratorName(const char* fullName);
+ std::string GetGlobalGeneratorName(const std::string& fullName);
/** Create a full name from the given global generator name and the
* extra generator name
*/
- static std::string CreateFullGeneratorName(const char* globalGenerator,
- const char* extraGenerator);
+ static std::string CreateFullGeneratorName(
+ const std::string& globalGenerator,
+ const std::string& extraGenerator);
///! Generate the project files, the Makefiles have already been generated
virtual void Generate() = 0;
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 01d1155..4a59704 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -38,7 +38,7 @@ http://forums.codeblocks.org/index.php/topic,6789.0.html
//----------------------------------------------------------------------------
void cmExtraCodeBlocksGenerator
-::GetDocumentation(cmDocumentationEntry& entry, const char*) const
+::GetDocumentation(cmDocumentationEntry& entry, const std::string&) const
{
entry.Name = this->GetName();
entry.Brief = "Generates CodeBlocks project files.";
@@ -761,7 +761,8 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
const std::string& target)
{
std::string command = make;
- if (strcmp(this->GlobalGenerator->GetName(), "NMake Makefiles")==0)
+ std::string generator = this->GlobalGenerator->GetName();
+ if (generator == "NMake Makefiles")
{
// For Windows ConvertToOutputPath already adds quotes when required.
// These need to be escaped, see
@@ -772,7 +773,7 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
command += " VERBOSE=1 ";
command += target;
}
- else if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
+ else if (generator == "MinGW Makefiles")
{
// no escaping of spaces in this case, see
// http://public.kitware.com/Bug/view.php?id=10014
@@ -783,7 +784,7 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
command += " VERBOSE=1 ";
command += target;
}
- else if (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0)
+ else if (generator == "Ninja")
{
command += " -v ";
command += target;
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 1cbc3f3..0435ad8 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -28,14 +28,14 @@ class cmExtraCodeBlocksGenerator : public cmExternalMakefileProjectGenerator
public:
cmExtraCodeBlocksGenerator();
- virtual const char* GetName() const
+ virtual std::string GetName() const
{ return cmExtraCodeBlocksGenerator::GetActualName();}
- static const char* GetActualName() { return "CodeBlocks";}
+ static std::string GetActualName() { return "CodeBlocks";}
static cmExternalMakefileProjectGenerator* New()
{ return new cmExtraCodeBlocksGenerator; }
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const;
+ const std::string& fullName) const;
virtual void Generate();
private:
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 1e34fe0..15fe8bb 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -28,7 +28,7 @@
//----------------------------------------------------------------------------
void cmExtraCodeLiteGenerator::GetDocumentation(cmDocumentationEntry& entry,
- const char*) const
+ const std::string&) const
{
entry.Name = this->GetName();
entry.Brief = "Generates CodeLite project files.";
diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h
index 984313e..6b4965d 100644
--- a/Source/cmExtraCodeLiteGenerator.h
+++ b/Source/cmExtraCodeLiteGenerator.h
@@ -35,14 +35,14 @@ protected:
public:
cmExtraCodeLiteGenerator();
- virtual const char* GetName() const
+ virtual std::string GetName() const
{ return cmExtraCodeLiteGenerator::GetActualName();}
- static const char* GetActualName() { return "CodeLite";}
+ static std::string GetActualName() { return "CodeLite";}
static cmExternalMakefileProjectGenerator* New()
{ return new cmExtraCodeLiteGenerator; }
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const;
+ const std::string& fullName) const;
virtual void Generate();
void CreateProjectFile(const std::vector<cmLocalGenerator*>& lgs);
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 38a2470..4aabc7e 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -45,7 +45,7 @@ cmExtraEclipseCDT4Generator
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator
-::GetDocumentation(cmDocumentationEntry& entry, const char*) const
+::GetDocumentation(cmDocumentationEntry& entry, const std::string&) const
{
entry.Name = this->GetName();
entry.Brief = "Generates Eclipse CDT 4.0 project files.";
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index d88b247..ef99760 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -33,14 +33,14 @@ public:
return new cmExtraEclipseCDT4Generator;
}
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmExtraEclipseCDT4Generator::GetActualName();
}
- static const char* GetActualName() { return "Eclipse CDT4"; }
+ static std::string GetActualName() { return "Eclipse CDT4"; }
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const;
+ const std::string& fullName) const;
virtual void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile *, bool optional);
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index a0d37d4..567542e 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -25,7 +25,7 @@
//----------------------------------------------------------------------------
void cmExtraKateGenerator
-::GetDocumentation(cmDocumentationEntry& entry, const char*) const
+::GetDocumentation(cmDocumentationEntry& entry, const std::string&) const
{
entry.Name = this->GetName();
entry.Brief = "Generates Kate project files.";
@@ -52,7 +52,7 @@ void cmExtraKateGenerator::Generate()
this->ProjectName = this->GenerateProjectName(mf->GetProjectName(),
mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
this->GetPathBasename(mf->GetHomeOutputDirectory()));
- this->UseNinja = (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0);
+ this->UseNinja = (this->GlobalGenerator->GetName() == "Ninja");
this->CreateKateProjectFile(mf);
this->CreateDummyKateProjectFile(mf);
diff --git a/Source/cmExtraKateGenerator.h b/Source/cmExtraKateGenerator.h
index 6ced5fe..f800feb 100644
--- a/Source/cmExtraKateGenerator.h
+++ b/Source/cmExtraKateGenerator.h
@@ -28,14 +28,14 @@ class cmExtraKateGenerator : public cmExternalMakefileProjectGenerator
public:
cmExtraKateGenerator();
- virtual const char* GetName() const
+ virtual std::string GetName() const
{ return cmExtraKateGenerator::GetActualName();}
- static const char* GetActualName() { return "Kate";}
+ static std::string GetActualName() { return "Kate";}
static cmExternalMakefileProjectGenerator* New()
{ return new cmExtraKateGenerator; }
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const;
+ const std::string& fullName) const;
virtual void Generate();
private:
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 03c7c92..f973a84 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -41,7 +41,7 @@ http://sublimetext.info/docs/en/reference/build_systems.html
//----------------------------------------------------------------------------
void cmExtraSublimeTextGenerator
-::GetDocumentation(cmDocumentationEntry& entry, const char*) const
+::GetDocumentation(cmDocumentationEntry& entry, const std::string&) const
{
entry.Name = this->GetName();
entry.Brief = "Generates Sublime Text 2 project files.";
@@ -290,7 +290,7 @@ void cmExtraSublimeTextGenerator::
// Ninja uses ninja.build files (look for a way to get the output file name
// from cmMakefile or something)
std::string makefileName;
- if (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0)
+ if (this->GlobalGenerator->GetName() == "Ninja")
{
makefileName = "build.ninja";
}
@@ -320,7 +320,8 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
{
std::string command = "\"";
command += make + "\"";
- if (strcmp(this->GlobalGenerator->GetName(), "NMake Makefiles")==0)
+ std::string generator = this->GlobalGenerator->GetName();
+ if (generator == "NMake Makefiles")
{
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += ", \"/NOLOGO\", \"/f\", \"";
@@ -329,7 +330,7 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
command += target;
command += "\"";
}
- else if (strcmp(this->GlobalGenerator->GetName(), "Ninja")==0)
+ else if (generator == "Ninja")
{
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += ", \"-f\", \"";
@@ -341,7 +342,7 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
else
{
std::string makefileName;
- if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
+ if (generator == "MinGW Makefiles")
{
// no escaping of spaces in this case, see
// http://public.kitware.com/Bug/view.php?id=10014
diff --git a/Source/cmExtraSublimeTextGenerator.h b/Source/cmExtraSublimeTextGenerator.h
index 44dfb31..4173b7d 100644
--- a/Source/cmExtraSublimeTextGenerator.h
+++ b/Source/cmExtraSublimeTextGenerator.h
@@ -31,15 +31,15 @@ public:
typedef std::map<std::string, std::vector<std::string> > MapSourceFileFlags;
cmExtraSublimeTextGenerator();
- virtual const char* GetName() const
+ virtual std::string GetName() const
{ return cmExtraSublimeTextGenerator::GetActualName();}
- static const char* GetActualName()
+ static std::string GetActualName()
{ return "Sublime Text 2";}
static cmExternalMakefileProjectGenerator* New()
{ return new cmExtraSublimeTextGenerator; }
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const;
+ const std::string& fullName) const;
virtual void Generate();
private:
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 70004ea..470dea4 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -28,9 +28,9 @@ public:
<cmGlobalBorlandMakefileGenerator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalBorlandMakefileGenerator::GetActualName();}
- static const char* GetActualName() {return "Borland Makefiles";}
+ static std::string GetActualName() {return "Borland Makefiles";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c1cce2e..5dee5d7 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2599,9 +2599,9 @@ void cmGlobalGenerator::SetExternalMakefileProjectGenerator(
}
}
-const char* cmGlobalGenerator::GetExtraGeneratorName() const
+std::string cmGlobalGenerator::GetExtraGeneratorName() const
{
- return this->ExtraGenerator==0 ? 0 : this->ExtraGenerator->GetName();
+ return this->ExtraGenerator? this->ExtraGenerator->GetName() : std::string();
}
void cmGlobalGenerator::FileReplacedDuringGenerate(const std::string& filename)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 761fb07..38dc63a 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -51,11 +51,11 @@ public:
virtual cmLocalGenerator *CreateLocalGenerator();
///! Get the name for this generator
- virtual const char *GetName() const { return "Generic"; };
+ virtual std::string GetName() const { return "Generic"; };
/** Check whether the given name matches the current generator. */
- virtual bool MatchesGeneratorName(const char* name) const
- { return strcmp(this->GetName(), name) == 0; }
+ virtual bool MatchesGeneratorName(const std::string& name) const
+ { return this->GetName() == name; }
/** Set the generator-specific toolset name. Returns true if toolset
is supported and false otherwise. */
@@ -163,7 +163,7 @@ public:
void SetExternalMakefileProjectGenerator(
cmExternalMakefileProjectGenerator *extraGenerator);
- const char* GetExtraGeneratorName() const;
+ std::string GetExtraGeneratorName() const;
void AddInstallComponent(const char* component);
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index fd1d65f..3c2cd60 100644
--- a/Source/cmGlobalGeneratorFactory.h
+++ b/Source/cmGlobalGeneratorFactory.h
@@ -29,7 +29,8 @@ public:
virtual ~cmGlobalGeneratorFactory() {}
/** Create a GlobalGenerator */
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* n) const = 0;
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& n) const = 0;
/** Get the documentation entry for this factory */
virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0;
@@ -43,8 +44,9 @@ class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory
{
public:
/** Create a GlobalGenerator */
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if (strcmp(name, T::GetActualName())) return 0;
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const {
+ if (name != T::GetActualName()) return 0;
return new T; }
/** Get the documentation entry for this factory */
diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h
index 28893bf..344e013 100644
--- a/Source/cmGlobalJOMMakefileGenerator.h
+++ b/Source/cmGlobalJOMMakefileGenerator.h
@@ -27,11 +27,11 @@ public:
return new cmGlobalGeneratorSimpleFactory
<cmGlobalJOMMakefileGenerator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalJOMMakefileGenerator::GetActualName();}
// use NMake Makefiles in the name so that scripts/tests that depend on the
// name NMake Makefiles will work
- static const char* GetActualName() {return "NMake Makefiles JOM";}
+ static std::string GetActualName() {return "NMake Makefiles JOM";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 2d485f6..71e08cc 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -25,7 +25,7 @@
//----------------------------------------------------------------------------
void cmGlobalKdevelopGenerator
-::GetDocumentation(cmDocumentationEntry& entry, const char*) const
+::GetDocumentation(cmDocumentationEntry& entry, const std::string&) const
{
entry.Name = this->GetName();
entry.Brief = "Generates KDevelop 3 project files.";
diff --git a/Source/cmGlobalKdevelopGenerator.h b/Source/cmGlobalKdevelopGenerator.h
index a1ad39d..0d59fc5 100644
--- a/Source/cmGlobalKdevelopGenerator.h
+++ b/Source/cmGlobalKdevelopGenerator.h
@@ -33,14 +33,14 @@ class cmGlobalKdevelopGenerator : public cmExternalMakefileProjectGenerator
public:
cmGlobalKdevelopGenerator();
- virtual const char* GetName() const
+ virtual std::string GetName() const
{ return cmGlobalKdevelopGenerator::GetActualName();}
- static const char* GetActualName() { return "KDevelop3";}
+ static std::string GetActualName() { return "KDevelop3";}
static cmExternalMakefileProjectGenerator* New()
{ return new cmGlobalKdevelopGenerator; }
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry,
- const char* fullName) const;
+ const std::string& fullName) const;
virtual void Generate();
private:
diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h
index 659de11..c4825bd 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.h
+++ b/Source/cmGlobalMSYSMakefileGenerator.h
@@ -28,9 +28,9 @@ public:
<cmGlobalMSYSMakefileGenerator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalMSYSMakefileGenerator::GetActualName();}
- static const char* GetActualName() {return "MSYS Makefiles";}
+ static std::string GetActualName() {return "MSYS Makefiles";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h
index 7951e98..4289422 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.h
+++ b/Source/cmGlobalMinGWMakefileGenerator.h
@@ -27,9 +27,9 @@ public:
return new cmGlobalGeneratorSimpleFactory
<cmGlobalMinGWMakefileGenerator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalMinGWMakefileGenerator::GetActualName();}
- static const char* GetActualName() {return "MinGW Makefiles";}
+ static std::string GetActualName() {return "MinGW Makefiles";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h
index 5756fbd..2ff44e3 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.h
+++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -27,9 +27,9 @@ public:
return new cmGlobalGeneratorSimpleFactory
<cmGlobalNMakeMakefileGenerator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalNMakeMakefileGenerator::GetActualName();}
- static const char* GetActualName() {return "NMake Makefiles";}
+ static std::string GetActualName() {return "NMake Makefiles";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 4a28486..2467af9 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -173,11 +173,11 @@ public:
virtual cmLocalGenerator* CreateLocalGenerator();
/// Overloaded methods. @see cmGlobalGenerator::GetName().
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalNinjaGenerator::GetActualName(); }
/// @return the name of this generator.
- static const char* GetActualName() { return "Ninja"; }
+ static std::string GetActualName() { return "Ninja"; }
/// Overloaded methods. @see cmGlobalGenerator::GetDocumentation()
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 9ddbe5b..08a1c62 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -72,7 +72,7 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const
{
// If generating for an extra IDE, the edit_cache target cannot
// launch a terminal-interactive tool, so always use cmake-gui.
- if(this->GetExtraGeneratorName())
+ if(!this->GetExtraGeneratorName().empty())
{
return cmSystemTools::GetCMakeGUICommand();
}
@@ -579,7 +579,7 @@ void cmGlobalUnixMakefileGenerator3
// Since we have full control over the invocation of nmake, let us
// make it quiet.
- if ( strcmp(this->GetName(), "NMake Makefiles") == 0 )
+ if ( this->GetName() == "NMake Makefiles" )
{
makeCommand.push_back("/NOLOGO");
}
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index d64afaf..ea2b6c0 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -60,9 +60,9 @@ public:
<cmGlobalUnixMakefileGenerator3>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalUnixMakefileGenerator3::GetActualName();}
- static const char* GetActualName() {return "Unix Makefiles";}
+ static std::string GetActualName() {return "Unix Makefiles";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 3819a5b..2dc658e 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -21,13 +21,14 @@
static const char vs10generatorName[] = "Visual Studio 10 2010";
// Map generator name without year to name with year.
-static const char* cmVS10GenName(const char* name, std::string& genName)
+static const char* cmVS10GenName(const std::string& name, std::string& genName)
{
- if(strncmp(name, vs10generatorName, sizeof(vs10generatorName)-6) != 0)
+ if(strncmp(name.c_str(), vs10generatorName,
+ sizeof(vs10generatorName)-6) != 0)
{
return 0;
}
- const char* p = name + sizeof(vs10generatorName) - 6;
+ const char* p = name.c_str() + sizeof(vs10generatorName) - 6;
if(cmHasLiteralPrefix(p, " 2010"))
{
p += 5;
@@ -40,27 +41,27 @@ class cmGlobalVisualStudio10Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const
{
std::string genName;
const char* p = cmVS10GenName(name, genName);
if(!p)
{ return 0; }
- name = genName.c_str();
if(strcmp(p, "") == 0)
{
return new cmGlobalVisualStudio10Generator(
- name, NULL, NULL);
+ genName, "", "");
}
if(strcmp(p, " Win64") == 0)
{
return new cmGlobalVisualStudio10Generator(
- name, "x64", "CMAKE_FORCE_WIN64");
+ genName, "x64", "CMAKE_FORCE_WIN64");
}
if(strcmp(p, " IA64") == 0)
{
return new cmGlobalVisualStudio10Generator(
- name, "Itanium", "CMAKE_FORCE_IA64");
+ genName, "Itanium", "CMAKE_FORCE_IA64");
}
return 0;
}
@@ -87,8 +88,8 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
- const char* name, const char* platformName,
- const char* additionalPlatformDefinition)
+ const std::string& name, const std::string& platformName,
+ const std::string& additionalPlatformDefinition)
: cmGlobalVisualStudio8Generator(name, platformName,
additionalPlatformDefinition)
{
@@ -102,7 +103,8 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
//----------------------------------------------------------------------------
bool
-cmGlobalVisualStudio10Generator::MatchesGeneratorName(const char* name) const
+cmGlobalVisualStudio10Generator::MatchesGeneratorName(
+ const std::string& name) const
{
std::string genName;
if(cmVS10GenName(name, genName))
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 5d902ee..d3ad69e 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -24,11 +24,12 @@ class cmGlobalVisualStudio10Generator :
public cmGlobalVisualStudio8Generator
{
public:
- cmGlobalVisualStudio10Generator(const char* name,
- const char* platformName, const char* additionalPlatformDefinition);
+ cmGlobalVisualStudio10Generator(const std::string& name,
+ const std::string& platformName,
+ const std::string& additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
- virtual bool MatchesGeneratorName(const char* name) const;
+ virtual bool MatchesGeneratorName(const std::string& name) const;
virtual bool SetGeneratorToolset(std::string const& ts);
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 1f0c47a..4caa7f2 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -16,13 +16,14 @@
static const char vs11generatorName[] = "Visual Studio 11 2012";
// Map generator name without year to name with year.
-static const char* cmVS11GenName(const char* name, std::string& genName)
+static const char* cmVS11GenName(const std::string& name, std::string& genName)
{
- if(strncmp(name, vs11generatorName, sizeof(vs11generatorName)-6) != 0)
+ if(strncmp(name.c_str(), vs11generatorName,
+ sizeof(vs11generatorName)-6) != 0)
{
return 0;
}
- const char* p = name + sizeof(vs11generatorName) - 6;
+ const char* p = name.c_str() + sizeof(vs11generatorName) - 6;
if(cmHasLiteralPrefix(p, " 2012"))
{
p += 5;
@@ -35,27 +36,27 @@ class cmGlobalVisualStudio11Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const
{
std::string genName;
const char* p = cmVS11GenName(name, genName);
if(!p)
{ return 0; }
- name = genName.c_str();
if(strcmp(p, "") == 0)
{
return new cmGlobalVisualStudio11Generator(
- name, NULL, NULL);
+ genName, "", "");
}
if(strcmp(p, " Win64") == 0)
{
return new cmGlobalVisualStudio11Generator(
- name, "x64", "CMAKE_FORCE_WIN64");
+ genName, "x64", "CMAKE_FORCE_WIN64");
}
if(strcmp(p, " ARM") == 0)
{
return new cmGlobalVisualStudio11Generator(
- name, "ARM", NULL);
+ genName, "ARM", "");
}
if(*p++ != ' ')
@@ -107,8 +108,8 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
- const char* name, const char* platformName,
- const char* additionalPlatformDefinition)
+ const std::string& name, const std::string& platformName,
+ const std::string& additionalPlatformDefinition)
: cmGlobalVisualStudio10Generator(name, platformName,
additionalPlatformDefinition)
{
@@ -121,7 +122,8 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
//----------------------------------------------------------------------------
bool
-cmGlobalVisualStudio11Generator::MatchesGeneratorName(const char* name) const
+cmGlobalVisualStudio11Generator::MatchesGeneratorName(
+ const std::string& name) const
{
std::string genName;
if(cmVS11GenName(name, genName))
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index 7ef77e7..48ea489 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -20,11 +20,12 @@ class cmGlobalVisualStudio11Generator:
public cmGlobalVisualStudio10Generator
{
public:
- cmGlobalVisualStudio11Generator(const char* name,
- const char* platformName, const char* additionalPlatformDefinition);
+ cmGlobalVisualStudio11Generator(const std::string& name,
+ const std::string& platformName,
+ const std::string& additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
- virtual bool MatchesGeneratorName(const char* name) const;
+ virtual bool MatchesGeneratorName(const std::string& name) const;
virtual void WriteSLNHeader(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 3074794..6cd9f12 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -16,13 +16,14 @@
static const char vs12generatorName[] = "Visual Studio 12 2013";
// Map generator name without year to name with year.
-static const char* cmVS12GenName(const char* name, std::string& genName)
+static const char* cmVS12GenName(const std::string& name, std::string& genName)
{
- if(strncmp(name, vs12generatorName, sizeof(vs12generatorName)-6) != 0)
+ if(strncmp(name.c_str(), vs12generatorName,
+ sizeof(vs12generatorName)-6) != 0)
{
return 0;
}
- const char* p = name + sizeof(vs12generatorName) - 6;
+ const char* p = name.c_str() + sizeof(vs12generatorName) - 6;
if(cmHasLiteralPrefix(p, " 2013"))
{
p += 5;
@@ -35,27 +36,27 @@ class cmGlobalVisualStudio12Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const
{
std::string genName;
const char* p = cmVS12GenName(name, genName);
if(!p)
{ return 0; }
- name = genName.c_str();
if(strcmp(p, "") == 0)
{
return new cmGlobalVisualStudio12Generator(
- name, NULL, NULL);
+ genName, "", "");
}
if(strcmp(p, " Win64") == 0)
{
return new cmGlobalVisualStudio12Generator(
- name, "x64", "CMAKE_FORCE_WIN64");
+ genName, "x64", "CMAKE_FORCE_WIN64");
}
if(strcmp(p, " ARM") == 0)
{
return new cmGlobalVisualStudio12Generator(
- name, "ARM", NULL);
+ genName, "ARM", "");
}
return 0;
}
@@ -82,8 +83,8 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
- const char* name, const char* platformName,
- const char* additionalPlatformDefinition)
+ const std::string& name, const std::string& platformName,
+ const std::string& additionalPlatformDefinition)
: cmGlobalVisualStudio11Generator(name, platformName,
additionalPlatformDefinition)
{
@@ -96,7 +97,8 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
//----------------------------------------------------------------------------
bool
-cmGlobalVisualStudio12Generator::MatchesGeneratorName(const char* name) const
+cmGlobalVisualStudio12Generator::MatchesGeneratorName(
+ const std::string& name) const
{
std::string genName;
if(cmVS12GenName(name, genName))
diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h
index 5a4a78d..4557f28 100644
--- a/Source/cmGlobalVisualStudio12Generator.h
+++ b/Source/cmGlobalVisualStudio12Generator.h
@@ -20,11 +20,12 @@ class cmGlobalVisualStudio12Generator:
public cmGlobalVisualStudio11Generator
{
public:
- cmGlobalVisualStudio12Generator(const char* name,
- const char* platformName, const char* additionalPlatformDefinition);
+ cmGlobalVisualStudio12Generator(const std::string& name,
+ const std::string& platformName,
+ const std::string& additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
- virtual bool MatchesGeneratorName(const char* name) const;
+ virtual bool MatchesGeneratorName(const std::string& name) const;
virtual void WriteSLNHeader(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index eb3dddf..14046f0 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -31,9 +31,9 @@ public:
<cmGlobalVisualStudio6Generator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalVisualStudio6Generator::GetActualName();}
- static const char* GetActualName() {return "Visual Studio 6";}
+ static std::string GetActualName() {return "Visual Studio 6";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 08bcc5b..4bea5ac 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -17,7 +17,8 @@
//----------------------------------------------------------------------------
cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
- const char* platformName) : cmGlobalVisualStudio7Generator(platformName)
+ const std::string& platformName)
+ : cmGlobalVisualStudio7Generator(platformName)
{
this->ProjectConfigurationSectionName = "ProjectConfiguration";
}
@@ -279,10 +280,10 @@ void cmGlobalVisualStudio71Generator
::WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping)
+ std::string const& platformMapping)
{
- const char* platformName =
- platformMapping ? platformMapping : this->GetPlatformName();
+ const std::string& platformName =
+ !platformMapping.empty() ? platformMapping : this->GetPlatformName();
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 75cc6ae..2b5259a 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -23,15 +23,15 @@
class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator
{
public:
- cmGlobalVisualStudio71Generator(const char* platformName = NULL);
+ cmGlobalVisualStudio71Generator(const std::string& platformName = "");
static cmGlobalGeneratorFactory* NewFactory() {
return new cmGlobalGeneratorSimpleFactory
<cmGlobalVisualStudio71Generator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalVisualStudio71Generator::GetActualName();}
- static const char* GetActualName() {return "Visual Studio 7 .NET 2003";}
+ static std::string GetActualName() {return "Visual Studio 7 .NET 2003";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
@@ -67,7 +67,7 @@ protected:
virtual void WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping = NULL);
+ const std::string& platformMapping = "");
virtual void WriteExternalProject(std::ostream& fout,
const std::string& name,
const char* path,
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 3927100..03772dd 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -19,16 +19,19 @@
#include <cmsys/Encoding.hxx>
cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
- const char* platformName)
+ const std::string& platformName)
{
this->IntelProjectVersion = 0;
this->DevEnvCommandInitialized = false;
- if (!platformName)
+ if (platformName.empty())
{
- platformName = "Win32";
+ this->PlatformName = "Win32";
+ }
+ else
+ {
+ this->PlatformName = platformName;
}
- this->PlatformName = platformName;
}
cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator()
@@ -260,7 +263,7 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
{
cmGlobalVisualStudioGenerator::AddPlatformDefinitions(mf);
- mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName());
+ mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str());
mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION",
this->GetIntelProjectVersion());
}
@@ -381,9 +384,10 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
{
std::set<std::string> allConfigurations(this->Configurations.begin(),
this->Configurations.end());
+ const char* mapping = target->GetProperty("VS_PLATFORM_MAPPING");
this->WriteProjectConfigurations(
fout, target->GetName().c_str(), target->GetType(),
- allConfigurations, target->GetProperty("VS_PLATFORM_MAPPING"));
+ allConfigurations, mapping ? mapping : "");
}
else
{
@@ -732,10 +736,10 @@ void cmGlobalVisualStudio7Generator
::WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping)
+ const std::string& platformMapping)
{
- const char* platformName =
- platformMapping ? platformMapping : this->GetPlatformName();
+ const std::string& platformName =
+ !platformMapping.empty() ? platformMapping : this->GetPlatformName();
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index b659480..9ab0462 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -26,7 +26,7 @@ struct cmIDEFlagTable;
class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
{
public:
- cmGlobalVisualStudio7Generator(const char* platformName = NULL);
+ cmGlobalVisualStudio7Generator(const std::string& platformName = "");
~cmGlobalVisualStudio7Generator();
static cmGlobalGeneratorFactory* NewFactory() {
@@ -34,12 +34,12 @@ public:
<cmGlobalVisualStudio7Generator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalVisualStudio7Generator::GetActualName();}
- static const char* GetActualName() {return "Visual Studio 7";}
+ static std::string GetActualName() {return "Visual Studio 7";}
///! Get the name for the platform.
- const char* GetPlatformName() const { return this->PlatformName.c_str(); }
+ const std::string& GetPlatformName() const { return this->PlatformName; }
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
@@ -131,7 +131,7 @@ protected:
virtual void WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping = NULL);
+ const std::string& platformMapping = "");
virtual void WriteSLNGlobalSections(std::ostream& fout,
cmLocalGenerator* root);
virtual void WriteSLNFooter(std::ostream& fout);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 2ae1bbc..08c1397 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -23,17 +23,19 @@ class cmGlobalVisualStudio8Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if(strstr(name, vs8generatorName) != name)
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const {
+ if(strncmp(name.c_str(), vs8generatorName,
+ sizeof(vs8generatorName) - 1) != 0)
{
return 0;
}
- const char* p = name + sizeof(vs8generatorName) - 1;
+ const char* p = name.c_str() + sizeof(vs8generatorName) - 1;
if(p[0] == '\0')
{
return new cmGlobalVisualStudio8Generator(
- name, NULL, NULL);
+ name, "", "");
}
if(p[0] != ' ')
@@ -57,7 +59,7 @@ public:
}
cmGlobalVisualStudio8Generator* ret = new cmGlobalVisualStudio8Generator(
- name, p, NULL);
+ name, p, "");
ret->WindowsCEVersion = parser.GetOSVersion();
return ret;
}
@@ -90,14 +92,14 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
- const char* name, const char* platformName,
- const char* additionalPlatformDefinition)
+ const std::string& name, const std::string& platformName,
+ const std::string& additionalPlatformDefinition)
: cmGlobalVisualStudio71Generator(platformName)
{
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
this->Name = name;
- if (additionalPlatformDefinition)
+ if (!additionalPlatformDefinition.empty())
{
this->AdditionalPlatformDefinition = additionalPlatformDefinition;
}
@@ -374,7 +376,7 @@ cmGlobalVisualStudio8Generator
::WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping)
+ std::string const& platformMapping)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -382,7 +384,8 @@ cmGlobalVisualStudio8Generator
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->GetPlatformName() << ".ActiveCfg = " << *i << "|"
- << (platformMapping ? platformMapping : this->GetPlatformName())
+ << (!platformMapping.empty()?
+ platformMapping : this->GetPlatformName())
<< "\n";
std::set<std::string>::const_iterator
ci = configsPartOfDefaultBuild.find(*i);
@@ -390,7 +393,8 @@ cmGlobalVisualStudio8Generator
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->GetPlatformName() << ".Build.0 = " << *i << "|"
- << (platformMapping ? platformMapping : this->GetPlatformName())
+ << (!platformMapping.empty()?
+ platformMapping : this->GetPlatformName())
<< "\n";
}
bool needsDeploy = (type == cmTarget::EXECUTABLE ||
@@ -399,7 +403,8 @@ cmGlobalVisualStudio8Generator
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->GetPlatformName() << ".Deploy.0 = " << *i << "|"
- << (platformMapping ? platformMapping : this->GetPlatformName())
+ << (!platformMapping.empty()?
+ platformMapping : this->GetPlatformName())
<< "\n";
}
}
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index bafb9eb..2459c05 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -23,12 +23,13 @@
class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
{
public:
- cmGlobalVisualStudio8Generator(const char* name,
- const char* platformName, const char* additionalPlatformDefinition);
+ cmGlobalVisualStudio8Generator(const std::string& name,
+ const std::string& platformName,
+ const std::string& additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
///! Get the name for the generator.
- virtual const char* GetName() const {return this->Name.c_str();}
+ virtual std::string GetName() const {return this->Name;}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
@@ -81,7 +82,7 @@ protected:
virtual void WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping = NULL);
+ const std::string& platformMapping = "");
virtual bool ComputeTargetDepends();
virtual void WriteProjectDepends(std::ostream& fout,
const std::string& name,
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index ccc27ad..c0051c7 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -22,17 +22,19 @@ class cmGlobalVisualStudio9Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if(strstr(name, vs9generatorName) != name)
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const {
+ if(strncmp(name.c_str(), vs9generatorName,
+ sizeof(vs9generatorName) - 1) != 0)
{
return 0;
}
- const char* p = name + sizeof(vs9generatorName) - 1;
+ const char* p = name.c_str() + sizeof(vs9generatorName) - 1;
if(p[0] == '\0')
{
return new cmGlobalVisualStudio9Generator(
- name, NULL, NULL);
+ name, "", "");
}
if(p[0] != ' ')
@@ -96,8 +98,8 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
- const char* name, const char* platformName,
- const char* additionalPlatformDefinition)
+ const std::string& name, const std::string& platformName,
+ const std::string& additionalPlatformDefinition)
: cmGlobalVisualStudio8Generator(name, platformName,
additionalPlatformDefinition)
{
diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h
index 202aa8d..fb87bbe 100644
--- a/Source/cmGlobalVisualStudio9Generator.h
+++ b/Source/cmGlobalVisualStudio9Generator.h
@@ -24,8 +24,9 @@ class cmGlobalVisualStudio9Generator :
public cmGlobalVisualStudio8Generator
{
public:
- cmGlobalVisualStudio9Generator(const char* name,
- const char* platformName, const char* additionalPlatformDefinition);
+ cmGlobalVisualStudio9Generator(const std::string& name,
+ const std::string& platformName,
+ const std::string& additionalPlatformDefinition);
static cmGlobalGeneratorFactory* NewFactory();
///! create the correct local generator
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index b2a705e..69c893c 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -22,7 +22,7 @@
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator()
{
- this->AdditionalPlatformDefinition = NULL;
+ this->AdditionalPlatformDefinition = "";
}
//----------------------------------------------------------------------------
@@ -518,7 +518,7 @@ void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
//----------------------------------------------------------------------------
void cmGlobalVisualStudioGenerator::AddPlatformDefinitions(cmMakefile* mf)
{
- if(this->AdditionalPlatformDefinition)
+ if(!this->AdditionalPlatformDefinition.empty())
{
mf->AddDefinition(this->AdditionalPlatformDefinition, "TRUE");
}
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index dc0f9c7..7e8dcf8 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -110,7 +110,7 @@ protected:
std::string GetUtilityDepend(cmTarget const* target);
typedef std::map<cmTarget const*, std::string> UtilityDependsMap;
UtilityDependsMap UtilityDepends;
- const char* AdditionalPlatformDefinition;
+ std::string AdditionalPlatformDefinition;
private:
virtual std::string GetVSMakeProgram() = 0;
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index d5350ef..2057a42 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -27,9 +27,9 @@ public:
return new cmGlobalGeneratorSimpleFactory
<cmGlobalWatcomWMakeGenerator>(); }
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalWatcomWMakeGenerator::GetActualName();}
- static const char* GetActualName() {return "Watcom WMake";}
+ static std::string GetActualName() {return "Watcom WMake";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e1f2a91..30bded5 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -116,7 +116,8 @@ public:
class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const;
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const;
virtual void GetDocumentation(cmDocumentationEntry& entry) const {
cmGlobalXCodeGenerator::GetDocumentation(entry); }
@@ -152,9 +153,9 @@ cmGlobalGeneratorFactory* cmGlobalXCodeGenerator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalGenerator* cmGlobalXCodeGenerator::Factory
-::CreateGlobalGenerator(const char* name) const
+::CreateGlobalGenerator(const std::string& name) const
{
- if (strcmp(name, GetActualName()))
+ if (name != GetActualName())
return 0;
#if defined(CMAKE_BUILD_WITH_CMAKE)
cmXcodeVersionParser parser;
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index aec7958..54c6f96 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -33,9 +33,9 @@ public:
static cmGlobalGeneratorFactory* NewFactory();
///! Get the name for the generator.
- virtual const char* GetName() const {
+ virtual std::string GetName() const {
return cmGlobalXCodeGenerator::GetActualName();}
- static const char* GetActualName() {return "Xcode";}
+ static std::string GetActualName() {return "Xcode";}
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index d2e66a5..6c04559 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -53,7 +53,7 @@ public:
*/
void SetBuildType(BuildType,const std::string& name);
- void SetPlatformName(const char* n) { this->PlatformName = n;}
+ void SetPlatformName(const std::string& n) { this->PlatformName = n;}
void SetExtraFlagTable(cmVS7FlagTable const* table)
{ this->ExtraFlagTable = table; }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e61b12b..e8be29f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1378,8 +1378,8 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
// VS6 IDE does not support definition values with spaces in
// combination with '"', '$', or ';'.
- if((strcmp(this->LocalGenerator->GetGlobalGenerator()->GetName(),
- "Visual Studio 6") == 0) &&
+ if((this->LocalGenerator->GetGlobalGenerator()->GetName() ==
+ "Visual Studio 6") &&
(def.find(" ") != def.npos && def.find_first_of("\"$;") != def.npos))
{
return false;
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 48a6b38..c32f624 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -251,7 +251,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
bool usePRE_BUILD = false;
cmLocalGenerator* localGen = makefile->GetLocalGenerator();
cmGlobalGenerator* gg = localGen->GetGlobalGenerator();
- if(strstr(gg->GetName(), "Visual Studio"))
+ if(gg->GetName().find("Visual Studio") != std::string::npos)
{
cmLocalVisualStudioGenerator* vslg =
static_cast<cmLocalVisualStudioGenerator*>(localGen);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 13572f4..abe27a5 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -965,7 +965,7 @@ int cmake::AddCMakePaths()
return 1;
}
-void cmake::AddExtraGenerator(const char* name,
+void cmake::AddExtraGenerator(const std::string& name,
CreateExtraGeneratorFunctionType newFunction)
{
cmExternalMakefileProjectGenerator* extraGenerator = newFunction();
@@ -1034,9 +1034,10 @@ void cmake::GetRegisteredGenerators(std::vector<std::string>& names)
}
}
-cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name)
+cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname)
{
cmExternalMakefileProjectGenerator* extraGenerator = 0;
+ std::string name = gname;
RegisteredExtraGeneratorsMap::const_iterator extraGenIt =
this->ExtraGenerators.find(name);
if (extraGenIt != this->ExtraGenerators.end())
@@ -1324,7 +1325,8 @@ int cmake::ActualConfigure()
if(genName)
{
std::string fullName = cmExternalMakefileProjectGenerator::
- CreateFullGeneratorName(genName, extraGenName);
+ CreateFullGeneratorName(genName,
+ extraGenName ? extraGenName : "");
this->GlobalGenerator = this->CreateGlobalGenerator(fullName.c_str());
}
if(this->GlobalGenerator)
@@ -1417,13 +1419,13 @@ int cmake::ActualConfigure()
if(!this->CacheManager->GetCacheValue("CMAKE_GENERATOR"))
{
this->CacheManager->AddCacheEntry("CMAKE_GENERATOR",
- this->GlobalGenerator->GetName(),
+ this->GlobalGenerator->GetName().c_str(),
"Name of generator.",
cmCacheManager::INTERNAL);
this->CacheManager->AddCacheEntry("CMAKE_EXTRA_GENERATOR",
- this->GlobalGenerator->GetExtraGeneratorName(),
- "Name of external makefile project generator.",
- cmCacheManager::INTERNAL);
+ this->GlobalGenerator->GetExtraGeneratorName().c_str(),
+ "Name of external makefile project generator.",
+ cmCacheManager::INTERNAL);
}
if(const char* tsName =
diff --git a/Source/cmake.h b/Source/cmake.h
index 933502a..3134493 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -175,7 +175,7 @@ class cmake
void PreLoadCMakeFiles();
///! Create a GlobalGenerator
- cmGlobalGenerator* CreateGlobalGenerator(const char* name);
+ cmGlobalGenerator* CreateGlobalGenerator(const std::string& name);
///! Return the global generator assigned to this instance of cmake
cmGlobalGenerator* GetGlobalGenerator() { return this->GlobalGenerator; }
@@ -380,7 +380,7 @@ protected:
void AddDefaultCommands();
void AddDefaultGenerators();
void AddDefaultExtraGenerators();
- void AddExtraGenerator(const char* name,
+ void AddExtraGenerator(const std::string& name,
CreateExtraGeneratorFunctionType newFunction);
cmPolicies *Policies;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c88ddb0aea36c22ec79cf7ff381c3f5710a66394
commit c88ddb0aea36c22ec79cf7ff381c3f5710a66394
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Feb 24 17:38:30 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:24 2014 -0500
stringapi: Use strings for directories
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a14696d..c1cce2e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1614,7 +1614,8 @@ void cmGlobalGenerator::CheckLocalGenerators()
}
}
-int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
+int cmGlobalGenerator::TryCompile(const std::string& srcdir,
+ const std::string& bindir,
const std::string& projectName,
const std::string& target, bool fast,
std::string *output, cmMakefile *mf)
@@ -1665,7 +1666,7 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
void cmGlobalGenerator::GenerateBuildCommand(
std::vector<std::string>& makeCommand, const char*, const std::string&,
- const char*, const std::string&, const std::string&, bool,
+ const std::string&, const std::string&, const std::string&, bool,
std::vector<std::string> const&)
{
makeCommand.push_back(
@@ -1673,7 +1674,7 @@ void cmGlobalGenerator::GenerateBuildCommand(
}
int cmGlobalGenerator::Build(
- const char *, const char *bindir,
+ const std::string&, const std::string& bindir,
const std::string& projectName, const std::string& target,
std::string *output,
const char *makeCommandCSTR,
@@ -1687,7 +1688,7 @@ int cmGlobalGenerator::Build(
* Run an executable command and put the stdout in output.
*/
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(bindir);
+ cmSystemTools::ChangeDirectory(bindir.c_str());
if(output)
{
*output += "Change Dir: ";
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 5b97960..761fb07 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -105,7 +105,7 @@ public:
* Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
- virtual int TryCompile(const char *srcdir, const char *bindir,
+ virtual int TryCompile(const std::string& srcdir, const std::string& bindir,
const std::string& projectName,
const std::string& targetName,
bool fast, std::string *output, cmMakefile* mf);
@@ -117,7 +117,7 @@ public:
* empty then all is assumed. clean indicates if a "make clean" should be
* done first.
*/
- int Build(const char *srcdir, const char *bindir,
+ int Build(const std::string& srcdir, const std::string& bindir,
const std::string& projectName, const std::string& targetName,
std::string *output,
const char *makeProgram, const std::string& config,
@@ -130,7 +130,7 @@ public:
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
const char* makeProgram,
- const std::string& projectName, const char *projectDir,
+ const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 16e9788..73a6245 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -553,7 +553,7 @@ void cmGlobalNinjaGenerator
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& /*projectName*/,
- const char* /*projectDir*/,
+ const std::string& /*projectDir*/,
const std::string& targetName,
const std::string& /*config*/,
bool /*fast*/,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 86c2912..4a28486 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -195,7 +195,7 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index d947150..9ddbe5b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -567,7 +567,7 @@ void cmGlobalUnixMakefileGenerator3
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& /*projectName*/,
- const char* /*projectDir*/,
+ const std::string& /*projectDir*/,
const std::string& targetName,
const std::string& /*config*/,
bool fast,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 8924fa8..d64afaf 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -111,7 +111,7 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 0bc572b..3819a5b 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -312,7 +312,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
@@ -334,7 +334,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
cmSlnData slnData;
{
std::string slnFile;
- if(projectDir && *projectDir)
+ if(!projectDir.empty())
{
slnFile = projectDir;
slnFile += "/";
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 085f2d2..5d902ee 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -36,7 +36,7 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 82047d7..3a51fce 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -118,7 +118,7 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* /*projectDir*/,
+ const std::string& /*projectDir*/,
const std::string& targetName,
const std::string& config,
bool /*fast*/,
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index f7ef972..eb3dddf 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -56,7 +56,7 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index c65bdaa..3927100 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -185,7 +185,7 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* /*projectDir*/,
+ const std::string& /*projectDir*/,
const std::string& targetName,
const std::string& config,
bool /*fast*/,
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 342fa88..b659480 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -64,7 +64,7 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ec2e1e9..e1f2a91 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -262,7 +262,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* /*projectDir*/,
+ const std::string& /*projectDir*/,
const std::string& targetName,
const std::string& config,
bool /*fast*/,
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index e9149c2..aec7958 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -57,7 +57,7 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName,
- const char* projectDir,
+ const std::string& projectDir,
const std::string& targetName,
const std::string& config,
bool fast,
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index bb88bc4..e61b12b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3060,7 +3060,8 @@ void cmMakefile::ExpandSourceListArguments(
}
}
-int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
+int cmMakefile::TryCompile(const std::string& srcdir,
+ const std::string& bindir,
const std::string& projectName,
const std::string& targetName,
bool fast,
@@ -3069,15 +3070,15 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
{
this->Internal->IsSourceFileTryCompile = fast;
// does the binary directory exist ? If not create it...
- if (!cmSystemTools::FileIsDirectory(bindir))
+ if (!cmSystemTools::FileIsDirectory(bindir.c_str()))
{
- cmSystemTools::MakeDirectory(bindir);
+ cmSystemTools::MakeDirectory(bindir.c_str());
}
// change to the tests directory and run cmake
// use the cmake object instead of calling cmake
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(bindir);
+ cmSystemTools::ChangeDirectory(bindir.c_str());
// make sure the same generator is used
// use this program as the cmake to be run, it should not
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 7c82ec2..fb40c1b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -126,7 +126,7 @@ public:
* Try running cmake and building a file. This is used for dynalically
* loaded commands, not as part of the usual build process.
*/
- int TryCompile(const char *srcdir, const char *bindir,
+ int TryCompile(const std::string& srcdir, const std::string& bindir,
const std::string& projectName, const std::string& targetName,
bool fast,
const std::vector<std::string> *cmakeArgs,
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 8eee991..48a6b38 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -952,7 +952,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
}
static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
- const char* targetDirectory)
+ const std::string& targetDirectory)
{
cmGlobalGenerator* gg = new cmGlobalGenerator();
gg->SetCMakeInstance(cm);
@@ -967,7 +967,7 @@ static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
return gg;
}
-bool cmQtAutoGenerators::Run(const char* targetDirectory,
+bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
const std::string& config)
{
bool success = true;
@@ -994,10 +994,11 @@ bool cmQtAutoGenerators::Run(const char* targetDirectory,
}
bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
- const char* targetDirectory,
+ const std::string& targetDirectory,
const std::string& config)
{
- std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
+ std::string filename(
+ cmSystemTools::CollapseFullPath(targetDirectory.c_str()));
cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutogenInfo.cmake";
@@ -1137,9 +1138,10 @@ std::string cmQtAutoGenerators::MakeCompileSettingsString(cmMakefile* makefile)
bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile,
- const char* targetDirectory)
+ const std::string& targetDirectory)
{
- std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
+ std::string filename(
+ cmSystemTools::CollapseFullPath(targetDirectory.c_str()));
cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutomocOldMocDefinitions.cmake";
@@ -1153,9 +1155,11 @@ bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile,
void
-cmQtAutoGenerators::WriteOldMocDefinitionsFile(const char* targetDirectory)
+cmQtAutoGenerators::WriteOldMocDefinitionsFile(
+ const std::string& targetDirectory)
{
- std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
+ std::string filename(
+ cmSystemTools::CollapseFullPath(targetDirectory.c_str()));
cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutomocOldMocDefinitions.cmake";
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index af4ceb9..a593dd5 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -21,7 +21,7 @@ class cmQtAutoGenerators
{
public:
cmQtAutoGenerators();
- bool Run(const char* targetDirectory, const std::string& config);
+ bool Run(const std::string& targetDirectory, const std::string& config);
bool InitializeAutogenTarget(cmTarget* target);
void SetupAutoGenerateTarget(cmTarget const* target);
@@ -37,11 +37,11 @@ private:
void SetupAutoRccTarget(cmTarget const* target);
bool ReadAutogenInfoFile(cmMakefile* makefile,
- const char* targetDirectory,
+ const std::string& targetDirectory,
const std::string& config);
bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
- const char* targetDirectory);
- void WriteOldMocDefinitionsFile(const char* targetDirectory);
+ const std::string& targetDirectory);
+ void WriteOldMocDefinitionsFile(const std::string& targetDirectory);
std::string MakeCompileSettingsString(cmMakefile* makefile);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5ada30e..13572f4 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2667,7 +2667,7 @@ int cmake::Build(const std::string& dir,
return 1;
}
projName = it.GetValue();
- return gen->Build(0, dir.c_str(),
+ return gen->Build("", dir.c_str(),
projName.c_str(), target.c_str(),
&output,
0,
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44cccc30926fe7708804fb76851b87dfdf8a332b
commit 44cccc30926fe7708804fb76851b87dfdf8a332b
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Feb 21 19:06:54 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:24 2014 -0500
stringapi: Add string overload for the Def struct
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 4c1ad0a..d615fb0 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -59,6 +59,7 @@ private:
public:
Def(): std_string(), Exists(false) {}
Def(const char* v): std_string(v?v:""), Exists(v?true:false) {}
+ Def(const std_string& v): std_string(v), Exists(true) {}
Def(Def const& d): std_string(d), Exists(d.Exists) {}
bool Exists;
};
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d320ee820dbf8bac87c54cd787d5d959276728e6
commit d320ee820dbf8bac87c54cd787d5d959276728e6
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Feb 21 19:05:55 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:24 2014 -0500
stringapi: Miscellaneous char* parameters
diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx
index 10af1f6..ef67b23 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.cxx
+++ b/Source/CPack/WiX/cmWIXPatchParser.cxx
@@ -34,12 +34,11 @@ cmWIXPatchParser::cmWIXPatchParser(
}
-void cmWIXPatchParser::StartElement(const char *name, const char **atts)
+void cmWIXPatchParser::StartElement(const std::string& name, const char **atts)
{
- std::string name_str = name;
if(State == BEGIN_DOCUMENT)
{
- if(name_str == "CPackWiXPatch")
+ if(name == "CPackWiXPatch")
{
State = BEGIN_FRAGMENTS;
}
@@ -50,7 +49,7 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
}
else if(State == BEGIN_FRAGMENTS)
{
- if(name_str == "CPackWiXFragment")
+ if(name == "CPackWiXFragment")
{
State = INSIDE_FRAGMENT;
StartFragment(atts);
@@ -107,12 +106,11 @@ void cmWIXPatchParser::StartFragment(const char **attributes)
}
}
-void cmWIXPatchParser::EndElement(const char *name)
+void cmWIXPatchParser::EndElement(const std::string& name)
{
- std::string name_str = name;
if(State == INSIDE_FRAGMENT)
{
- if(name_str == "CPackWiXFragment")
+ if(name == "CPackWiXFragment")
{
State = BEGIN_FRAGMENTS;
ElementStack.clear();
diff --git a/Source/CPack/WiX/cmWIXPatchParser.h b/Source/CPack/WiX/cmWIXPatchParser.h
index da3adf5..acfb4c0 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.h
+++ b/Source/CPack/WiX/cmWIXPatchParser.h
@@ -43,11 +43,11 @@ public:
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
private:
- virtual void StartElement(const char *name, const char **atts);
+ virtual void StartElement(const std::string& name, const char **atts);
void StartFragment(const char **attributes);
- virtual void EndElement(const char *name);
+ virtual void EndElement(const std::string& name);
virtual void ReportError(int line, int column, const char* msg);
void ReportValidationError(std::string const& message);
diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx
index f93eca8..77f11cb 100644
--- a/Source/CPack/cmCPackComponentGroup.cxx
+++ b/Source/CPack/cmCPackComponentGroup.cxx
@@ -16,7 +16,8 @@
#include <string>
//----------------------------------------------------------------------
-unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
+unsigned long cmCPackComponent::GetInstalledSize(
+ const std::string& installDir) const
{
if (this->TotalSize != 0)
{
@@ -37,7 +38,7 @@ unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
//----------------------------------------------------------------------
unsigned long
-cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const
+cmCPackComponent::GetInstalledSizeInKbytes(const std::string& installDir) const
{
unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
return result? result : 1;
diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h
index abae372..0679638 100644
--- a/Source/CPack/cmCPackComponentGroup.h
+++ b/Source/CPack/cmCPackComponentGroup.h
@@ -94,11 +94,11 @@ public:
/// Get the total installed size of all of the files in this
/// component, in bytes. installDir is the directory into which the
/// component was installed.
- unsigned long GetInstalledSize(const char* installDir) const;
+ unsigned long GetInstalledSize(const std::string& installDir) const;
/// Identical to GetInstalledSize, but returns the result in
/// kilobytes.
- unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
+ unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
private:
mutable unsigned long TotalSize;
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 3e1bf3b..a8e104b 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1139,7 +1139,7 @@ int cmCPackGenerator::DoPackage()
}
//----------------------------------------------------------------------
-int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf)
+int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
{
this->MakefileMap = mf;
this->Name = name;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index fadd1bf..efd3bef 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -90,7 +90,7 @@ public:
/**
* Initialize generator
*/
- int Initialize(const char* name, cmMakefile* mf);
+ int Initialize(const std::string& name, cmMakefile* mf);
/**
* Construct generator
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 95ffab5..28c7f1d 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -272,7 +272,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
//----------------------------------------------------------------------
bool cmCPackOSXX11Generator::CopyResourcePlistFile(const std::string& name,
- const char* dir, const char* outputFileName /* = 0 */,
+ const std::string& dir, const char* outputFileName /* = 0 */,
bool copyOnly /* = false */)
{
std::string inFName = "CPack.";
diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h
index 7a93f5a..9d0a6d1 100644
--- a/Source/CPack/cmCPackOSXX11Generator.h
+++ b/Source/CPack/cmCPackOSXX11Generator.h
@@ -39,7 +39,7 @@ protected:
//bool CopyCreateResourceFile(const std::string& name,
// const std::string& dir);
- bool CopyResourcePlistFile(const std::string& name, const char* dir,
+ bool CopyResourcePlistFile(const std::string& name, const std::string& dir,
const char* outputFileName = 0, bool copyOnly = false);
std::string InstallPrefix;
};
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 69886a1..d736948 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -43,14 +43,14 @@ bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
}
//----------------------------------------------------------------------
-int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir,
- const char* script,
- const char* name)
+int cmCPackPackageMakerGenerator::CopyInstallScript(const std::string& resdir,
+ const std::string& script,
+ const std::string& name)
{
std::string dst = resdir;
dst += "/";
dst += name;
- cmSystemTools::CopyFileAlways(script, dst.c_str());
+ cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str());
cmSystemTools::SetPermissions(dst.c_str(),0777);
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"copy script : " << script << "\ninto " << dst.c_str() <<
@@ -601,12 +601,13 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(
return true;
}
-bool cmCPackPackageMakerGenerator::CopyResourcePlistFile(const char* name,
- const char* outName)
+bool cmCPackPackageMakerGenerator::CopyResourcePlistFile(
+ const std::string& name,
+ const char* outName)
{
if (!outName)
{
- outName = name;
+ outName = name.c_str();
}
std::string inFName = "CPack.";
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index bebb633..e350a60 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -38,9 +38,9 @@ public:
virtual bool SupportsComponentInstallation() const;
protected:
- int CopyInstallScript(const char* resdir,
- const char* script,
- const char* name);
+ int CopyInstallScript(const std::string& resdir,
+ const std::string& script,
+ const std::string& name);
virtual int InitializeInternal();
int PackageFiles();
virtual const char* GetOutputExtension() { return ".dmg"; }
@@ -53,7 +53,7 @@ protected:
// which will be configured via ConfigureFile.
bool CopyCreateResourceFile(const std::string& name,
const std::string& dirName);
- bool CopyResourcePlistFile(const char* name, const char* outName = 0);
+ bool CopyResourcePlistFile(const std::string& name, const char* outName = 0);
// Run PackageMaker with the given command line, which will (if
// successful) produce the given package file. Returns true if
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 840ebc9..3014a93 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -225,35 +225,35 @@ private:
return true;
}
- virtual void StartElement(const char* name, const char**)
+ virtual void StartElement(const std::string& name, const char**)
{
this->CData.clear();
- if(strcmp(name, "log") == 0)
+ if(name == "log")
{
this->Rev = Revision();
this->Changes.clear();
}
// affected-files can contain blocks of
// modified, unknown, renamed, kind-changed, removed, conflicts, added
- else if(strcmp(name, "modified") == 0
- || strcmp(name, "renamed") == 0
- || strcmp(name, "kind-changed") == 0)
+ else if(name == "modified"
+ || name == "renamed"
+ || name == "kind-changed")
{
this->CurChange = Change();
this->CurChange.Action = 'M';
}
- else if(strcmp(name, "added") == 0)
+ else if(name == "added")
{
this->CurChange = Change();
this->CurChange = 'A';
}
- else if(strcmp(name, "removed") == 0)
+ else if(name == "removed")
{
this->CurChange = Change();
this->CurChange = 'D';
}
- else if(strcmp(name, "unknown") == 0
- || strcmp(name, "conflicts") == 0)
+ else if(name == "unknown"
+ || name == "conflicts")
{
// Should not happen here
this->CurChange = Change();
@@ -265,27 +265,27 @@ private:
this->CData.insert(this->CData.end(), data, data+length);
}
- virtual void EndElement(const char* name)
+ virtual void EndElement(const std::string& name)
{
- if(strcmp(name, "log") == 0)
+ if(name == "log")
{
this->BZR->DoRevision(this->Rev, this->Changes);
}
- else if((strcmp(name, "file") == 0 || strcmp(name, "directory") == 0)
- && !this->CData.empty())
+ else if(!this->CData.empty() &&
+ (name == "file" || name == "directory"))
{
this->CurChange.Path.assign(&this->CData[0], this->CData.size());
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange);
}
- else if(strcmp(name, "symlink") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "symlink")
{
// symlinks have an arobase at the end in the log
this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1);
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange);
}
- else if(strcmp(name, "committer") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "committer")
{
this->Rev.Author.assign(&this->CData[0], this->CData.size());
if(this->EmailRegex.find(this->Rev.Author))
@@ -294,15 +294,15 @@ private:
this->Rev.EMail = this->EmailRegex.match(2);
}
}
- else if(strcmp(name, "timestamp") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "timestamp")
{
this->Rev.Date.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "message") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "message")
{
this->Rev.Log.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "revno") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "revno")
{
this->Rev.Rev.assign(&this->CData[0], this->CData.size());
}
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 9738bde..c60ded0 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -131,8 +131,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string buildCommand
= this->GlobalGenerator->
GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "",
- cmakeBuildConfiguration,
- cmakeBuildAdditionalFlags, true);
+ cmakeBuildConfiguration,
+ cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:"
<< buildCommand.c_str() << "\n");
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 5bf9949..0f79d68 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -189,10 +189,10 @@ private:
return true;
}
- virtual void StartElement(const char* name, const char** atts)
+ virtual void StartElement(const std::string& name, const char** atts)
{
this->CData.clear();
- if(strcmp(name, "logentry") == 0)
+ if(name == "logentry")
{
this->Rev = Revision();
if(const char* rev = this->FindAttribute(atts, "revision"))
@@ -208,29 +208,29 @@ private:
this->CData.insert(this->CData.end(), data, data+length);
}
- virtual void EndElement(const char* name)
+ virtual void EndElement(const std::string& name)
{
- if(strcmp(name, "logentry") == 0)
+ if(name == "logentry")
{
this->HG->DoRevision(this->Rev, this->Changes);
}
- else if(strcmp(name, "author") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "author")
{
this->Rev.Author.assign(&this->CData[0], this->CData.size());
}
- else if ( strcmp(name, "email") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "email")
{
this->Rev.EMail.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "date") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "date")
{
this->Rev.Date.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "msg") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "msg")
{
this->Rev.Log.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "files") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "files")
{
std::vector<std::string> paths = this->SplitCData();
for(unsigned int i = 0; i < paths.size(); ++i)
@@ -242,7 +242,7 @@ private:
this->Changes.push_back(this->CurChange);
}
}
- else if(strcmp(name, "file_adds") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "file_adds")
{
std::string added_paths(this->CData.begin(), this->CData.end());
for(unsigned int i = 0; i < this->Changes.size(); ++i)
@@ -253,7 +253,7 @@ private:
}
}
}
- else if(strcmp(name, "file_dels") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "file_dels")
{
std::string added_paths(this->CData.begin(), this->CData.end());
for(unsigned int i = 0; i < this->Changes.size(); ++i)
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index f2982a4..f27dbc0 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -49,21 +49,15 @@ class cmBoundsCheckerParser : public cmXMLParser
{
public:
cmBoundsCheckerParser(cmCTest* c) { this->CTest = c;}
- void StartElement(const char* name, const char** atts)
+ void StartElement(const std::string& name, const char** atts)
{
- if(strcmp(name, "MemoryLeak") == 0)
+ if(name == "MemoryLeak" ||
+ name == "ResourceLeak")
{
this->Errors.push_back(cmCTestMemCheckHandler::MLK);
}
- if(strcmp(name, "ResourceLeak") == 0)
- {
- this->Errors.push_back(cmCTestMemCheckHandler::MLK);
- }
- if(strcmp(name, "Error") == 0)
- {
- this->ParseError(atts);
- }
- if(strcmp(name, "Dangling Pointer") == 0)
+ else if(name == "Error" ||
+ name == "Dangling Pointer")
{
this->ParseError(atts);
}
@@ -79,7 +73,7 @@ public:
ostr << "\n";
this->Log += ostr.str();
}
- void EndElement(const char* )
+ void EndElement(const std::string& )
{
}
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 89592dd..86dc2f2 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -361,10 +361,10 @@ private:
return true;
}
- virtual void StartElement(const char* name, const char** atts)
+ virtual void StartElement(const std::string& name, const char** atts)
{
this->CData.clear();
- if(strcmp(name, "logentry") == 0)
+ if(name == "logentry")
{
this->Rev = Revision();
this->Rev.SVNInfo = &SVNRepo;
@@ -374,7 +374,7 @@ private:
}
this->Changes.clear();
}
- else if(strcmp(name, "path") == 0)
+ else if(name == "path")
{
this->CurChange = Change();
if(const char* action = this->FindAttribute(atts, "action"))
@@ -389,28 +389,28 @@ private:
this->CData.insert(this->CData.end(), data, data+length);
}
- virtual void EndElement(const char* name)
+ virtual void EndElement(const std::string& name)
{
- if(strcmp(name, "logentry") == 0)
+ if(name == "logentry")
{
this->SVN->DoRevisionSVN(this->Rev, this->Changes);
}
- else if(strcmp(name, "path") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "path")
{
std::string orig_path(&this->CData[0], this->CData.size());
std::string new_path = SVNRepo.BuildLocalPath( orig_path );
this->CurChange.Path.assign(new_path);
this->Changes.push_back(this->CurChange);
}
- else if(strcmp(name, "author") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "author")
{
this->Rev.Author.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "date") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "date")
{
this->Rev.Date.assign(&this->CData[0], this->CData.size());
}
- else if(strcmp(name, "msg") == 0 && !this->CData.empty())
+ else if(!this->CData.empty() && name == "msg")
{
this->Rev.Log.assign(&this->CData[0], this->CData.size());
}
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 1cd8fc7..3173f15 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -68,10 +68,10 @@ private:
return val;
}
- virtual void StartElement(const char* name, const char** atts)
+ virtual void StartElement(const std::string& name, const char** atts)
{
this->CurrentValue.clear();
- if(strcmp(name, "cdash") == 0)
+ if(name == "cdash")
{
this->CDashVersion = this->FindAttribute(atts, "version");
}
@@ -82,9 +82,9 @@ private:
this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
}
- virtual void EndElement(const char* name)
+ virtual void EndElement(const std::string& name)
{
- if(strcmp(name, "status") == 0)
+ if(name == "status")
{
std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
if(status == "OK" || status == "SUCCESS")
@@ -100,15 +100,15 @@ private:
this->Status = STATUS_ERROR;
}
}
- else if(strcmp(name, "filename") == 0)
+ else if(name == "filename")
{
this->Filename = this->GetCurrentValue();
}
- else if(strcmp(name, "md5") == 0)
+ else if(name == "md5")
{
this->MD5 = this->GetCurrentValue();
}
- else if(strcmp(name, "message") == 0)
+ else if(name == "message")
{
this->Message = this->GetCurrentValue();
}
diff --git a/Source/CTest/cmParsePythonCoverage.cxx b/Source/CTest/cmParsePythonCoverage.cxx
index 38a770a..2578bb8 100644
--- a/Source/CTest/cmParsePythonCoverage.cxx
+++ b/Source/CTest/cmParsePythonCoverage.cxx
@@ -20,9 +20,9 @@ public:
protected:
- virtual void StartElement(const char* name, const char** atts)
+ virtual void StartElement(const std::string& name, const char** atts)
{
- if(strcmp(name, "class") == 0)
+ if(name == "class")
{
int tagCount = 0;
while(true)
@@ -57,7 +57,7 @@ protected:
++tagCount;
}
}
- else if(strcmp(name, "line") == 0)
+ else if(name == "line")
{
int tagCount = 0;
int curNumber = -1;
@@ -85,7 +85,7 @@ protected:
}
}
- virtual void EndElement(const char*) {}
+ virtual void EndElement(const std::string&) {}
private:
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx
index 652b2df..aa680fb 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -89,7 +89,7 @@ void cmCursesOptionsWidget::PreviousOption()
this->SetValue(this->Options[this->CurrentOption].c_str());
}
-void cmCursesOptionsWidget::SetOption(const char* value)
+void cmCursesOptionsWidget::SetOption(const std::string& value)
{
this->CurrentOption = 0; // default to 0 index
this->SetValue(value);
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h
index b52ac9d..5cee489 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.h
+++ b/Source/CursesDialog/cmCursesOptionsWidget.h
@@ -25,7 +25,7 @@ public:
// when this widget has focus. Returns true if the input was
// handled.
virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w);
- void SetOption(const char*);
+ void SetOption(const std::string&);
void AddOption(std::string const &);
void NextOption();
void PreviousOption();
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index bd1ff71..d25022d 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -195,7 +195,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
return true;
}
-void cmCursesStringWidget::SetString(const char* value)
+void cmCursesStringWidget::SetString(const std::string& value)
{
this->SetValue(value);
}
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index e939049..dd8c02a 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -37,7 +37,7 @@ public:
/**
* Set/Get the string.
*/
- void SetString(const char* value);
+ void SetString(const std::string& value);
const char* GetString();
virtual const char* GetValue();
diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx
index 5dffcaa..e5363f4 100644
--- a/Source/CursesDialog/cmCursesWidget.cxx
+++ b/Source/CursesDialog/cmCursesWidget.cxx
@@ -46,10 +46,10 @@ void cmCursesWidget::Move(int x, int y, bool isNewPage)
}
}
-void cmCursesWidget::SetValue(const char* value)
+void cmCursesWidget::SetValue(const std::string& value)
{
this->Value = value;
- set_field_buffer(this->Field, 0, value);
+ set_field_buffer(this->Field, 0, value.c_str());
}
const char* cmCursesWidget::GetValue()
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index 952c67a..d91a0cb 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -40,7 +40,7 @@ public:
* Set/Get the value (setting the value also changes the contents
* of the field buffer).
*/
- virtual void SetValue(const char* value);
+ virtual void SetValue(const std::string& value);
virtual const char* GetValue();
/**
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 39b9ae5..159f9c3 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -94,7 +94,7 @@ bool cmCacheManager::LoadCache(const std::string& path,
return this->LoadCache(path, internal, emptySet, emptySet);
}
-static bool ParseEntryWithoutType(const char* entry,
+static bool ParseEntryWithoutType(const std::string& entry,
std::string& var,
std::string& value)
{
@@ -132,7 +132,7 @@ static bool ParseEntryWithoutType(const char* entry,
return flag;
}
-bool cmCacheManager::ParseEntry(const char* entry,
+bool cmCacheManager::ParseEntry(const std::string& entry,
std::string& var,
std::string& value,
CacheEntryType& type)
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 573f828..07a8675 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -136,7 +136,7 @@ public:
return static_cast<int>(this->Cache.size()); }
///! Break up a line like VAR:type="value" into var, type and value
- static bool ParseEntry(const char* entry,
+ static bool ParseEntry(const std::string& entry,
std::string& var,
std::string& value,
CacheEntryType& type);
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index cf91c69..abd8ad5 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -50,7 +50,7 @@ public:
const char *GetMainExportFileName() const;
/** Set the namespace in which to place exported target names. */
- void SetNamespace(const char* ns) { this->Namespace = ns; }
+ void SetNamespace(const std::string& ns) { this->Namespace = ns; }
std::string GetNamespace() const { return this->Namespace; }
void SetExportOld(bool exportOld) { this->ExportOld = exportOld; }
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index b7af21b..a14696d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1790,7 +1790,7 @@ int cmGlobalGenerator::Build(
//----------------------------------------------------------------------------
std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
const std::string& target, const std::string& config,
- const char* native,
+ const std::string& native,
bool ignoreErrors)
{
std::string makeCommand = cmSystemTools::GetCMakeCommand();
@@ -1819,7 +1819,7 @@ std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
sep = " ";
}
}
- if(native && *native)
+ if(!native.empty())
{
makeCommand += sep;
makeCommand += native;
@@ -2528,9 +2528,10 @@ std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::AppendDirectoryForConfig(const char*,
+void cmGlobalGenerator::AppendDirectoryForConfig(const std::string&,
const std::string&,
- const char*, std::string&)
+ const std::string&,
+ std::string&)
{
// Subclasses that support multiple configurations should implement
// this method to append the subdirectory for the given build
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index e9a1b47..5b97960 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -138,7 +138,7 @@ public:
/** Generate a "cmake --build" call for a given target and config. */
std::string GenerateCMakeBuildCommand(const std::string& target,
const std::string& config,
- const char* native,
+ const std::string& native,
bool ignoreErrors);
///! Set the CMake instance
@@ -230,9 +230,9 @@ public:
/** Append the subdirectory for the given configuration. If anything is
appended the given prefix and suffix will be appended around it, which
is useful for leading or trailing slashes. */
- virtual void AppendDirectoryForConfig(const char* prefix,
+ virtual void AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir);
/** Get the manifest of all targets that will be built for each
@@ -292,7 +292,7 @@ public:
return this->BinaryDirectories.insert(dir).second;
}
/** Supported systems creates a GUID for the given name */
- virtual void CreateGUID(const char*) {}
+ virtual void CreateGUID(const std::string&) {}
/** Return true if the generated build tree may contain multiple builds.
i.e. "Can I build Debug and Release in the same tree?" */
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index f69bcfd..82047d7 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -418,9 +418,9 @@ void cmGlobalVisualStudio6Generator
//----------------------------------------------------------------------------
void
cmGlobalVisualStudio6Generator
-::AppendDirectoryForConfig(const char* prefix,
+::AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir)
{
if(!config.empty())
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 22ec926..f7ef972 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -81,9 +81,9 @@ public:
std::vector<cmLocalGenerator*>& generators);
/** Append the subdirectory for the given configuration. */
- virtual void AppendDirectoryForConfig(const char* prefix,
+ virtual void AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir);
///! What is the configurations directory variable called?
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 18f7f19..c65bdaa 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -924,7 +924,7 @@ std::string cmGlobalVisualStudio7Generator::GetGUID(const std::string& name)
}
-void cmGlobalVisualStudio7Generator::CreateGUID(const char* name)
+void cmGlobalVisualStudio7Generator::CreateGUID(const std::string& name)
{
std::string guidStoreName = name;
guidStoreName += "_GUID_CMAKE";
@@ -961,9 +961,9 @@ void cmGlobalVisualStudio7Generator
//----------------------------------------------------------------------------
void
cmGlobalVisualStudio7Generator
-::AppendDirectoryForConfig(const char* prefix,
+::AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir)
{
if(!config.empty())
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 009f002..342fa88 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -89,13 +89,13 @@ public:
std::vector<std::string> *GetConfigurations();
///! Create a GUID or get an existing one.
- void CreateGUID(const char* name);
+ void CreateGUID(const std::string& name);
std::string GetGUID(const std::string& name);
/** Append the subdirectory for the given configuration. */
- virtual void AppendDirectoryForConfig(const char* prefix,
+ virtual void AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir);
///! What is the configurations directory variable called?
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index c0077b9..ec2e1e9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -34,17 +34,17 @@ class cmXcodeVersionParser : public cmXMLParser
{
public:
cmXcodeVersionParser(): Version("1.5") {}
- void StartElement(const char* , const char** )
+ void StartElement(const std::string&, const char**)
{
this->Data = "";
}
- void EndElement(const char* name)
+ void EndElement(const std::string& name)
{
- if(strcmp(name, "key") == 0)
+ if(name == "key")
{
this->Key = this->Data;
}
- else if(strcmp(name, "string") == 0)
+ else if(name == "string")
{
if(this->Key == "CFBundleShortVersionString")
{
@@ -1005,7 +1005,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
gtgt->GetTargetSourceFileFlags(*i);
if(filetype &&
- strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0)
+ filetype->GetString() == "compiled.mach-o.objfile")
{
externalObjFiles.push_back(xsf);
}
@@ -3771,9 +3771,9 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator
-::AppendDirectoryForConfig(const char* prefix,
+::AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir)
{
if(this->XcodeVersion > 20)
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 03e75c4..e9149c2 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -72,9 +72,9 @@ public:
virtual void Generate();
/** Append the subdirectory for the given configuration. */
- virtual void AppendDirectoryForConfig(const char* prefix,
+ virtual void AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
- const char* suffix,
+ const std::string& suffix,
std::string& dir);
///! What is the configurations directory variable called?
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 2516613..f7088c2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1299,7 +1299,7 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands,
//----------------------------------------------------------------------------
std::string
cmLocalUnixMakefileGenerator3
-::CreateMakeVariable(const char* sin, const char* s2in)
+::CreateMakeVariable(const std::string& sin, const std::string& s2in)
{
std::string s = sin;
std::string s2 = s2in;
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 37ee874..39f213b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -75,7 +75,7 @@ public:
/**
* Set the flag used to keep the make program silent.
*/
- void SetMakeSilentFlag(const char* s) { this->MakeSilentFlag = s; }
+ void SetMakeSilentFlag(const std::string& s) { this->MakeSilentFlag = s; }
std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
/**
@@ -130,8 +130,9 @@ public:
* Set the string used to include one makefile into another default
* is include.
*/
- void SetIncludeDirective(const char* s) { this->IncludeDirective = s; }
- const char *GetIncludeDirective() { return this->IncludeDirective.c_str(); }
+ void SetIncludeDirective(const std::string& s)
+ { this->IncludeDirective = s; }
+ const std::string& GetIncludeDirective() { return this->IncludeDirective; }
/**
* Set max makefile variable size, default is 0 which means unlimited.
@@ -192,7 +193,8 @@ public:
static std::string ConvertToQuotedOutputPath(const char* p);
- std::string CreateMakeVariable(const char* sin, const char* s2in);
+ std::string CreateMakeVariable(const std::string& sin,
+ const std::string& s2in);
/** Called from command-line hook to bring dependencies up to date
for a target. */
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index aedd6ed..aa70ab9 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -19,7 +19,7 @@
class cmVS10XMLParser : public cmXMLParser
{
public:
- virtual void EndElement(const char* /* name */)
+ virtual void EndElement(const std::string& /* name */)
{
}
virtual void CharacterDataHandler(const char* data, int length)
@@ -30,14 +30,14 @@ class cmVS10XMLParser : public cmXMLParser
this->DoGUID = false;
}
}
- virtual void StartElement(const char* name, const char**)
+ virtual void StartElement(const std::string& name, const char**)
{
// once the GUID is found do nothing
if(this->GUID.size())
{
return;
}
- if(strcmp("ProjectGUID", name) == 0 || strcmp("ProjectGuid", name) == 0)
+ if("ProjectGUID" == name || "ProjectGuid" == name)
{
this->DoGUID = true;
}
@@ -98,7 +98,7 @@ void cmLocalVisualStudio10Generator::Generate()
void cmLocalVisualStudio10Generator
-::ReadAndStoreExternalGUID(const char* name,
+::ReadAndStoreExternalGUID(const std::string& name,
const char* path)
{
cmVS10XMLParser parser;
diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h
index 41db735..b50e345 100644
--- a/Source/cmLocalVisualStudio10Generator.h
+++ b/Source/cmLocalVisualStudio10Generator.h
@@ -34,7 +34,7 @@ public:
* Generate the makefile for this directory.
*/
virtual void Generate();
- virtual void ReadAndStoreExternalGUID(const char* name,
+ virtual void ReadAndStoreExternalGUID(const std::string& name,
const char* path);
protected:
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 5f98a71..0bbafd8 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2146,10 +2146,10 @@ std::string cmLocalVisualStudio7Generator
class cmVS7XMLParser : public cmXMLParser
{
public:
- virtual void EndElement(const char* /* name */)
+ virtual void EndElement(const std::string& /* name */)
{
}
- virtual void StartElement(const char* name, const char** atts)
+ virtual void StartElement(const std::string& name, const char** atts)
{
// once the GUID is found do nothing
if(this->GUID.size())
@@ -2157,7 +2157,7 @@ public:
return;
}
int i =0;
- if(strcmp("VisualStudioProject", name) == 0)
+ if("VisualStudioProject" == name)
{
while(atts[i])
{
@@ -2194,7 +2194,7 @@ public:
};
void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID(
- const char* name,
+ const std::string& name,
const char* path)
{
cmVS7XMLParser parser;
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index f9bb6e1..d2e66a5 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -51,7 +51,7 @@ public:
/**
* Specify the type of the build: static, dll, or executable.
*/
- void SetBuildType(BuildType,const char *name);
+ void SetBuildType(BuildType,const std::string& name);
void SetPlatformName(const char* n) { this->PlatformName = n;}
@@ -62,7 +62,7 @@ public:
void WriteStampFiles();
virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
- virtual void ReadAndStoreExternalGUID(const char* name,
+ virtual void ReadAndStoreExternalGUID(const std::string& name,
const char* path);
virtual void AddCMakeListsRules();
protected:
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 11b0387..6e93d22 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -81,7 +81,7 @@ std::string
cmLocalVisualStudioGenerator
::ConstructScript(cmCustomCommand const& cc,
const std::string& configName,
- const char* newline_text)
+ const std::string& newline_text)
{
bool useLocal = this->CustomCommandUseLocal();
const char* workingDirectory = cc.GetWorkingDirectory();
@@ -89,7 +89,7 @@ cmLocalVisualStudioGenerator
RelativeRoot relativeRoot = workingDirectory? NONE : START_OUTPUT;
// Avoid leading or trailing newlines.
- const char* newline = "";
+ std::string newline = "";
// Line to check for error between commands.
std::string check_error = newline_text;
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 2297072..94a6293 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -48,7 +48,7 @@ public:
/** Construct a script from the given list of command lines. */
std::string ConstructScript(cmCustomCommand const& cc,
const std::string& configName,
- const char* newline = "\n");
+ const std::string& newline = "\n");
/** Label to which to jump in a batch file after a failed step in a
sequence of custom commands. */
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 25ca168..5952444 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4100,7 +4100,8 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
}
//----------------------------------------------------------------------------
-bool cmTarget::ComputePDBOutputDir(const char* kind, const std::string& config,
+bool cmTarget::ComputePDBOutputDir(const std::string& kind,
+ const std::string& config,
std::string& out) const
{
// Look for a target property defining the target output directory
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 15f00be..d5ef18d 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -714,7 +714,7 @@ private:
bool
ComputeOutputDir(const std::string& config,
bool implib, std::string& out) const;
- bool ComputePDBOutputDir(const char* kind, const std::string& config,
+ bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
std::string& out) const;
// Cache import information from properties for each configuration.
diff --git a/Source/cmVisualStudioWCEPlatformParser.cxx b/Source/cmVisualStudioWCEPlatformParser.cxx
index 219a5eb..ca226fb 100644
--- a/Source/cmVisualStudioWCEPlatformParser.cxx
+++ b/Source/cmVisualStudioWCEPlatformParser.cxx
@@ -62,7 +62,7 @@ const char* cmVisualStudioWCEPlatformParser::GetArchitectureFamily() const
return 0;
}
-void cmVisualStudioWCEPlatformParser::StartElement(const char* name,
+void cmVisualStudioWCEPlatformParser::StartElement(const std::string& name,
const char** attributes)
{
if(this->FoundRequiredName)
@@ -72,7 +72,7 @@ void cmVisualStudioWCEPlatformParser::StartElement(const char* name,
this->CharacterData = "";
- if(strcmp(name, "PlatformData") == 0)
+ if(name == "PlatformData")
{
this->PlatformName = "";
this->OSMajorVersion = "";
@@ -80,7 +80,7 @@ void cmVisualStudioWCEPlatformParser::StartElement(const char* name,
this->Macros.clear();
}
- if(strcmp(name, "Macro") == 0)
+ if(name == "Macro")
{
std::string macroName;
std::string macroValue;
@@ -102,7 +102,7 @@ void cmVisualStudioWCEPlatformParser::StartElement(const char* name,
this->Macros[macroName] = macroValue;
}
}
- else if(strcmp(name, "Directories") == 0)
+ else if(name == "Directories")
{
for(const char** attr = attributes; *attr; attr += 2)
{
@@ -122,11 +122,11 @@ void cmVisualStudioWCEPlatformParser::StartElement(const char* name,
}
}
-void cmVisualStudioWCEPlatformParser::EndElement(const char* name)
+void cmVisualStudioWCEPlatformParser::EndElement(const std::string& name)
{
if(!this->RequiredName)
{
- if(strcmp(name, "PlatformName") == 0)
+ if(name == "PlatformName")
{
this->AvailablePlatforms.push_back(this->CharacterData);
}
@@ -138,19 +138,19 @@ void cmVisualStudioWCEPlatformParser::EndElement(const char* name)
return;
}
- if(strcmp(name, "PlatformName") == 0)
+ if(name == "PlatformName")
{
this->PlatformName = this->CharacterData;
}
- else if(strcmp(name, "OSMajorVersion") == 0)
+ else if(name == "OSMajorVersion")
{
this->OSMajorVersion = this->CharacterData;
}
- else if(strcmp(name, "OSMinorVersion") == 0)
+ else if(name == "OSMinorVersion")
{
this->OSMinorVersion = this->CharacterData;
}
- else if(strcmp(name, "Platform") == 0)
+ else if(name == "Platform")
{
if(this->PlatformName == this->RequiredName)
{
diff --git a/Source/cmVisualStudioWCEPlatformParser.h b/Source/cmVisualStudioWCEPlatformParser.h
index 466e1dd..042df01 100644
--- a/Source/cmVisualStudioWCEPlatformParser.h
+++ b/Source/cmVisualStudioWCEPlatformParser.h
@@ -41,8 +41,8 @@ public:
return this->AvailablePlatforms; }
protected:
- virtual void StartElement(const char* name, const char** attributes);
- void EndElement(const char* name);
+ virtual void StartElement(const std::string& name, const char** attributes);
+ void EndElement(const std::string& name);
void CharacterDataHandler(const char* data, int length);
private:
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index 3a6528a..ed2940a 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -38,12 +38,12 @@ public:
PBXType GetIsA() { return this->IsA;}
void SetString(const std::string& s);
- const char* GetString()
+ const std::string& GetString()
{
- return this->String.c_str();
+ return this->String;
}
- void AddAttribute(const char* name, cmXCodeObject* value)
+ void AddAttribute(const std::string& name, cmXCodeObject* value)
{
this->ObjectAttributes[name] = value;
}
@@ -79,11 +79,11 @@ public:
static void PrintList(std::vector<cmXCodeObject*> const&,
std::ostream& out);
- const char* GetId()
+ const std::string& GetId()
{
- return this->Id.c_str();
+ return this->Id;
}
- void SetId(const char* id)
+ void SetId(const std::string& id)
{
this->Id = id;
}
@@ -95,8 +95,8 @@ public:
{
this->Target = t;
}
- const char* GetComment() {return this->Comment.c_str();}
- bool HasComment() { return (this->Comment.size() != 0);}
+ const std::string& GetComment() {return this->Comment;}
+ bool HasComment() { return (!this->Comment.empty());}
cmXCodeObject* GetObject(const char* name)
{
if(this->ObjectAttributes.count(name))
@@ -141,7 +141,7 @@ public:
return this->DependTargets;
}
std::vector<cmXCodeObject*> const& GetObjectList() { return this->List;}
- void SetComment(const char* c) { this->Comment = c;}
+ void SetComment(const std::string& c) { this->Comment = c;}
static void PrintString(std::ostream& os,std::string String);
protected:
void PrintString(std::ostream& os) const;
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 0c53440..a73fd70 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -152,14 +152,14 @@ int cmXMLParser::ParsingComplete()
}
//----------------------------------------------------------------------------
-void cmXMLParser::StartElement(const char * name,
+void cmXMLParser::StartElement(const std::string& name,
const char ** /*atts*/)
{
std::cout << "Start element: " << name << std::endl;
}
//----------------------------------------------------------------------------
-void cmXMLParser::EndElement(const char * name)
+void cmXMLParser::EndElement(const std::string& name)
{
std::cout << "End element: " << name << std::endl;
}
diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h
index d916075..84a5a7d 100644
--- a/Source/cmXMLParser.h
+++ b/Source/cmXMLParser.h
@@ -74,11 +74,11 @@ protected:
* element. atts = Null-terminated array of attribute name/value pairs.
* Even indices are attribute names, and odd indices are values.
*/
- virtual void StartElement(const char* name, const char** atts);
+ virtual void StartElement(const std::string& name, const char** atts);
//! Called at the end of an element in the XML source opened when
//StartElement was called.
- virtual void EndElement(const char* name);
+ virtual void EndElement(const std::string& name);
//! Called when there is character data to handle.
virtual void CharacterDataHandler(const char* data, int length);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06ca66688fa30546d5fc09137a1cd6d874de7b1c
commit 06ca66688fa30546d5fc09137a1cd6d874de7b1c
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Feb 21 18:42:53 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:24 2014 -0500
typo: Match argument name with the header
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 70cc16f..b7af21b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -988,13 +988,13 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l,
}
}
-bool cmGlobalGenerator::IgnoreFile(const char* l) const
+bool cmGlobalGenerator::IgnoreFile(const char* ext) const
{
- if(!this->GetLanguageFromExtension(l).empty())
+ if(!this->GetLanguageFromExtension(ext).empty())
{
return false;
}
- return (this->IgnoreExtensions.count(l) > 0);
+ return (this->IgnoreExtensions.count(ext) > 0);
}
bool cmGlobalGenerator::GetLanguageEnabled(const std::string& l) const
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6df3ebc39cb0c0334236c4f1c530339a745f37f
commit b6df3ebc39cb0c0334236c4f1c530339a745f37f
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Feb 7 14:43:19 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:23 2014 -0500
stringapi: Pass strings as install directories in CPack
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 4c52c96..3e1bf3b 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -254,7 +254,7 @@ int cmCPackGenerator::InstallProject()
// If the project is a CMAKE project then run pre-install
// and then read the cmake_install script to run it
if ( !this->InstallProjectViaInstallCMakeProjects(
- setDestDir, bareTempInstallDirectory.c_str()) )
+ setDestDir, bareTempInstallDirectory) )
{
return 0;
}
@@ -269,7 +269,7 @@ int cmCPackGenerator::InstallProject()
//----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstallCommands(
- bool setDestDir, const char* tempInstallDirectory)
+ bool setDestDir, const std::string& tempInstallDirectory)
{
(void) setDestDir;
const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
@@ -312,7 +312,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
//----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstalledDirectories(
- bool setDestDir, const char* tempInstallDirectory)
+ bool setDestDir, const std::string& tempInstallDirectory)
{
(void)setDestDir;
(void)tempInstallDirectory;
@@ -349,7 +349,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
return 0;
}
std::vector<std::string>::iterator it;
- const char* tempDir = tempInstallDirectory;
+ const std::string& tempDir = tempInstallDirectory;
for ( it = installDirectoriesVector.begin();
it != installDirectoriesVector.end();
++it )
@@ -457,7 +457,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
//----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstallScript(
- bool setDestDir, const char* tempInstallDirectory)
+ bool setDestDir, const std::string& tempInstallDirectory)
{
const char* cmakeScripts
= this->GetOption("CPACK_INSTALL_SCRIPT");
@@ -499,7 +499,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
}
else
{
- this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory);
+ this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory.c_str());
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Using non-DESTDIR install... (this->SetOption)" << std::endl);
@@ -509,9 +509,9 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
}
this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR",
- tempInstallDirectory);
+ tempInstallDirectory.c_str());
this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
- tempInstallDirectory);
+ tempInstallDirectory.c_str());
int res = this->MakefileMap->ReadListFile(0, installScript.c_str());
if ( cmSystemTools::GetErrorOccuredFlag() || !res )
{
@@ -524,7 +524,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
//----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
- bool setDestDir, const char* baseTempInstallDirectory)
+ bool setDestDir, const std::string& baseTempInstallDirectory)
{
const char* cmakeProjects
= this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 7e7c94f..fadd1bf 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -190,13 +190,13 @@ protected:
//! Run install commands if specified
virtual int InstallProjectViaInstallCommands(
- bool setDestDir, const char* tempInstallDirectory);
+ bool setDestDir, const std::string& tempInstallDirectory);
virtual int InstallProjectViaInstallScript(
- bool setDestDir, const char* tempInstallDirectory);
+ bool setDestDir, const std::string& tempInstallDirectory);
virtual int InstallProjectViaInstalledDirectories(
- bool setDestDir, const char* tempInstallDirectory);
+ bool setDestDir, const std::string& tempInstallDirectory);
virtual int InstallProjectViaInstallCMakeProjects(
- bool setDestDir, const char* tempInstallDirectory);
+ bool setDestDir, const std::string& tempInstallDirectory);
/**
* The various level of support of
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef42507a93bdfaae12905994a0f5a9885945b142
commit ef42507a93bdfaae12905994a0f5a9885945b142
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Sun Feb 9 23:09:05 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:23 2014 -0500
stringapi: Use strings for feature arguments
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1ef4d46..bb88bc4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3801,7 +3801,7 @@ bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
}
//----------------------------------------------------------------------------
-const char* cmMakefile::GetFeature(const char* feature,
+const char* cmMakefile::GetFeature(const std::string& feature,
const std::string& config)
{
// TODO: Define accumulation policy for features (prepend, append, replace).
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1c3ad73..7c82ec2 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -811,7 +811,8 @@ public:
cmProperty::ScopeType scope) const;
bool GetPropertyAsBool(const std::string& prop) const;
- const char* GetFeature(const char* feature, const std::string& config);
+ const char* GetFeature(const std::string& feature,
+ const std::string& config);
// Get the properties
cmPropertyMap &GetProperties() { return this->Properties; };
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1af5d6c..f0c9a3f 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -2105,13 +2105,13 @@ void cmMakefileTargetGenerator::AddModuleDefinitionFlag(std::string& flags)
}
//----------------------------------------------------------------------------
-const char* cmMakefileTargetGenerator::GetFeature(const char* feature)
+const char* cmMakefileTargetGenerator::GetFeature(const std::string& feature)
{
return this->Target->GetFeature(feature, this->ConfigName);
}
//----------------------------------------------------------------------------
-bool cmMakefileTargetGenerator::GetFeatureAsBool(const char* feature)
+bool cmMakefileTargetGenerator::GetFeatureAsBool(const std::string& feature)
{
return cmSystemTools::IsOn(this->GetFeature(feature));
}
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 21eece4..573ce22 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -263,8 +263,8 @@ protected:
void AddFeatureFlags(std::string& flags, const std::string& lang);
// Feature query methods.
- const char* GetFeature(const char* feature);
- bool GetFeatureAsBool(const char* feature);
+ const char* GetFeature(const std::string& feature);
+ bool GetFeatureAsBool(const std::string& feature);
//==================================================================
// Convenience routines that do nothing more than forward to
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 78ff4e4..3ef236a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -97,13 +97,13 @@ std::string const& cmNinjaTargetGenerator::GetConfigName() const
}
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
-const char* cmNinjaTargetGenerator::GetFeature(const char* feature)
+const char* cmNinjaTargetGenerator::GetFeature(const std::string& feature)
{
return this->Target->GetFeature(feature, this->GetConfigName());
}
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
-bool cmNinjaTargetGenerator::GetFeatureAsBool(const char* feature)
+bool cmNinjaTargetGenerator::GetFeatureAsBool(const std::string& feature)
{
return cmSystemTools::IsOn(this->GetFeature(feature));
}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index c2e1947..e66e55f 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -70,8 +70,8 @@ protected:
std::string LanguageCompilerRule(const std::string& lang) const
{ return lang + "_COMPILER"; }
- const char* GetFeature(const char* feature);
- bool GetFeatureAsBool(const char* feature);
+ const char* GetFeature(const std::string& feature);
+ bool GetFeatureAsBool(const std::string& feature);
void AddFeatureFlags(std::string& flags, const std::string& lang);
/**
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b8e662a..25ca168 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2549,7 +2549,7 @@ void cmTarget::GetTargetVersion(bool soversion,
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetFeature(const char* feature,
+const char* cmTarget::GetFeature(const std::string& feature,
const std::string& config) const
{
if(!config.empty())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 65fbb0f..15f00be 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -232,7 +232,7 @@ public:
bool GetPropertyAsBool(const std::string& prop) const;
void CheckProperty(const std::string& prop, cmMakefile* context) const;
- const char* GetFeature(const char* feature,
+ const char* GetFeature(const std::string& feature,
const std::string& config) const;
bool IsImported() const {return this->IsImportedTarget;}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9aea0925b7af1332eabff69ae9c4b62c84f21231
commit 9aea0925b7af1332eabff69ae9c4b62c84f21231
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Sun Feb 9 23:07:44 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:23 2014 -0500
stringapi: Return a string reference for the configuration
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 8b26806..2d870fb 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -55,8 +55,8 @@ public:
const cmake* GetCMakeInstance() const;
cmake* GetCMakeInstance();
- const char* GetConfigName() const
- { return this->ConfigName.c_str(); }
+ std::string const& GetConfigName() const
+ { return this->ConfigName; }
/// @return whether we are processing the top CMakeLists.txt file.
bool isRootMakefile() const;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 1c43cb3..78ff4e4 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -91,7 +91,7 @@ cmGlobalNinjaGenerator* cmNinjaTargetGenerator::GetGlobalGenerator() const
return this->LocalGenerator->GetGlobalNinjaGenerator();
}
-const char* cmNinjaTargetGenerator::GetConfigName() const
+std::string const& cmNinjaTargetGenerator::GetConfigName() const
{
return this->LocalGenerator->GetConfigName();
}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index b3b37a4..c2e1947 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -65,7 +65,7 @@ protected:
cmMakefile* GetMakefile() const
{ return this->Makefile; }
- const char* GetConfigName() const;
+ std::string const& GetConfigName() const;
std::string LanguageCompilerRule(const std::string& lang) const
{ return lang + "_COMPILER"; }
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index 64b8c1f..c83e8c0 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -76,7 +76,7 @@ public:
* final name (but could be). Otherwise the returned name is the
* final name.
*/
- const char* GetName() const { return this->Name.c_str(); }
+ const std::string& GetName() const { return this->Name; }
/**
* Get the cmMakefile instance for which the source file was created.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f65b08baf52f03c19f65c738adb0fa2948318aa
commit 4f65b08baf52f03c19f65c738adb0fa2948318aa
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Sun Feb 9 22:48:34 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:17:21 2014 -0500
stringapi: Pass configuration names as strings
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index bed3891..4c52c96 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -623,7 +623,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
componentsVector.push_back(installComponent);
}
- const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
+ const char* buildConfigCstr = this->GetOption("CPACK_BUILD_CONFIG");
+ std::string buildConfig = buildConfigCstr ? buildConfigCstr : "";
cmGlobalGenerator* globalGenerator
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator);
@@ -822,9 +823,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< "'" << std::endl);
}
- if ( buildConfig && *buildConfig )
+ if (!buildConfig.empty())
{
- mf->AddDefinition("BUILD_TYPE", buildConfig);
+ mf->AddDefinition("BUILD_TYPE", buildConfig.c_str());
}
std::string installComponentLowerCase
= cmSystemTools::LowerCase(installComponent);
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 6c1c1de..2d1da55 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -172,7 +172,7 @@ satisfy dependencies.
//----------------------------------------------------------------------------
cmComputeLinkDepends
-::cmComputeLinkDepends(cmTarget const* target, const char* config,
+::cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head)
{
// Store context information.
@@ -184,7 +184,8 @@ cmComputeLinkDepends
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
// The configuration being linked.
- this->Config = (config && *config)? config : 0;
+ this->HasConfig = !config.empty();
+ this->Config = (this->HasConfig)? config : std::string();
this->LinkType = this->Target->ComputeLinkType(this->Config);
// Enable debug mode if requested.
@@ -255,7 +256,7 @@ cmComputeLinkDepends::Compute()
"---------------------------------------\n");
fprintf(stderr, "Link dependency analysis for target %s, config %s\n",
this->Target->GetName().c_str(),
- this->Config?this->Config:"noconfig");
+ this->HasConfig?this->Config.c_str():"noconfig");
this->DisplayConstraintGraph();
}
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index ac5e368..13fc993 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -32,7 +32,7 @@ class cmake;
class cmComputeLinkDepends
{
public:
- cmComputeLinkDepends(cmTarget const* target, const char* config,
+ cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head);
~cmComputeLinkDepends();
@@ -68,7 +68,8 @@ private:
bool DebugMode;
// Configuration information.
- const char* Config;
+ bool HasConfig;
+ std::string Config;
cmTarget::LinkLibraryType LinkType;
// Output information.
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 32b23b8..e4e2047 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -239,7 +239,7 @@ because this need be done only for shared libraries without soname-s.
//----------------------------------------------------------------------------
cmComputeLinkInformation
-::cmComputeLinkInformation(cmTarget const* target, const char* config,
+::cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget)
{
// Store context information.
@@ -505,7 +505,8 @@ bool cmComputeLinkInformation::Compute()
}
// Compute the ordered link line items.
- cmComputeLinkDepends cld(this->Target, this->Config, this->HeadTarget);
+ cmComputeLinkDepends cld(this->Target, this->Config.c_str(),
+ this->HeadTarget);
cld.SetOldLinkDirMode(this->OldLinkDirMode);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
@@ -624,7 +625,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
cmTarget const* tgt)
{
// Compute the proper name to use to link this library.
- const char* config = this->Config;
+ const std::string& config = this->Config;
bool impexe = (tgt && tgt->IsExecutableWithExports());
if(impexe && !this->UseImportLibrary && !this->LoaderFlag)
{
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index b5a8bec..e345fe2 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -29,7 +29,7 @@ class cmOrderDirectories;
class cmComputeLinkInformation
{
public:
- cmComputeLinkInformation(cmTarget const* target, const char* config,
+ cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget);
~cmComputeLinkInformation();
bool Compute();
@@ -82,7 +82,7 @@ private:
cmake* CMakeInstance;
// Configuration information.
- const char* Config;
+ std::string Config;
std::string LinkLanguage;
bool LinkDependsNoShared;
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 405643e..10041db 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -214,7 +214,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::set<std::string> emitted;
{
std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries(0, tlibs, depender);
+ depender->GetDirectLinkLibraries("", tlibs, depender);
// A target should not depend on itself.
emitted.insert(depender->GetName());
for(std::vector<std::string>::const_iterator lib = tlibs.begin();
@@ -274,7 +274,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
//----------------------------------------------------------------------------
void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
cmTarget const* dependee,
- const char *config,
+ const std::string& config,
std::set<std::string> &emitted)
{
cmTarget const* depender = this->Targets[depender_index];
@@ -317,7 +317,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
if(dependee)
{
- this->AddInterfaceDepends(depender_index, dependee, 0, emitted);
+ this->AddInterfaceDepends(depender_index, dependee, "", emitted);
std::vector<std::string> configs;
depender->GetMakefile()->GetConfigurations(configs);
for (std::vector<std::string>::const_iterator it = configs.begin();
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index db76a18..7553816 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -55,7 +55,7 @@ private:
const std::string& dependee_name,
bool linking, std::set<std::string> &emitted);
void AddInterfaceDepends(int depender_index, cmTarget const* dependee,
- const char *config,
+ const std::string& config,
std::set<std::string> &emitted);
cmGlobalGenerator* GlobalGenerator;
bool DebugMode;
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index ea3e814..ab7b024 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -357,7 +357,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
cmExportTryCompileFileGenerator tcfg;
tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
tcfg.SetExports(targets);
- tcfg.SetConfig(this->Makefile->GetDefinition(
+ tcfg.SetConfig(this->Makefile->GetSafeDefinition(
"CMAKE_TRY_COMPILE_CONFIGURATION"));
if(!tcfg.GenerateImportFile())
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index f24dfa2..d8a756d 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -18,7 +18,7 @@
//----------------------------------------------------------------------------
cmCustomCommandGenerator::cmCustomCommandGenerator(
- cmCustomCommand const& cc, const char* config, cmMakefile* mf):
+ cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
GE(new cmGeneratorExpression(cc.GetBacktrace()))
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
index 4e89f27..17d644a 100644
--- a/Source/cmCustomCommandGenerator.h
+++ b/Source/cmCustomCommandGenerator.h
@@ -22,14 +22,15 @@ class cmGeneratorExpression;
class cmCustomCommandGenerator
{
cmCustomCommand const& CC;
- const char* Config;
+ std::string Config;
cmMakefile* Makefile;
cmLocalGenerator* LG;
bool OldStyle;
bool MakeVars;
cmGeneratorExpression* GE;
public:
- cmCustomCommandGenerator(cmCustomCommand const& cc, const char* config,
+ cmCustomCommandGenerator(cmCustomCommand const& cc,
+ const std::string& config,
cmMakefile* mf);
~cmCustomCommandGenerator();
unsigned int GetNumberOfCommands() const;
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 308956a..f991f45 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -118,8 +118,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
void
cmExportBuildFileGenerator
::GenerateImportTargetsConfig(std::ostream& os,
- const char* config, std::string const& suffix,
- std::vector<std::string> &missingTargets)
+ const std::string& config,
+ std::string const& suffix,
+ std::vector<std::string> &missingTargets)
{
for(std::vector<cmTarget*>::const_iterator
tei = this->Exports.begin();
@@ -166,7 +167,8 @@ void cmExportBuildFileGenerator::SetExportSet(cmExportSet *exportSet)
//----------------------------------------------------------------------------
void
cmExportBuildFileGenerator
-::SetImportLocationProperty(const char* config, std::string const& suffix,
+::SetImportLocationProperty(const std::string& config,
+ std::string const& suffix,
cmTarget* target, ImportPropertyMap& properties)
{
// Get the makefile in which to lookup target information.
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index cea2099..c1bdb5b 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -52,7 +52,7 @@ protected:
// Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs,
@@ -66,7 +66,7 @@ protected:
int occurrences);
/** Fill in properties indicating built file locations. */
- void SetImportLocationProperty(const char* config,
+ void SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmTarget* target,
ImportPropertyMap& properties);
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c06f889..3c3c6df 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -35,7 +35,7 @@ cmExportFileGenerator::cmExportFileGenerator()
}
//----------------------------------------------------------------------------
-void cmExportFileGenerator::AddConfiguration(const char* config)
+void cmExportFileGenerator::AddConfiguration(const std::string& config)
{
this->Configurations.push_back(config);
}
@@ -117,12 +117,12 @@ bool cmExportFileGenerator::GenerateImportFile()
//----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
std::vector<std::string> &missingTargets)
{
// Construct the property configuration suffix.
std::string suffix = "_";
- if(config && *config)
+ if(!config.empty())
{
suffix += cmSystemTools::UpperCase(config);
}
@@ -345,7 +345,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true);
this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
- std::string exportDirs = cge->Evaluate(target->GetMakefile(), 0,
+ std::string exportDirs = cge->Evaluate(target->GetMakefile(), "",
false, target);
if (cge->GetHadContextSensitiveCondition())
@@ -426,7 +426,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop,
//----------------------------------------------------------------------------
void getCompatibleInterfaceProperties(cmTarget *target,
std::set<std::string> &ifaceProperties,
- const char *config)
+ const std::string& config)
{
cmComputeLinkInformation *info = target->GetLinkInformation(config);
@@ -490,7 +490,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
{
- getCompatibleInterfaceProperties(target, ifaceProperties, 0);
+ getCompatibleInterfaceProperties(target, ifaceProperties, "");
std::vector<std::string> configNames;
target->GetMakefile()->GetConfigurations(configNames);
@@ -687,7 +687,7 @@ cmExportFileGenerator::ReplaceInstallPrefix(std::string &)
//----------------------------------------------------------------------------
void
cmExportFileGenerator
-::SetImportLinkInterface(const char* config, std::string const& suffix,
+::SetImportLinkInterface(const std::string& config, std::string const& suffix,
cmGeneratorExpression::PreprocessContext preprocessRule,
cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets)
@@ -762,7 +762,8 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
void
cmExportFileGenerator
-::SetImportDetailProperties(const char* config, std::string const& suffix,
+::SetImportDetailProperties(const std::string& config,
+ std::string const& suffix,
cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets
)
@@ -864,11 +865,11 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os,
- const char* config)
+ const std::string& config)
{
os << "#----------------------------------------------------------------\n"
<< "# Generated CMake target import file";
- if(config)
+ if(!config.empty())
{
os << " for configuration \"" << config << "\".\n";
}
@@ -999,7 +1000,7 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
void
cmExportFileGenerator
-::GenerateImportPropertyCode(std::ostream& os, const char* config,
+::GenerateImportPropertyCode(std::ostream& os, const std::string& config,
cmTarget const* target,
ImportPropertyMap const& properties)
{
@@ -1013,7 +1014,7 @@ cmExportFileGenerator
<< config << "\"\n";
os << "set_property(TARGET " << targetName
<< " APPEND PROPERTY IMPORTED_CONFIGURATIONS ";
- if(config && *config)
+ if(!config.empty())
{
os << cmSystemTools::UpperCase(config);
}
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 9e3ce0b..cf91c69 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -56,7 +56,7 @@ public:
void SetExportOld(bool exportOld) { this->ExportOld = exportOld; }
/** Add a configuration to be exported. */
- void AddConfiguration(const char* config);
+ void AddConfiguration(const std::string& config);
/** Actually generate the export file. Returns whether there was an
error. */
@@ -67,15 +67,16 @@ protected:
// Generate per-configuration target information to the given output
// stream.
- void GenerateImportConfig(std::ostream& os, const char* config,
+ void GenerateImportConfig(std::ostream& os, const std::string& config,
std::vector<std::string> &missingTargets);
// Methods to implement export file code generation.
- void GenerateImportHeaderCode(std::ostream& os, const char* config = 0);
+ void GenerateImportHeaderCode(std::ostream& os,
+ const std::string& config = "");
void GenerateImportFooterCode(std::ostream& os);
void GenerateImportVersionCode(std::ostream& os);
void GenerateImportTargetCode(std::ostream& os, cmTarget const* target);
- void GenerateImportPropertyCode(std::ostream& os, const char* config,
+ void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
cmTarget const* target,
ImportPropertyMap const& properties);
void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target,
@@ -90,7 +91,7 @@ protected:
// Collect properties with detailed information about targets beyond
// their location on disk.
- void SetImportDetailProperties(const char* config,
+ void SetImportDetailProperties(const std::string& config,
std::string const& suffix, cmTarget* target,
ImportPropertyMap& properties,
std::vector<std::string>& missingTargets);
@@ -105,7 +106,7 @@ protected:
/** Each subclass knows where the target files are located. */
virtual void GenerateImportTargetsConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets) = 0;
@@ -137,7 +138,8 @@ protected:
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets);
- void SetImportLinkInterface(const char* config, std::string const& suffix,
+ void SetImportLinkInterface(const std::string& config,
+ std::string const& suffix,
cmGeneratorExpression::PreprocessContext preprocessRule,
cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index b579963..5e7d5e4 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -240,7 +240,8 @@ cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string &input)
//----------------------------------------------------------------------------
bool
-cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
+cmExportInstallFileGenerator::GenerateImportFileConfig(
+ const std::string& config,
std::vector<std::string> &missingTargets)
{
// Skip configurations not enabled for this export.
@@ -254,7 +255,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
fileName += "/";
fileName += this->FileBase;
fileName += "-";
- if(config && *config)
+ if(!config.empty())
{
fileName += cmSystemTools::LowerCase(config);
}
@@ -296,7 +297,8 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
void
cmExportInstallFileGenerator
::GenerateImportTargetsConfig(std::ostream& os,
- const char* config, std::string const& suffix,
+ const std::string& config,
+ std::string const& suffix,
std::vector<std::string> &missingTargets)
{
// Add each target in the set to the export.
@@ -355,7 +357,8 @@ cmExportInstallFileGenerator
//----------------------------------------------------------------------------
void
cmExportInstallFileGenerator
-::SetImportLocationProperty(const char* config, std::string const& suffix,
+::SetImportLocationProperty(const std::string& config,
+ std::string const& suffix,
cmInstallTargetGenerator* itgen,
ImportPropertyMap& properties,
std::set<std::string>& importedLocations
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index 5ee2a78..b851ad5 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -52,7 +52,7 @@ protected:
// Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs,
@@ -72,11 +72,11 @@ protected:
/** Generate a per-configuration file for the targets. */
- bool GenerateImportFileConfig(const char* config,
+ bool GenerateImportFileConfig(const std::string& config,
std::vector<std::string> &missingTargets);
/** Fill in properties indicating installed file locations. */
- void SetImportLocationProperty(const char* config,
+ void SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmInstallTargetGenerator* itgen,
ImportPropertyMap& properties,
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index a16fe6b..ec70d81 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -23,14 +23,14 @@ public:
/** Set the list of targets to export. */
void SetExports(const std::vector<cmTarget const*> &exports)
{ this->Exports = exports; }
- void SetConfig(const char *config) { this->Config = config; }
+ void SetConfig(const std::string& config) { this->Config = config; }
protected:
// Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream&,
- const char*,
+ const std::string&,
std::string const&,
std::vector<std::string>&) {}
virtual void HandleMissingTarget(std::string&,
@@ -51,7 +51,7 @@ private:
std::vector<cmTarget const*> Exports;
- const char *Config;
+ std::string Config;
};
#endif
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 9c2849c..03c7c92 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -375,7 +375,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source,
{
language = "C";
}
- const char* config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
// Add language-specific flags.
lg->AddLanguageFlags(flags, language, config);
@@ -425,7 +425,7 @@ ComputeDefines(cmSourceFile *source, cmLocalGenerator* lg, cmTarget *target,
std::set<std::string> defines;
cmMakefile *makefile = lg->GetMakefile();
const std::string& language = source->GetLanguage();
- const char* config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
// Add the export symbol definition for shared library objects.
if(const char* exportMacro = target->GetExportMacro())
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 433adcf..e4187d2 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -52,7 +52,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
- cmMakefile* mf, const char* config, bool quiet,
+ cmMakefile* mf, const std::string& config, bool quiet,
cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
@@ -66,7 +66,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
- cmMakefile* mf, const char* config, bool quiet,
+ cmMakefile* mf, const std::string& config, bool quiet,
cmTarget const* headTarget,
cmTarget const* currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 9aa590d..5b97e8b 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -78,12 +78,12 @@ private:
class cmCompiledGeneratorExpression
{
public:
- const char* Evaluate(cmMakefile* mf, const char* config,
+ const char* Evaluate(cmMakefile* mf, const std::string& config,
bool quiet = false,
cmTarget const* headTarget = 0,
cmTarget const* currentTarget = 0,
cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
- const char* Evaluate(cmMakefile* mf, const char* config,
+ const char* Evaluate(cmMakefile* mf, const std::string& config,
bool quiet,
cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index bf85870..90ce27c 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -33,7 +33,7 @@ cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
}
//----------------------------------------------------------------------------
-void cmGeneratorExpressionEvaluationFile::Generate(const char *config,
+void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string> &outputFiles)
{
@@ -135,7 +135,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
if (allConfigs.empty())
{
- this->Generate(0, inputExpression.get(), outputFiles);
+ this->Generate("", inputExpression.get(), outputFiles);
}
else
{
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 20ee5cb..f939916 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -32,7 +32,7 @@ public:
std::vector<std::string> GetFiles() const { return this->Files; }
private:
- void Generate(const char *config,
+ void Generate(const std::string& config,
cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string> &outputFiles);
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index d12a66d..43c1794 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -689,7 +689,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *) const
{
context->HadContextSensitiveCondition = true;
- return context->Config ? context->Config : "";
+ return context->Config;
}
} configurationNode;
@@ -718,13 +718,13 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
return std::string();
}
context->HadContextSensitiveCondition = true;
- if (!context->Config)
+ if (context->Config.empty())
{
return parameters.front().empty() ? "1" : "0";
}
if (cmsysString_strcasecmp(parameters.begin()->c_str(),
- context->Config) == 0)
+ context->Config.c_str()) == 0)
{
return "1";
}
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 0c8a9cf..a7099cb 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -27,7 +27,7 @@ struct cmGeneratorExpressionContext
std::set<cmTarget const*> AllTargets;
std::set<std::string> SeenTargetProperties;
cmMakefile *Makefile;
- const char *Config;
+ std::string Config;
cmTarget const* HeadTarget; // The target whose property is being evaluated.
cmTarget const* CurrentTarget; // The dependent of HeadTarget which appears
// directly or indirectly in the property.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f7f6feb..eb67f91 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -252,7 +252,8 @@ cmGeneratorTarget::GetSourceDepends(cmSourceFile* sf) const
}
static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
- const char *config, cmTarget *headTarget,
+ const std::string& config,
+ cmTarget *headTarget,
cmGeneratorExpressionDAGChecker *dagChecker,
std::vector<std::string>& result,
bool excludeImported)
@@ -390,12 +391,12 @@ void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const
}
//----------------------------------------------------------------------------
-bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
- const char *config) const
+bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
+ const std::string& config) const
{
assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
std::string config_upper;
- if(config && *config)
+ if(!config.empty())
{
config_upper = cmSystemTools::UpperCase(config);
}
@@ -802,7 +803,7 @@ cmTargetTraceDependencies
{
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
= ge.Parse(*cli);
- cge->Evaluate(this->Makefile, 0, true);
+ cge->Evaluate(this->Makefile, "", true);
std::set<cmTarget*> geTargets = cge->GetTargets();
for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
it != geTargets.end(); ++it)
@@ -863,11 +864,11 @@ void cmGeneratorTarget::TraceDependencies()
}
//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetAppleArchs(const char* config,
+void cmGeneratorTarget::GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const
{
const char* archs = 0;
- if(config && *config)
+ if(!config.empty())
{
std::string defVarName = "OSX_ARCHITECTURES_";
defVarName += cmSystemTools::UpperCase(config);
@@ -904,13 +905,14 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() const
//----------------------------------------------------------------------------
std::vector<std::string>
-cmGeneratorTarget::GetIncludeDirectories(const char *config) const
+cmGeneratorTarget::GetIncludeDirectories(const std::string& config) const
{
return this->Target->GetIncludeDirectories(config);
}
//----------------------------------------------------------------------------
-void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
+void cmGeneratorTarget::GenerateTargetManifest(
+ const std::string& config) const
{
if (this->Target->IsImported())
{
@@ -953,35 +955,35 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
f = dir;
f += "/";
f += name;
- gg->AddToManifest(config? config:"", f);
+ gg->AddToManifest(config, f);
}
if(!soName.empty())
{
f = dir;
f += "/";
f += soName;
- gg->AddToManifest(config? config:"", f);
+ gg->AddToManifest(config, f);
}
if(!realName.empty())
{
f = dir;
f += "/";
f += realName;
- gg->AddToManifest(config? config:"", f);
+ gg->AddToManifest(config, f);
}
if(!pdbName.empty())
{
f = dir;
f += "/";
f += pdbName;
- gg->AddToManifest(config? config:"", f);
+ gg->AddToManifest(config, f);
}
if(!impName.empty())
{
f = this->Target->GetDirectory(config, true);
f += "/";
f += impName;
- gg->AddToManifest(config? config:"", f);
+ gg->AddToManifest(config, f);
}
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index b15bade..81a447f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -61,7 +61,7 @@ public:
void UseObjectLibraries(std::vector<std::string>& objs) const;
- void GetAppleArchs(const char* config,
+ void GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const;
///! Return the rule variable used to create this type of target,
@@ -69,12 +69,14 @@ public:
const char* GetCreateRuleVariable() const;
/** Get the include directories for this target. */
- std::vector<std::string> GetIncludeDirectories(const char *config) const;
+ std::vector<std::string> GetIncludeDirectories(
+ const std::string& config) const;
- bool IsSystemIncludeDirectory(const char *dir, const char *config) const;
+ bool IsSystemIncludeDirectory(const std::string& dir,
+ const std::string& config) const;
/** Add the target output files to the global generator manifest. */
- void GenerateTargetManifest(const char* config) const;
+ void GenerateTargetManifest(const std::string& config) const;
/**
* Trace through the source files in this target and add al source files
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9748c61..70cc16f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1655,7 +1655,8 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
#endif // WIN32
#endif
}
- const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
+ std::string config =
+ mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
return this->Build(srcdir,bindir,projectName,
newTarget.c_str(),
output,0,config,false,fast,
@@ -1664,7 +1665,7 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
void cmGlobalGenerator::GenerateBuildCommand(
std::vector<std::string>& makeCommand, const char*, const std::string&,
- const char*, const std::string&, const char*, bool,
+ const char*, const std::string&, const std::string&, bool,
std::vector<std::string> const&)
{
makeCommand.push_back(
@@ -1676,7 +1677,7 @@ int cmGlobalGenerator::Build(
const std::string& projectName, const std::string& target,
std::string *output,
const char *makeCommandCSTR,
- const char *config,
+ const std::string& config,
bool clean, bool fast,
double timeout,
cmSystemTools::OutputOption outputflag,
@@ -1788,13 +1789,14 @@ int cmGlobalGenerator::Build(
//----------------------------------------------------------------------------
std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
- const std::string& target, const char* config, const char* native,
+ const std::string& target, const std::string& config,
+ const char* native,
bool ignoreErrors)
{
std::string makeCommand = cmSystemTools::GetCMakeCommand();
makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str());
makeCommand += " --build .";
- if(config && *config)
+ if(!config.empty())
{
makeCommand += " --config \"";
makeCommand += config;
@@ -2526,7 +2528,8 @@ std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
+void cmGlobalGenerator::AppendDirectoryForConfig(const char*,
+ const std::string&,
const char*, std::string&)
{
// Subclasses that support multiple configurations should implement
@@ -2677,7 +2680,7 @@ void cmGlobalGenerator::AddTargetDepends(cmTarget const* target,
//----------------------------------------------------------------------------
-void cmGlobalGenerator::AddToManifest(const char* config,
+void cmGlobalGenerator::AddToManifest(const std::string& config,
std::string const& f)
{
// Add to the main manifest for this configuration.
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index f06162c..e9a1b47 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -120,7 +120,7 @@ public:
int Build(const char *srcdir, const char *bindir,
const std::string& projectName, const std::string& targetName,
std::string *output,
- const char *makeProgram, const char *config,
+ const char *makeProgram, const std::string& config,
bool clean, bool fast,
double timeout,
cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
@@ -131,13 +131,13 @@ public:
std::vector<std::string>& makeCommand,
const char* makeProgram,
const std::string& projectName, const char *projectDir,
- const std::string& targetName, const char* config, bool fast,
+ const std::string& targetName, const std::string& config, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
/** Generate a "cmake --build" call for a given target and config. */
std::string GenerateCMakeBuildCommand(const std::string& target,
- const char* config,
+ const std::string& config,
const char* native,
bool ignoreErrors);
@@ -173,7 +173,7 @@ public:
cmExportSetMap& GetExportSets() {return this->ExportSets;}
/** Add a file to the manifest of generated targets for a configuration. */
- void AddToManifest(const char* config, std::string const& f);
+ void AddToManifest(const std::string& config, std::string const& f);
void EnableInstallTarget();
@@ -231,7 +231,7 @@ public:
appended the given prefix and suffix will be appended around it, which
is useful for leading or trailing slashes. */
virtual void AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir);
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 977b3a1..16e9788 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -555,7 +555,7 @@ void cmGlobalNinjaGenerator
const std::string& /*projectName*/,
const char* /*projectDir*/,
const std::string& targetName,
- const char* /*config*/,
+ const std::string& /*config*/,
bool /*fast*/,
std::vector<std::string> const& makeOptions)
{
@@ -834,8 +834,8 @@ void
cmGlobalNinjaGenerator
::AppendTargetOutputs(cmTarget const* target, cmNinjaDeps& outputs)
{
- const char* configName =
- target->GetMakefile()->GetDefinition("CMAKE_BUILD_TYPE");
+ std::string configName =
+ target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
cmLocalNinjaGenerator *ng =
static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index e422e36..86c2912 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -197,7 +197,7 @@ public:
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index a392aa6..d947150 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -569,7 +569,7 @@ void cmGlobalUnixMakefileGenerator3
const std::string& /*projectName*/,
const char* /*projectDir*/,
const std::string& targetName,
- const char* /*config*/,
+ const std::string& /*config*/,
bool fast,
std::vector<std::string> const& makeOptions)
{
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index b61619d..8924fa8 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -113,7 +113,7 @@ public:
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index a2991e1..0bc572b 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -314,7 +314,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions)
{
@@ -397,7 +397,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
makeCommand.push_back(targetProject);
}
std::string configArg = "/p:Configuration=";
- if(config && strlen(config))
+ if(!config.empty())
{
configArg += config;
}
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 97ac9bc..085f2d2 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -38,7 +38,7 @@ public:
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index a7f6587..f69bcfd 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -120,7 +120,7 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
const std::string& projectName,
const char* /*projectDir*/,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool /*fast*/,
std::vector<std::string> const& makeOptions
)
@@ -149,7 +149,7 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
targetArg += "ALL_BUILD";
}
targetArg += " - ";
- if(config && strlen(config))
+ if(!config.empty())
{
targetArg += config;
}
@@ -419,11 +419,11 @@ void cmGlobalVisualStudio6Generator
void
cmGlobalVisualStudio6Generator
::AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir)
{
- if(config)
+ if(!config.empty())
{
dir += prefix;
dir += config;
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 3665f7b..22ec926 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -58,7 +58,7 @@ public:
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
@@ -82,7 +82,7 @@ public:
/** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 2a97edc..18f7f19 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -187,7 +187,7 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
const std::string& projectName,
const char* /*projectDir*/,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool /*fast*/,
std::vector<std::string> const& makeOptions)
{
@@ -224,7 +224,7 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
makeCommand.push_back("/build");
}
- if(config && strlen(config))
+ if(!config.empty())
{
makeCommand.push_back(config);
}
@@ -962,11 +962,11 @@ void cmGlobalVisualStudio7Generator
void
cmGlobalVisualStudio7Generator
::AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir)
{
- if(config)
+ if(!config.empty())
{
dir += prefix;
dir += config;
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 2e58f6c..009f002 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -66,7 +66,7 @@ public:
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
@@ -94,7 +94,7 @@ public:
/** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 08e9adf..c0077b9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -264,7 +264,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
const std::string& projectName,
const char* /*projectDir*/,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool /*fast*/,
std::vector<std::string> const& makeOptions)
{
@@ -298,11 +298,6 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
makeCommand.push_back("build");
}
makeCommand.push_back("-target");
- // if it is a null string for config don't use it
- if(config && *config == 0)
- {
- config = 0;
- }
if (!realTarget.empty())
{
makeCommand.push_back(realTarget);
@@ -319,7 +314,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
else
{
makeCommand.push_back("-configuration");
- makeCommand.push_back(config?config:"Debug");
+ makeCommand.push_back(!config.empty()?config:"Debug");
}
makeCommand.insert(makeCommand.end(),
makeOptions.begin(), makeOptions.end());
@@ -1547,7 +1542,7 @@ void cmGlobalXCodeGenerator
cmTarget& target,
std::vector<cmCustomCommand>
const & commands,
- const char* configName,
+ const std::string& configName,
const std::map<std::string,
std::string>& multipleOutputPairs
)
@@ -1690,8 +1685,8 @@ void cmGlobalXCodeGenerator
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
- cmXCodeObject* buildSettings,
- const char* configName)
+ cmXCodeObject* buildSettings,
+ const std::string& configName)
{
if(target.GetType() == cmTarget::INTERFACE_LIBRARY)
{
@@ -1804,7 +1799,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CurrentLocalGenerator->
AppendFlags(extraLinkOptions, targetLinkFlags);
}
- if(configName && *configName)
+ if(!configName.empty())
{
std::string linkFlagsVar = "LINK_FLAGS_";
linkFlagsVar += cmSystemTools::UpperCase(configName);
@@ -2738,7 +2733,7 @@ void cmGlobalXCodeGenerator
::AppendBuildSettingAttribute(cmXCodeObject* target,
const char* attribute,
const char* value,
- const char* configName)
+ const std::string& configName)
{
if(this->XcodeVersion < 21)
{
@@ -2761,9 +2756,9 @@ void cmGlobalXCodeGenerator
for(std::vector<cmXCodeObject*>::iterator i = list.begin();
i != list.end(); ++i)
{
- if(configName)
+ if(!configName.empty())
{
- if(strcmp((*i)->GetObject("name")->GetString(), configName) == 0)
+ if((*i)->GetObject("name")->GetString() == configName)
{
cmXCodeObject* settings = (*i)->GetObject("buildSettings");
this->AppendOrAddBuildSetting(settings, attribute, value);
@@ -3777,13 +3772,13 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
void
cmGlobalXCodeGenerator
::AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir)
{
if(this->XcodeVersion > 20)
{
- if(config)
+ if(!config.empty())
{
dir += prefix;
dir += config;
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index d2dd491..03e75c4 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -59,7 +59,7 @@ public:
const std::string& projectName,
const char* projectDir,
const std::string& targetName,
- const char* config,
+ const std::string& config,
bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
);
@@ -73,7 +73,7 @@ public:
/** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* prefix,
- const char* config,
+ const std::string& config,
const char* suffix,
std::string& dir);
@@ -123,7 +123,7 @@ private:
void CreateCustomRulesMakefile(const char* makefileBasename,
cmTarget& target,
std::vector<cmCustomCommand> const & commands,
- const char* configName,
+ const std::string& configName,
const std::map<std::string, std::string>&
multipleOutputPairs
);
@@ -147,12 +147,13 @@ private:
void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr,
const char* value);
void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr,
- const char* value, const char* configName);
+ const char* value,
+ const std::string& configName);
cmXCodeObject* CreateUtilityTarget(cmTarget& target);
void AddDependAndLinkInformation(cmXCodeObject* target);
void CreateBuildSettings(cmTarget& target,
cmXCodeObject* buildSettings,
- const char* buildType);
+ const std::string& buildType);
std::string ExtractFlag(const char* flag, std::string& flags);
// delete all objects in the this->XCodeObjects vector.
void ClearXCodeObjects();
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 045cff6..d2737a1 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -142,7 +142,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
this->EFGen->SetExportOld(this->ExportOld);
if(this->ConfigurationTypes->empty())
{
- if(this->ConfigurationName && *this->ConfigurationName)
+ if(!this->ConfigurationName.empty())
{
this->EFGen->AddConfiguration(this->ConfigurationName);
}
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index ec15044..6594218 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -80,8 +80,8 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
//----------------------------------------------------------------------------
void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
- const char* config,
- Indent const& indent)
+ const std::string& config,
+ Indent const& indent)
{
std::vector<std::string> files;
cmListFileBacktrace lfbt;
diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h
index 9dea296..23bf935 100644
--- a/Source/cmInstallFilesGenerator.h
+++ b/Source/cmInstallFilesGenerator.h
@@ -35,7 +35,7 @@ public:
protected:
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
Indent const& indent);
void AddFilesInstallRule(std::ostream& os, Indent const& indent,
std::vector<std::string> const& files);
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index d105a0c..0fad9d6 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -163,7 +163,7 @@ void cmInstallGenerator::GenerateScript(std::ostream& os)
}
//----------------------------------------------------------------------------
-bool cmInstallGenerator::InstallsForConfig(const char* config)
+bool cmInstallGenerator::InstallsForConfig(const std::string& config)
{
return this->GeneratesForConfig(config);
}
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index c89ab8a..c72e9e9 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -48,7 +48,7 @@ public:
std::string GetInstallDestination() const;
/** Test if this generator installs something for a given configuration. */
- bool InstallsForConfig(const char*);
+ bool InstallsForConfig(const std::string& config);
protected:
virtual void GenerateScript(std::ostream& os);
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 5df6e4b..ec2b518 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -59,8 +59,8 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
//----------------------------------------------------------------------------
void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
- const char* config,
- Indent const& indent)
+ const std::string& config,
+ Indent const& indent)
{
// Compute the build tree directory from which to copy the target.
std::string fromDirConfig;
@@ -319,7 +319,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
//----------------------------------------------------------------------------
std::string
-cmInstallTargetGenerator::GetInstallFilename(const char* config) const
+cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
{
NameType nameType = this->ImportLibrary? NameImplib : NameNormal;
return
@@ -330,7 +330,7 @@ cmInstallTargetGenerator::GetInstallFilename(const char* config) const
//----------------------------------------------------------------------------
std::string
cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
- const char* config,
+ const std::string& config,
NameType nameType)
{
std::string fname;
@@ -405,7 +405,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
//----------------------------------------------------------------------------
void
cmInstallTargetGenerator
-::AddTweak(std::ostream& os, Indent const& indent, const char* config,
+::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
std::string const& file, TweakMethod tweak)
{
cmOStringStream tw;
@@ -423,7 +423,7 @@ cmInstallTargetGenerator
//----------------------------------------------------------------------------
void
cmInstallTargetGenerator
-::AddTweak(std::ostream& os, Indent const& indent, const char* config,
+::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
std::vector<std::string> const& files, TweakMethod tweak)
{
if(files.size() == 1)
@@ -470,7 +470,7 @@ std::string cmInstallTargetGenerator::GetDestDirPath(std::string const& file)
//----------------------------------------------------------------------------
void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
Indent const& indent,
- const char* config,
+ const std::string& config,
std::string const& file)
{
this->AddRPathCheckRule(os, indent, config, file);
@@ -478,9 +478,9 @@ void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
//----------------------------------------------------------------------------
void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
- Indent const& indent,
- const char* config,
- std::string const& file)
+ Indent const& indent,
+ const std::string& config,
+ std::string const& file)
{
this->AddInstallNamePatchRule(os, indent, config, file);
this->AddChrpathPatchRule(os, indent, config, file);
@@ -492,7 +492,8 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
void
cmInstallTargetGenerator
::AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
- const char* config, std::string const& toDestDirPath)
+ const std::string& config,
+ std::string const& toDestDirPath)
{
if(this->ImportLibrary ||
!(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -605,7 +606,8 @@ cmInstallTargetGenerator
void
cmInstallTargetGenerator
::AddRPathCheckRule(std::ostream& os, Indent const& indent,
- const char* config, std::string const& toDestDirPath)
+ const std::string& config,
+ std::string const& toDestDirPath)
{
// Skip the chrpath if the target does not need it.
if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
@@ -642,7 +644,8 @@ cmInstallTargetGenerator
void
cmInstallTargetGenerator
::AddChrpathPatchRule(std::ostream& os, Indent const& indent,
- const char* config, std::string const& toDestDirPath)
+ const std::string& config,
+ std::string const& toDestDirPath)
{
// Skip the chrpath if the target does not need it.
if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 18c3957..0f21da7 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -43,7 +43,7 @@ public:
void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; }
NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; }
- std::string GetInstallFilename(const char* config) const;
+ std::string GetInstallFilename(const std::string& config) const;
enum NameType
{
@@ -54,7 +54,7 @@ public:
};
static std::string GetInstallFilename(cmTarget const* target,
- const char* config,
+ const std::string& config,
NameType nameType = NameNormal);
cmTarget* GetTarget() const { return this->Target; }
@@ -63,30 +63,33 @@ public:
protected:
virtual void GenerateScript(std::ostream& os);
virtual void GenerateScriptForConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
Indent const& indent);
typedef void (cmInstallTargetGenerator::*TweakMethod)(
- std::ostream&, Indent const&, const char*, std::string const&
+ std::ostream&, Indent const&, const std::string&, std::string const&
);
void AddTweak(std::ostream& os, Indent const& indent,
- const char* config, std::string const& file,
+ const std::string& config, std::string const& file,
TweakMethod tweak);
void AddTweak(std::ostream& os, Indent const& indent,
- const char* config, std::vector<std::string> const& files,
+ const std::string& config,
+ std::vector<std::string> const& files,
TweakMethod tweak);
std::string GetDestDirPath(std::string const& file);
void PreReplacementTweaks(std::ostream& os, Indent const& indent,
- const char* config, std::string const& file);
+ const std::string& config,
+ std::string const& file);
void PostReplacementTweaks(std::ostream& os, Indent const& indent,
- const char* config, std::string const& file);
+ const std::string& config,
+ std::string const& file);
void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
- const char* config,
+ const std::string& config,
const std::string& toDestDirPath);
void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
- const char* config,
+ const std::string& config,
std::string const& toDestDirPath);
void AddRPathCheckRule(std::ostream& os, Indent const& indent,
- const char* config,
+ const std::string& config,
std::string const& toDestDirPath);
void AddStripRule(std::ostream& os, Indent const& indent,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 43ec80c..efd1ca0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -280,7 +280,7 @@ void cmLocalGenerator::GenerateTestFiles()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- const char* config =
+ const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory();
@@ -384,11 +384,11 @@ void cmLocalGenerator::GenerateInstallRules()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- const char* config =
+ const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration.
- const char* default_config = config;
+ const char* default_config = config.c_str();
const char* default_order[] = {"RELEASE", "MINSIZEREL",
"RELWITHDEBINFO", "DEBUG", 0};
for(const char** c = default_order; *c && !default_config; ++c)
@@ -557,7 +557,7 @@ void cmLocalGenerator::GenerateTargetManifest()
}
if(configNames.empty())
{
- target.GenerateTargetManifest(0);
+ target.GenerateTargetManifest("");
}
else
{
@@ -712,8 +712,8 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
vars.LinkFlags = linkFlags.c_str();
std::string langFlags;
- this->AddLanguageFlags(langFlags, llang, 0);
- this->AddArchitectureFlags(langFlags, &target, llang, 0);
+ this->AddLanguageFlags(langFlags, llang, "");
+ this->AddArchitectureFlags(langFlags, &target, llang, "");
vars.LanguageCompileFlags = langFlags.c_str();
cmCustomCommandLines commandLines;
@@ -1289,7 +1289,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
cmGeneratorTarget* target,
const std::string& lang,
bool forResponseFile,
- const char *config)
+ const std::string& config)
{
if(lang.empty())
{
@@ -1367,7 +1367,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
if(!flagUsed || repeatFlag)
{
if(sysIncludeFlag && target &&
- target->IsSystemIncludeDirectory(i->c_str(), config))
+ target->IsSystemIncludeDirectory(*i, config))
{
includeFlags << sysIncludeFlag;
}
@@ -1402,7 +1402,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
cmTarget const* target,
- const char* config)
+ const std::string& config)
{
std::vector<std::string> targetDefines;
target->GetCompileDefinitions(targetDefines,
@@ -1413,7 +1413,7 @@ void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCompileOptions(
std::string& flags, cmTarget* target,
- const std::string& lang, const char* config
+ const std::string& lang, const std::string& config
)
{
std::string langFlagRegexVar = std::string("CMAKE_")+lang+"_FLAG_REGEX";
@@ -1462,7 +1462,7 @@ void cmLocalGenerator::AddCompileOptions(
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget* target,
const std::string& lang,
- const char *config,
+ const std::string& config,
bool stripImplicitInclDirs
)
{
@@ -1695,7 +1695,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
target->Target->GetName().c_str());
return;
}
- this->AddLanguageFlags(flags, linkLanguage, buildType.c_str());
+ this->AddLanguageFlags(flags, linkLanguage, buildType);
this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
*target, false, false);
if(cmSystemTools::IsOn
@@ -1942,7 +1942,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
cmGeneratorTarget* target,
const std::string& lang,
- const char* config)
+ const std::string& config)
{
// Only add Mac OS X specific flags on Darwin platforms (OSX and iphone):
if(!this->Makefile->IsOn("APPLE"))
@@ -1999,7 +1999,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddLanguageFlags(std::string& flags,
const std::string& lang,
- const char* config)
+ const std::string& config)
{
// Add language-specific flags.
std::string flagsVar = "CMAKE_";
@@ -2010,7 +2010,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
//----------------------------------------------------------------------------
bool cmLocalGenerator::GetRealDependency(const std::string& inName,
- const char* config,
+ const std::string& config,
std::string& dep)
{
// Older CMake code may specify the dependency using the target
@@ -2208,7 +2208,7 @@ void cmLocalGenerator
//----------------------------------------------------------------------------
void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
std::string const& lang,
- const char *config)
+ const std::string& config)
{
int targetType = target->GetType();
@@ -2324,13 +2324,13 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
//----------------------------------------------------------------------------
void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
const std::string& var,
- const char* config)
+ const std::string& config)
{
// Add the flags from the variable itself.
std::string flagsVar = var;
this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar.c_str()));
// Add the flags from the build-type specific variable.
- if(config && *config)
+ if(!config.empty())
{
flagsVar += "_";
flagsVar += cmSystemTools::UpperCase(config);
@@ -2834,7 +2834,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
void
cmLocalGenerator
::GenerateTargetInstallRules(
- std::ostream& os, const char* config,
+ std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes)
{
// Convert the old-style install specification from each target to
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 3fe6a26..4d62833 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -138,16 +138,16 @@ public:
void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target,
- const std::string&lang, const char* config);
+ const std::string&lang, const std::string& config);
void AddLanguageFlags(std::string& flags, const std::string& lang,
- const char* config);
+ const std::string& config);
void AddCMP0018Flags(std::string &flags, cmTarget* target,
- std::string const& lang, const char *config);
+ std::string const& lang, const std::string& config);
void AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
const std::string& lang);
void AddConfigVariableFlags(std::string& flags, const std::string& var,
- const char* config);
+ const std::string& config);
///! Append flags to a string.
virtual void AppendFlags(std::string& flags, const char* newFlags);
virtual void AppendFlagEscape(std::string& flags,
@@ -157,7 +157,7 @@ public:
cmGeneratorTarget* target,
const std::string& lang,
bool forResponseFile = false,
- const char *config = 0);
+ const std::string& config = "");
/**
* Encode a list of preprocessor definitions for the compiler
@@ -196,7 +196,7 @@ public:
* the source directory of this generator. This should only be
* used for dependencies of custom commands.
*/
- bool GetRealDependency(const std::string& name, const char* config,
+ bool GetRealDependency(const std::string& name, const std::string& config,
std::string& dep);
///! for existing files convert to output path and short path if spaces
@@ -227,13 +227,13 @@ public:
void GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget* target,
const std::string& lang = "C",
- const char *config = 0,
+ const std::string& config = "",
bool stripImplicitInclDirs = true);
void AddCompileOptions(std::string& flags, cmTarget* target,
- const std::string& lang, const char* config);
+ const std::string& lang, const std::string& config);
void AddCompileDefinitions(std::set<std::string>& defines,
cmTarget const* target,
- const char* config);
+ const std::string& config);
/** Compute the language used to compile the given source file. */
std::string GetSourceFileLanguage(const cmSourceFile& source);
@@ -410,7 +410,7 @@ protected:
// Handle old-style install rules stored in the targets.
void GenerateTargetInstallRules(
- std::ostream& os, const char* config,
+ std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes);
std::string& CreateSafeUniqueObjectFileName(const std::string& sin,
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index b0c577e..0e246a5 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -38,7 +38,7 @@ class cmLocalVisualStudio6Generator::EventWriter
{
public:
EventWriter(cmLocalVisualStudio6Generator* lg,
- const char* config, std::string& code):
+ const std::string& config, std::string& code):
LG(lg), Config(config), Code(code), First(true) {}
void Start(const char* event)
{
@@ -72,7 +72,7 @@ public:
}
private:
cmLocalVisualStudio6Generator* LG;
- const char* Config;
+ std::string Config;
std::string& Code;
bool First;
std::string Event;
@@ -785,7 +785,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
//----------------------------------------------------------------------------
cmsys::auto_ptr<cmCustomCommand>
cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
- const char* config)
+ const std::string& config)
{
cmsys::auto_ptr<cmCustomCommand> pcc;
@@ -813,7 +813,7 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
// look for custom rules on a target and collect them together
std::string
cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
- const char* configName,
+ const std::string& configName,
const std::string& /* libName */)
{
if (target.GetType() >= cmTarget::UTILITY )
@@ -863,7 +863,7 @@ inline std::string removeQuotes(const std::string& s)
std::string
cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target,
- const char *config)
+ const std::string& config)
{
std::string includeOptions;
@@ -1704,7 +1704,7 @@ void cmLocalVisualStudio6Generator
flagsRelWithDebInfo = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsRelWithDebInfo += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
- this->AddCompileOptions(flags, &target, linkLanguage, 0);
+ this->AddCompileOptions(flags, &target, linkLanguage, "");
this->AddCompileOptions(flagsDebug, &target, linkLanguage, "Debug");
this->AddCompileOptions(flagsRelease, &target, linkLanguage, "Release");
this->AddCompileOptions(flagsMinSizeRel, &target, linkLanguage,
@@ -1730,7 +1730,7 @@ void cmLocalVisualStudio6Generator
std::set<std::string> minsizeDefinesSet;
std::set<std::string> debugrelDefinesSet;
- this->AddCompileDefinitions(definesSet, &target, 0);
+ this->AddCompileDefinitions(definesSet, &target, "");
this->AddCompileDefinitions(debugDefinesSet, &target, "DEBUG");
this->AddCompileDefinitions(releaseDefinesSet, &target, "RELEASE");
this->AddCompileDefinitions(minsizeDefinesSet, &target, "MINSIZEREL");
@@ -1800,7 +1800,7 @@ void cmLocalVisualStudio6Generator::WriteDSPFooter(std::ostream& fout)
//----------------------------------------------------------------------------
void cmLocalVisualStudio6Generator
::ComputeLinkOptions(cmTarget& target,
- const char* configName,
+ const std::string& configName,
const std::string extraOptions,
std::string& options)
{
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index 6702111..4771833 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -81,16 +81,17 @@ private:
class EventWriter;
friend class EventWriter;
cmsys::auto_ptr<cmCustomCommand>
- MaybeCreateOutputDir(cmTarget& target, const char* config);
+ MaybeCreateOutputDir(cmTarget& target, const std::string& config);
std::string CreateTargetRules(cmTarget &target,
- const char* configName,
+ const std::string& configName,
const std::string& libName);
- void ComputeLinkOptions(cmTarget& target, const char* configName,
+ void ComputeLinkOptions(cmTarget& target, const std::string& configName,
const std::string extraOptions,
std::string& options);
void OutputObjects(cmTarget& target, const char* tool,
std::string& options);
- std::string GetTargetIncludeOptions(cmTarget &target, const char *config);
+ std::string GetTargetIncludeOptions(cmTarget &target,
+ const std::string& config);
std::vector<std::string> Configurations;
std::string GetConfigName(std::string const& configuration) const;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 6ad5e04..5f98a71 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -588,7 +588,7 @@ class cmLocalVisualStudio7Generator::EventWriter
{
public:
EventWriter(cmLocalVisualStudio7Generator* lg,
- const char* config, std::ostream& os):
+ const std::string& config, std::ostream& os):
LG(lg), Config(config), Stream(os), First(true) {}
void Start(const char* tool)
{
@@ -629,14 +629,14 @@ public:
}
private:
cmLocalVisualStudio7Generator* LG;
- const char* Config;
+ std::string Config;
std::ostream& Stream;
bool First;
};
//----------------------------------------------------------------------------
void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
- const char* configName,
+ const std::string& configName,
const std::string& libName,
cmTarget &target)
{
@@ -745,7 +745,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
table,
this->ExtraFlagTable);
targetOptions.FixExceptionHandlingDefault();
- std::string asmLocation = std::string(configName) + "/";
+ std::string asmLocation = configName + "/";
targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
targetOptions.Parse(flags.c_str());
targetOptions.Parse(defineFlags.c_str());
@@ -944,7 +944,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
//----------------------------------------------------------------------------
std::string
cmLocalVisualStudio7Generator
-::GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const char* configName)
+::GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
+ const std::string& configName)
{
std::string configTypeUpper = cmSystemTools::UpperCase(configName);
std::string extraLinkOptionsBuildTypeDef =
@@ -958,7 +959,8 @@ cmLocalVisualStudio7Generator
}
void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
- const char* configName, cmTarget &target, const Options& targetOptions)
+ const std::string& configName, cmTarget &target,
+ const Options& targetOptions)
{
cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
@@ -1903,7 +1905,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout)
// look for custom rules on a target and collect them together
void cmLocalVisualStudio7Generator
::OutputTargetRules(std::ostream& fout,
- const char* configName,
+ const std::string& configName,
cmTarget &target,
const std::string& /*libName*/)
{
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 2823a2c..f9bb6e1 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -71,7 +71,7 @@ private:
typedef cmVisualStudioGeneratorOptions Options;
typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
- const char* configName);
+ const std::string& configName);
void FixGlobalTargets();
void WriteProjectFiles();
void WriteVCProjHeader(std::ostream& fout, const std::string& libName,
@@ -82,14 +82,14 @@ private:
void WriteConfigurations(std::ostream& fout,
const std::string& libName, cmTarget &tgt);
void WriteConfiguration(std::ostream& fout,
- const char* configName,
+ const std::string& configName,
const std::string& libName, cmTarget &tgt);
std::string EscapeForXML(const std::string& s);
std::string ConvertToXMLOutputPath(const char* path);
std::string ConvertToXMLOutputPathSingle(const char* path);
- void OutputTargetRules(std::ostream& fout, const char* configName,
+ void OutputTargetRules(std::ostream& fout, const std::string& configName,
cmTarget &target, const std::string& libName);
- void OutputBuildTool(std::ostream& fout, const char* configName,
+ void OutputBuildTool(std::ostream& fout, const std::string& configName,
cmTarget& t, const Options& targetOptions);
void OutputLibraryDirectories(std::ostream& fout,
std::vector<std::string> const& dirs);
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index ef2bb1d..11b0387 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -33,7 +33,7 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator()
//----------------------------------------------------------------------------
cmsys::auto_ptr<cmCustomCommand>
cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
- const char* config,
+ const std::string& config,
bool isFortran)
{
cmsys::auto_ptr<cmCustomCommand> pcc;
@@ -80,7 +80,7 @@ const char* cmLocalVisualStudioGenerator::GetReportErrorLabel() const
std::string
cmLocalVisualStudioGenerator
::ConstructScript(cmCustomCommand const& cc,
- const char* configName,
+ const std::string& configName,
const char* newline_text)
{
bool useLocal = this->CustomCommandUseLocal();
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 1a3499a..2297072 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -47,7 +47,7 @@ public:
/** Construct a script from the given list of command lines. */
std::string ConstructScript(cmCustomCommand const& cc,
- const char* configName,
+ const std::string& configName,
const char* newline = "\n");
/** Label to which to jump in a batch file after a failed step in a
@@ -67,7 +67,8 @@ protected:
/** Construct a custom command to make exe import lib dir. */
cmsys::auto_ptr<cmCustomCommand>
- MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran);
+ MaybeCreateImplibDir(cmTarget& target, const std::string& config,
+ bool isFortran);
VSVersion Version;
};
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index fb8c2d1..5857aef 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -54,7 +54,7 @@ void cmLocalXCodeGenerator::Generate()
iter != targets.end(); ++iter)
{
cmTarget* t = &iter->second;
- t->HasMacOSXRpathInstallNameDir(NULL);
+ t->HasMacOSXRpathInstallNameDir("");
}
}
@@ -68,6 +68,6 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
iter != targets.end(); ++iter)
{
cmTarget* t = &iter->second;
- t->HasMacOSXRpathInstallNameDir(NULL);
+ t->HasMacOSXRpathInstallNameDir("");
}
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d107ddf..1ef4d46 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2734,7 +2734,7 @@ void cmMakefile::AddDefaultDefinitions()
}
//----------------------------------------------------------------------------
-const char*
+std::string
cmMakefile::GetConfigurations(std::vector<std::string>& configs,
bool single) const
{
@@ -2745,12 +2745,12 @@ cmMakefile::GetConfigurations(std::vector<std::string>& configs,
{
cmSystemTools::ExpandListArgument(configTypes, configs);
}
- return 0;
+ return "";
}
else
{
- const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE");
- if(single && buildType && *buildType)
+ const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ if(single && !buildType.empty())
{
configs.push_back(buildType);
}
@@ -3801,11 +3801,12 @@ bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
}
//----------------------------------------------------------------------------
-const char* cmMakefile::GetFeature(const char* feature, const char* config)
+const char* cmMakefile::GetFeature(const char* feature,
+ const std::string& config)
{
// TODO: Define accumulation policy for features (prepend, append, replace).
// Currently we always replace.
- if(config && *config)
+ if(!config.empty())
{
std::string featureConfig = feature;
featureConfig += "_";
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 86cedb0..1c3ad73 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -320,7 +320,7 @@ public:
}
/** Get the configurations to be generated. */
- const char* GetConfigurations(std::vector<std::string>& configs,
+ std::string GetConfigurations(std::vector<std::string>& configs,
bool single = true) const;
/**
@@ -811,7 +811,7 @@ public:
cmProperty::ScopeType scope) const;
bool GetPropertyAsBool(const std::string& prop) const;
- const char* GetFeature(const char* feature, const char* config);
+ const char* GetFeature(const char* feature, const std::string& config);
// Get the properties
cmPropertyMap &GetProperties() { return this->Properties; };
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0a836a5..1af5d6c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -133,7 +133,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
this->Makefile->GetProperty
("ADDITIONAL_MAKE_CLEAN_FILES"))
{
- const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config =
+ this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
cmListFileBacktrace lfbt;
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -1070,7 +1071,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< "set(CMAKE_C_TARGET_INCLUDE_PATH\n";
std::vector<std::string> includes;
- const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config =
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget,
"C", config);
@@ -1567,7 +1569,8 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags(std::string const& l)
#endif
std::vector<std::string> includes;
- const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config =
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget,
"C", config);
@@ -1952,7 +1955,8 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
std::vector<std::string> includes;
- const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config =
+ this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget,
lang, config);
@@ -2059,7 +2063,8 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags)
this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG"))
{
std::vector<std::string> includes;
- const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ const std::string& config =
+ this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget,
"C", config);
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 5f697a5..21eece4 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -183,7 +183,7 @@ protected:
cmLocalUnixMakefileGenerator3 *LocalGenerator;
cmGlobalUnixMakefileGenerator3 *GlobalGenerator;
cmMakefile *Makefile;
- const char *ConfigName;
+ std::string ConfigName;
enum CustomCommandDriveType { OnBuild, OnDepends, OnUtility };
CustomCommandDriveType CustomCommandDriver;
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 78b59b3..449f923 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -19,7 +19,7 @@
//----------------------------------------------------------------------------
cmOSXBundleGenerator::
cmOSXBundleGenerator(cmGeneratorTarget* target,
- const char* configName)
+ const std::string& configName)
: GT(target)
, Makefile(target->Target->GetMakefile())
, LocalGenerator(Makefile->GetLocalGenerator())
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index 97ae731..95b4aef 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -27,7 +27,7 @@ class cmOSXBundleGenerator
{
public:
cmOSXBundleGenerator(cmGeneratorTarget* target,
- const char* configName);
+ const std::string& configName);
// create an app bundle at a given root, and return
// the directory within the bundle that contains the executable
@@ -62,7 +62,7 @@ private:
cmGeneratorTarget* GT;
cmMakefile* Makefile;
cmLocalGenerator* LocalGenerator;
- const char* ConfigName;
+ std::string ConfigName;
std::set<std::string>* MacContentFolders;
};
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index fbb3b1c..8eee991 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -306,7 +306,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
}
static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
- const char * config,
+ const std::string& config,
std::string &incs,
std::string &defs)
{
@@ -366,7 +366,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
}
if (const char *targetQtVersion =
- target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0))
+ target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
{
qtVersion = targetQtVersion;
}
@@ -563,7 +563,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
std::string _moc_incs;
std::string _moc_compile_defs;
std::vector<std::string> configs;
- const char *config = makefile->GetConfigurations(configs);
+ const std::string& config = makefile->GetConfigurations(configs);
GetCompileDefinitionsAndDirectories(target, config,
_moc_incs, _moc_compile_defs);
@@ -675,7 +675,7 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
}
-static void GetUicOpts(cmTarget const* target, const char * config,
+static void GetUicOpts(cmTarget const* target, const std::string& config,
std::string &optString)
{
std::vector<std::string> opts;
@@ -717,7 +717,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
std::string _uic_opts;
std::vector<std::string> configs;
- const char *config = makefile->GetConfigurations(configs);
+ const std::string& config = makefile->GetConfigurations(configs);
GetUicOpts(target, config, _uic_opts);
if (!_uic_opts.empty())
@@ -967,7 +967,8 @@ static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
return gg;
}
-bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
+bool cmQtAutoGenerators::Run(const char* targetDirectory,
+ const std::string& config)
{
bool success = true;
cmake cm;
@@ -994,7 +995,7 @@ bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
const char* targetDirectory,
- const char *config)
+ const std::string& config)
{
std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
cmSystemTools::ConvertToUnixSlashes(filename);
@@ -1027,7 +1028,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
{
std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS";
std::string compileDefsProp = compileDefsPropOrig;
- if(config)
+ if(!config.empty())
{
compileDefsProp += "_";
compileDefsProp += config;
@@ -1039,7 +1040,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
{
std::string includesPropOrig = "AM_MOC_INCLUDES";
std::string includesProp = includesPropOrig;
- if(config)
+ if(!config.empty())
{
includesProp += "_";
includesProp += config;
@@ -1058,7 +1059,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
= makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES");
std::string uicOptionsPropOrig = "AM_UIC_TARGET_OPTIONS";
std::string uicOptionsProp = uicOptionsPropOrig;
- if(config)
+ if(!config.empty())
{
uicOptionsProp += "_";
uicOptionsProp += config;
diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h
index 2840fbf..af4ceb9 100644
--- a/Source/cmQtAutoGenerators.h
+++ b/Source/cmQtAutoGenerators.h
@@ -21,7 +21,7 @@ class cmQtAutoGenerators
{
public:
cmQtAutoGenerators();
- bool Run(const char* targetDirectory, const char *config);
+ bool Run(const char* targetDirectory, const std::string& config);
bool InitializeAutogenTarget(cmTarget* target);
void SetupAutoGenerateTarget(cmTarget const* target);
@@ -38,7 +38,7 @@ private:
bool ReadAutogenInfoFile(cmMakefile* makefile,
const char* targetDirectory,
- const char *config);
+ const std::string& config);
bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
const char* targetDirectory);
void WriteOldMocDefinitionsFile(const char* targetDirectory);
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index 7a8efc1..7685d40 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -19,7 +19,7 @@ cmScriptGenerator
std::vector<std::string> const& configurations):
RuntimeConfigVariable(config_var),
Configurations(configurations),
- ConfigurationName(0),
+ ConfigurationName(""),
ConfigurationTypes(0),
ActionsPerConfig(false)
{
@@ -34,21 +34,21 @@ cmScriptGenerator
//----------------------------------------------------------------------------
void
cmScriptGenerator
-::Generate(std::ostream& os, const char* config,
+::Generate(std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes)
{
this->ConfigurationName = config;
this->ConfigurationTypes = &configurationTypes;
this->GenerateScript(os);
- this->ConfigurationName = 0;
+ this->ConfigurationName = "";
this->ConfigurationTypes = 0;
}
//----------------------------------------------------------------------------
-static void cmScriptGeneratorEncodeConfig(const char* config,
+static void cmScriptGeneratorEncodeConfig(const std::string& config,
std::string& result)
{
- for(const char* c = config; *c; ++c)
+ for(const char* c = config.c_str(); *c; ++c)
{
if(*c >= 'a' && *c <= 'z')
{
@@ -73,12 +73,12 @@ static void cmScriptGeneratorEncodeConfig(const char* config,
//----------------------------------------------------------------------------
std::string
-cmScriptGenerator::CreateConfigTest(const char* config)
+cmScriptGenerator::CreateConfigTest(const std::string& config)
{
std::string result = "\"${";
result += this->RuntimeConfigVariable;
result += "}\" MATCHES \"^(";
- if(config && *config)
+ if(!config.empty())
{
cmScriptGeneratorEncodeConfig(config, result);
}
@@ -142,14 +142,15 @@ void cmScriptGenerator::GenerateScriptActions(std::ostream& os,
}
//----------------------------------------------------------------------------
-void cmScriptGenerator::GenerateScriptForConfig(std::ostream&, const char*,
+void cmScriptGenerator::GenerateScriptForConfig(std::ostream&,
+ const std::string&,
Indent const&)
{
// No actions for this generator.
}
//----------------------------------------------------------------------------
-bool cmScriptGenerator::GeneratesForConfig(const char* config)
+bool cmScriptGenerator::GeneratesForConfig(const std::string& config)
{
// If this is not a configuration-specific rule then we install.
if(this->Configurations.empty())
@@ -159,7 +160,7 @@ bool cmScriptGenerator::GeneratesForConfig(const char* config)
// This is a configuration-specific rule. Check if the config
// matches this rule.
- std::string config_upper = cmSystemTools::UpperCase(config?config:"");
+ std::string config_upper = cmSystemTools::UpperCase(config);
for(std::vector<std::string>::const_iterator i =
this->Configurations.begin();
i != this->Configurations.end(); ++i)
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index 3515e20..9ab04f1 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -51,7 +51,7 @@ public:
std::vector<std::string> const& configurations);
virtual ~cmScriptGenerator();
- void Generate(std::ostream& os, const char* config,
+ void Generate(std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes);
const std::vector<std::string>& GetConfigurations() const
@@ -63,15 +63,15 @@ protected:
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
Indent const& indent);
virtual void GenerateScriptNoConfig(std::ostream&, Indent const&) {}
virtual bool NeedsScriptNoConfig() const { return false; }
// Test if this generator does something for a given configuration.
- bool GeneratesForConfig(const char*);
+ bool GeneratesForConfig(const std::string&);
- std::string CreateConfigTest(const char* config);
+ std::string CreateConfigTest(const std::string& config);
std::string CreateConfigTest(std::vector<std::string> const& configs);
std::string CreateComponentTest(const char* component);
@@ -80,7 +80,7 @@ protected:
std::vector<std::string> const Configurations;
// Information used during generation.
- const char* ConfigurationName;
+ std::string ConfigurationName;
std::vector<std::string> const* ConfigurationTypes;
// True if the subclass needs to generate an explicit rule for each
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3273437..b8e662a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -109,7 +109,8 @@ public:
const char* ExplicitLibraries;
};
void ComputeLinkInterface(cmTarget const* thisTarget,
- const char* config, OptionalLinkInterface& iface,
+ const std::string& config,
+ OptionalLinkInterface& iface,
cmTarget const* head,
const char *explicitLibraries) const;
@@ -692,10 +693,11 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
}
//----------------------------------------------------------------------------
-cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config) const
+cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
+ const std::string& config) const
{
// No configuration is always optimized.
- if(!(config && *config))
+ if(config.empty())
{
return cmTarget::OPTIMIZED;
}
@@ -755,7 +757,7 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) const
}
//----------------------------------------------------------------------------
-void cmTarget::GetDirectLinkLibraries(const char *config,
+void cmTarget::GetDirectLinkLibraries(const std::string& config,
std::vector<std::string> &libs,
cmTarget const* head) const
{
@@ -789,7 +791,7 @@ void cmTarget::GetDirectLinkLibraries(const char *config,
}
//----------------------------------------------------------------------------
-void cmTarget::GetInterfaceLinkLibraries(const char *config,
+void cmTarget::GetInterfaceLinkLibraries(const std::string& config,
std::vector<std::string> &libs,
cmTarget const* head) const
{
@@ -1565,7 +1567,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
std::vector<std::string> &includes,
std::set<std::string> &uniqueIncludes,
cmGeneratorExpressionDAGChecker *dagChecker,
- const char *config, bool debugIncludes)
+ const std::string& config, bool debugIncludes)
{
cmMakefile *mf = tgt->GetMakefile();
@@ -1730,7 +1732,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
//----------------------------------------------------------------------------
std::vector<std::string>
-cmTarget::GetIncludeDirectories(const char *config) const
+cmTarget::GetIncludeDirectories(const std::string& config) const
{
std::vector<std::string> includes;
std::set<std::string> uniqueIncludes;
@@ -1767,8 +1769,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
config,
debugIncludes);
- std::string configString = config ? config : "";
- if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
+ if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[config])
{
for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(),
@@ -1805,7 +1806,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
includeGenex);
this->Internal
- ->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
+ ->CachedLinkInterfaceIncludeDirectoriesEntries[config].push_back(
new cmTargetInternals::TargetPropertyEntry(cge,
it->Value));
}
@@ -1833,14 +1834,14 @@ cmTarget::GetIncludeDirectories(const char *config) const
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(libDir.c_str());
this->Internal
- ->CachedLinkInterfaceIncludeDirectoriesEntries[configString]
+ ->CachedLinkInterfaceIncludeDirectoriesEntries[config]
.push_back(new cmTargetInternals::TargetPropertyEntry(cge));
}
}
}
processIncludeDirectories(this,
- this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString],
+ this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[config],
includes,
uniqueIncludes,
&dagChecker,
@@ -1854,7 +1855,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
}
else
{
- this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString]
+ this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[config]
= true;
}
@@ -1867,7 +1868,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
cmGeneratorExpressionDAGChecker *dagChecker,
- const char *config, bool debugOptions, const char *logName)
+ const std::string& config, bool debugOptions, const char *logName)
{
cmMakefile *mf = tgt->GetMakefile();
@@ -1926,7 +1927,7 @@ static void processCompileOptions(cmTarget const* tgt,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
cmGeneratorExpressionDAGChecker *dagChecker,
- const char *config, bool debugOptions)
+ const std::string& config, bool debugOptions)
{
processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
dagChecker, config, debugOptions, "options");
@@ -1934,7 +1935,7 @@ static void processCompileOptions(cmTarget const* tgt,
//----------------------------------------------------------------------------
void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
- const char *config) const
+ const std::string& config) const
{
const char *prop
= this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS",
@@ -1960,7 +1961,7 @@ void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
//----------------------------------------------------------------------------
void cmTarget::GetCompileOptions(std::vector<std::string> &result,
- const char *config) const
+ const std::string& config) const
{
std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
@@ -1996,8 +1997,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
config,
debugOptions);
- std::string configString = config ? config : "";
- if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[configString])
+ if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[config])
{
for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(),
@@ -2034,14 +2034,14 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
optionGenex);
this->Internal
- ->CachedLinkInterfaceCompileOptionsEntries[configString].push_back(
+ ->CachedLinkInterfaceCompileOptionsEntries[config].push_back(
new cmTargetInternals::TargetPropertyEntry(cge,
it->Value));
}
}
processCompileOptions(this,
- this->Internal->CachedLinkInterfaceCompileOptionsEntries[configString],
+ this->Internal->CachedLinkInterfaceCompileOptionsEntries[config],
result,
uniqueOptions,
&dagChecker,
@@ -2054,7 +2054,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
}
else
{
- this->Internal->CacheLinkInterfaceCompileOptionsDone[configString] = true;
+ this->Internal->CacheLinkInterfaceCompileOptionsDone[config] = true;
}
}
@@ -2064,7 +2064,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
cmGeneratorExpressionDAGChecker *dagChecker,
- const char *config, bool debugOptions)
+ const std::string& config, bool debugOptions)
{
processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
dagChecker, config, debugOptions,
@@ -2073,7 +2073,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
//----------------------------------------------------------------------------
void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
- const char *config) const
+ const std::string& config) const
{
std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
@@ -2109,8 +2109,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
config,
debugDefines);
- std::string configString = config ? config : "";
- if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString])
+ if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config])
{
for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(),
@@ -2147,11 +2146,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
defsGenex);
this->Internal
- ->CachedLinkInterfaceCompileDefinitionsEntries[configString].push_back(
+ ->CachedLinkInterfaceCompileDefinitionsEntries[config].push_back(
new cmTargetInternals::TargetPropertyEntry(cge,
it->Value));
}
- if (config)
+ if (!config.empty())
{
std::string configPropName = "COMPILE_DEFINITIONS_"
+ cmSystemTools::UpperCase(config);
@@ -2174,7 +2173,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(configProp);
this->Internal
- ->CachedLinkInterfaceCompileDefinitionsEntries[configString]
+ ->CachedLinkInterfaceCompileDefinitionsEntries[config]
.push_back(new cmTargetInternals::TargetPropertyEntry(cge));
}
break;
@@ -2189,7 +2188,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
}
processCompileDefinitions(this,
- this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[configString],
+ this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[config],
list,
uniqueOptions,
&dagChecker,
@@ -2203,7 +2202,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
}
else
{
- this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString]
+ this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config]
= true;
}
}
@@ -2333,7 +2332,8 @@ bool cmTarget::HaveWellDefinedOutputFiles() const
}
//----------------------------------------------------------------------------
-cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
+cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
+ const std::string& config) const
{
// There is no output information for imported targets.
if(this->IsImported())
@@ -2355,7 +2355,7 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
// Lookup/compute/cache the output information for this configuration.
std::string config_upper;
- if(config && *config)
+ if(!config.empty())
{
config_upper = cmSystemTools::UpperCase(config);
}
@@ -2378,7 +2378,8 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
}
//----------------------------------------------------------------------------
-cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* config) const
+cmTarget::CompileInfo const* cmTarget::GetCompileInfo(
+ const std::string& config) const
{
// There is no compile information for imported targets.
if(this->IsImported())
@@ -2399,7 +2400,7 @@ cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* config) const
// Lookup/compute/cache the compile information for this configuration.
std::string config_upper;
- if(config && *config)
+ if(!config.empty())
{
config_upper = cmSystemTools::UpperCase(config);
}
@@ -2417,7 +2418,8 @@ cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetDirectory(const char* config, bool implib) const
+std::string cmTarget::GetDirectory(const std::string& config,
+ bool implib) const
{
if (this->IsImported())
{
@@ -2435,7 +2437,7 @@ std::string cmTarget::GetDirectory(const char* config, bool implib) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetPDBDirectory(const char* config) const
+std::string cmTarget::GetPDBDirectory(const std::string& config) const
{
if(OutputInfo const* info = this->GetOutputInfo(config))
{
@@ -2446,7 +2448,7 @@ std::string cmTarget::GetPDBDirectory(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetCompilePDBDirectory(const char* config) const
+std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
{
if(CompileInfo const* info = this->GetCompileInfo(config))
{
@@ -2456,7 +2458,7 @@ std::string cmTarget::GetCompilePDBDirectory(const char* config) const
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetLocation(const char* config) const
+const char* cmTarget::GetLocation(const std::string& config) const
{
static std::string location;
if (this->IsImported())
@@ -2547,9 +2549,10 @@ void cmTarget::GetTargetVersion(bool soversion,
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetFeature(const char* feature, const char* config) const
+const char* cmTarget::GetFeature(const char* feature,
+ const std::string& config) const
{
- if(config && *config)
+ if(!config.empty())
{
std::string featureConfig = feature;
featureConfig += "_";
@@ -2798,7 +2801,8 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const
class cmTargetCollectLinkLanguages
{
public:
- cmTargetCollectLinkLanguages(cmTarget const* target, const char* config,
+ cmTargetCollectLinkLanguages(cmTarget const* target,
+ const std::string& config,
std::set<std::string>& languages,
cmTarget const* head):
Config(config), Languages(languages), HeadTarget(head),
@@ -2870,7 +2874,7 @@ public:
}
}
private:
- const char* Config;
+ std::string Config;
std::set<std::string>& Languages;
cmTarget const* HeadTarget;
cmMakefile* Makefile;
@@ -2879,7 +2883,7 @@ private:
};
//----------------------------------------------------------------------------
-std::string cmTarget::GetLinkerLanguage(const char* config,
+std::string cmTarget::GetLinkerLanguage(const std::string& config,
cmTarget const* head) const
{
cmTarget const* headTarget = head ? head : this;
@@ -2887,10 +2891,11 @@ std::string cmTarget::GetLinkerLanguage(const char* config,
}
//----------------------------------------------------------------------------
-cmTarget::LinkClosure const* cmTarget::GetLinkClosure(const char* config,
+cmTarget::LinkClosure const* cmTarget::GetLinkClosure(
+ const std::string& config,
cmTarget const* head) const
{
- TargetConfigPair key(head, cmSystemTools::UpperCase(config ? config : ""));
+ TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkClosureMapType::iterator
i = this->Internal->LinkClosureMap.find(key);
if(i == this->Internal->LinkClosureMap.end())
@@ -2957,7 +2962,7 @@ public:
};
//----------------------------------------------------------------------------
-void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc,
+void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc,
cmTarget const* head) const
{
// Get languages built in this target.
@@ -3070,7 +3075,7 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetPDBName(const char* config) const
+std::string cmTarget::GetPDBName(const std::string& config) const
{
std::string prefix;
std::string base;
@@ -3078,8 +3083,7 @@ std::string cmTarget::GetPDBName(const char* config) const
this->GetFullNameInternal(config, false, prefix, base, suffix);
std::vector<std::string> props;
- std::string configUpper =
- cmSystemTools::UpperCase(config? config : "");
+ std::string configUpper = cmSystemTools::UpperCase(config);
if(!configUpper.empty())
{
// PDB_NAME_<CONFIG>
@@ -3102,7 +3106,7 @@ std::string cmTarget::GetPDBName(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetCompilePDBName(const char* config) const
+std::string cmTarget::GetCompilePDBName(const std::string& config) const
{
std::string prefix;
std::string base;
@@ -3110,7 +3114,7 @@ std::string cmTarget::GetCompilePDBName(const char* config) const
this->GetFullNameInternal(config, false, prefix, base, suffix);
// Check for a per-configuration output directory target property.
- std::string configUpper = cmSystemTools::UpperCase(config? config : "");
+ std::string configUpper = cmSystemTools::UpperCase(config);
std::string configProp = "COMPILE_PDB_NAME_";
configProp += configUpper;
const char* config_name = this->GetProperty(configProp.c_str());
@@ -3129,7 +3133,7 @@ std::string cmTarget::GetCompilePDBName(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetCompilePDBPath(const char* config) const
+std::string cmTarget::GetCompilePDBPath(const std::string& config) const
{
std::string dir = this->GetCompilePDBDirectory(config);
std::string name = this->GetCompilePDBName(config);
@@ -3145,7 +3149,7 @@ std::string cmTarget::GetCompilePDBPath(const char* config) const
}
//----------------------------------------------------------------------------
-bool cmTarget::HasSOName(const char* config) const
+bool cmTarget::HasSOName(const std::string& config) const
{
// soname is supported only for shared libraries and modules,
// and then only when the platform supports an soname flag.
@@ -3157,7 +3161,7 @@ bool cmTarget::HasSOName(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetSOName(const char* config) const
+std::string cmTarget::GetSOName(const std::string& config) const
{
if(this->IsImported())
{
@@ -3199,7 +3203,7 @@ std::string cmTarget::GetSOName(const char* config) const
}
//----------------------------------------------------------------------------
-bool cmTarget::HasMacOSXRpathInstallNameDir(const char* config) const
+bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
{
bool install_name_is_rpath = false;
bool macosx_rpath = false;
@@ -3311,7 +3315,8 @@ bool cmTarget::MacOSXRpathInstallNameDirDefault() const
}
//----------------------------------------------------------------------------
-bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
+bool cmTarget::IsImportedSharedLibWithoutSOName(
+ const std::string& config) const
{
if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
{
@@ -3324,7 +3329,7 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::NormalGetRealName(const char* config) const
+std::string cmTarget::NormalGetRealName(const std::string& config) const
{
// This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time
@@ -3362,7 +3367,8 @@ std::string cmTarget::NormalGetRealName(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetFullName(const char* config, bool implib) const
+std::string cmTarget::GetFullName(const std::string& config,
+ bool implib) const
{
if(this->IsImported())
{
@@ -3376,7 +3382,7 @@ std::string cmTarget::GetFullName(const char* config, bool implib) const
//----------------------------------------------------------------------------
std::string
-cmTarget::GetFullNameImported(const char* config, bool implib) const
+cmTarget::GetFullNameImported(const std::string& config, bool implib) const
{
return cmSystemTools::GetFilenameName(
this->ImportedGetFullPath(config, implib));
@@ -3384,14 +3390,15 @@ cmTarget::GetFullNameImported(const char* config, bool implib) const
//----------------------------------------------------------------------------
void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base,
- std::string& suffix, const char* config,
+ std::string& suffix,
+ const std::string& config,
bool implib) const
{
this->GetFullNameInternal(config, implib, prefix, base, suffix);
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetFullPath(const char* config, bool implib,
+std::string cmTarget::GetFullPath(const std::string& config, bool implib,
bool realname) const
{
if(this->IsImported())
@@ -3405,8 +3412,8 @@ std::string cmTarget::GetFullPath(const char* config, bool implib,
}
//----------------------------------------------------------------------------
-std::string cmTarget::NormalGetFullPath(const char* config, bool implib,
- bool realname) const
+std::string cmTarget::NormalGetFullPath(const std::string& config,
+ bool implib, bool realname) const
{
std::string fpath = this->GetDirectory(config, implib);
fpath += "/";
@@ -3434,7 +3441,7 @@ std::string cmTarget::NormalGetFullPath(const char* config, bool implib,
//----------------------------------------------------------------------------
std::string
-cmTarget::ImportedGetFullPath(const char* config, bool implib) const
+cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
{
std::string result;
if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this))
@@ -3451,7 +3458,7 @@ cmTarget::ImportedGetFullPath(const char* config, bool implib) const
//----------------------------------------------------------------------------
std::string
-cmTarget::GetFullNameInternal(const char* config, bool implib) const
+cmTarget::GetFullNameInternal(const std::string& config, bool implib) const
{
std::string prefix;
std::string base;
@@ -3461,7 +3468,7 @@ cmTarget::GetFullNameInternal(const char* config, bool implib) const
}
//----------------------------------------------------------------------------
-void cmTarget::GetFullNameInternal(const char* config,
+void cmTarget::GetFullNameInternal(const std::string& config,
bool implib,
std::string& outPrefix,
std::string& outBase,
@@ -3507,7 +3514,7 @@ void cmTarget::GetFullNameInternal(const char* config,
? this->GetProperty("IMPORT_SUFFIX")
: this->GetProperty("SUFFIX"));
const char* configPostfix = 0;
- if(config && *config)
+ if(!config.empty())
{
std::string configProp = cmSystemTools::UpperCase(config);
configProp += "_POSTFIX";
@@ -3604,7 +3611,7 @@ void cmTarget::GetLibraryNames(std::string& name,
std::string& realName,
std::string& impName,
std::string& pdbName,
- const char* config) const
+ const std::string& config) const
{
// This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time
@@ -3708,7 +3715,7 @@ void cmTarget::GetExecutableNames(std::string& name,
std::string& realName,
std::string& impName,
std::string& pdbName,
- const char* config) const
+ const std::string& config) const
{
// This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time
@@ -3804,7 +3811,7 @@ void cmTarget::SetPropertyDefault(const std::string& property,
}
//----------------------------------------------------------------------------
-bool cmTarget::HaveBuildTreeRPATH(const char *config) const
+bool cmTarget::HaveBuildTreeRPATH(const std::string& config) const
{
if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
{
@@ -3824,7 +3831,7 @@ bool cmTarget::HaveInstallTreeRPATH() const
}
//----------------------------------------------------------------------------
-bool cmTarget::NeedRelinkBeforeInstall(const char* config) const
+bool cmTarget::NeedRelinkBeforeInstall(const std::string& config) const
{
// Only executables and shared libraries can have an rpath and may
// need relinking.
@@ -3888,7 +3895,8 @@ bool cmTarget::NeedRelinkBeforeInstall(const char* config) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) const
+std::string cmTarget::GetInstallNameDirForBuildTree(
+ const std::string& config) const
{
// If building directly for installation then the build tree install_name
// is the same as the install tree.
@@ -4010,10 +4018,11 @@ const char* cmTarget::GetOutputTargetType(bool implib) const
}
//----------------------------------------------------------------------------
-bool cmTarget::ComputeOutputDir(const char* config,
+bool cmTarget::ComputeOutputDir(const std::string& config,
bool implib, std::string& out) const
{
bool usesDefaultOutputDir = false;
+ std::string conf = config;
// Look for a target property defining the target output directory
// based on the target type.
@@ -4027,7 +4036,7 @@ bool cmTarget::ComputeOutputDir(const char* config,
}
// Check for a per-configuration output directory target property.
- std::string configUpper = cmSystemTools::UpperCase(config? config : "");
+ std::string configUpper = cmSystemTools::UpperCase(conf);
const char* configProp = 0;
std::string configPropStr = targetTypeName;
if(!configPropStr.empty())
@@ -4044,7 +4053,7 @@ bool cmTarget::ComputeOutputDir(const char* config,
out = config_outdir;
// Skip per-configuration subdirectory.
- config = 0;
+ conf = "";
}
else if(const char* outdir = this->GetProperty(propertyName))
{
@@ -4077,21 +4086,21 @@ bool cmTarget::ComputeOutputDir(const char* config,
(out.c_str(), this->Makefile->GetStartOutputDirectory()));
// The generator may add the configuration's subdirectory.
- if(config && *config)
+ if(!conf.empty())
{
const char *platforms = this->Makefile->GetDefinition(
"CMAKE_XCODE_EFFECTIVE_PLATFORMS");
std::string suffix =
usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : "";
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
- AppendDirectoryForConfig("/", config, suffix.c_str(), out);
+ AppendDirectoryForConfig("/", conf, suffix.c_str(), out);
}
return usesDefaultOutputDir;
}
//----------------------------------------------------------------------------
-bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
+bool cmTarget::ComputePDBOutputDir(const char* kind, const std::string& config,
std::string& out) const
{
// Look for a target property defining the target output directory
@@ -4103,9 +4112,10 @@ bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
propertyNameStr += "_OUTPUT_DIRECTORY";
propertyName = propertyNameStr.c_str();
}
+ std::string conf = config;
// Check for a per-configuration output directory target property.
- std::string configUpper = cmSystemTools::UpperCase(config? config : "");
+ std::string configUpper = cmSystemTools::UpperCase(conf);
const char* configProp = 0;
std::string configPropStr = kind;
if(!configPropStr.empty())
@@ -4122,7 +4132,7 @@ bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
out = config_outdir;
// Skip per-configuration subdirectory.
- config = 0;
+ conf = "";
}
else if(const char* outdir = this->GetProperty(propertyName))
{
@@ -4141,27 +4151,29 @@ bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
(out.c_str(), this->Makefile->GetStartOutputDirectory()));
// The generator may add the configuration's subdirectory.
- if(config && *config)
+ if(!conf.empty())
{
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
- AppendDirectoryForConfig("/", config, "", out);
+ AppendDirectoryForConfig("/", conf, "", out);
}
return true;
}
//----------------------------------------------------------------------------
-bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) const
+bool cmTarget::UsesDefaultOutputDir(const std::string& config,
+ bool implib) const
{
std::string dir;
return this->ComputeOutputDir(config, implib, dir);
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetOutputName(const char* config, bool implib) const
+std::string cmTarget::GetOutputName(const std::string& config,
+ bool implib) const
{
std::vector<std::string> props;
std::string type = this->GetOutputTargetType(implib);
- std::string configUpper = cmSystemTools::UpperCase(config? config : "");
+ std::string configUpper = cmSystemTools::UpperCase(config);
if(!type.empty() && !configUpper.empty())
{
// <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
@@ -4495,7 +4507,7 @@ std::string compatibilityAgree(CompatibleType t, bool dominant)
template<typename PropertyType>
PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
const std::string &p,
- const char *config,
+ const std::string& config,
const char *defaultValue,
CompatibleType t,
PropertyType *)
@@ -4679,7 +4691,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
//----------------------------------------------------------------------------
bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
- const char *config) const
+ const std::string& config) const
{
return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
BoolType, 0);
@@ -4687,8 +4699,8 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
//----------------------------------------------------------------------------
const char * cmTarget::GetLinkInterfaceDependentStringProperty(
- const std::string &p,
- const char *config) const
+ const std::string &p,
+ const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char *>(this,
p,
@@ -4699,8 +4711,8 @@ const char * cmTarget::GetLinkInterfaceDependentStringProperty(
//----------------------------------------------------------------------------
const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
- const std::string &p,
- const char *config) const
+ const std::string &p,
+ const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char *>(this,
p,
@@ -4711,8 +4723,8 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
//----------------------------------------------------------------------------
const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
- const std::string &p,
- const char *config) const
+ const std::string &p,
+ const std::string& config) const
{
return checkInterfacePropertyCompatibility<const char *>(this,
p,
@@ -4724,7 +4736,7 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
//----------------------------------------------------------------------------
bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
const std::string& interfaceProperty,
- const char *config)
+ const std::string& config)
{
std::vector<cmTarget*> deps;
tgt->GetTransitiveTargetClosure(config, tgt, deps);
@@ -4762,7 +4774,7 @@ bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
//----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
- const char *config) const
+ const std::string& config) const
{
if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4776,7 +4788,7 @@ bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
//----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
- const char *config) const
+ const std::string& config) const
{
if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4790,7 +4802,7 @@ bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
//----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
- const char *config) const
+ const std::string& config) const
{
if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4803,7 +4815,7 @@ bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
//----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
- const char *config) const
+ const std::string& config) const
{
if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY)
@@ -4829,7 +4841,7 @@ void cmTarget::GetLanguages(std::set<std::string>& languages) const
}
//----------------------------------------------------------------------------
-bool cmTarget::IsChrpathUsed(const char* config) const
+bool cmTarget::IsChrpathUsed(const std::string& config) const
{
// Only certain target types have an rpath.
if(!(this->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -4897,7 +4909,8 @@ bool cmTarget::IsChrpathUsed(const char* config) const
//----------------------------------------------------------------------------
cmTarget::ImportInfo const*
-cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const
+cmTarget::GetImportInfo(const std::string& config,
+ cmTarget const* headTarget) const
{
// There is no imported information for non-imported targets.
if(!this->IsImported())
@@ -4908,7 +4921,7 @@ cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const
// Lookup/compute/cache the import information for this
// configuration.
std::string config_upper;
- if(config && *config)
+ if(!config.empty())
{
config_upper = cmSystemTools::UpperCase(config);
}
@@ -5262,7 +5275,8 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
}
//----------------------------------------------------------------------------
-cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
+cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
+ const std::string& config,
cmTarget const* head) const
{
// Imported targets have their own link interface.
@@ -5284,7 +5298,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
}
// Lookup any existing link interface for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
+ TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkInterfaceMapType::iterator
i = this->Internal->LinkInterfaceMap.find(key);
@@ -5315,7 +5329,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
//----------------------------------------------------------------------------
cmTarget::LinkInterface const*
-cmTarget::GetLinkInterfaceLibraries(const char* config,
+cmTarget::GetLinkInterfaceLibraries(const std::string& config,
cmTarget const* head) const
{
// Imported targets have their own link interface.
@@ -5337,7 +5351,7 @@ cmTarget::GetLinkInterfaceLibraries(const char* config,
}
// Lookup any existing link interface for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
+ TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkInterfaceMapType::iterator
i = this->Internal->LinkInterfaceMap.find(key);
@@ -5359,7 +5373,7 @@ cmTarget::GetLinkInterfaceLibraries(const char* config,
}
//----------------------------------------------------------------------------
-void processILibs(const char* config,
+void processILibs(const std::string& config,
cmTarget const* headTarget,
std::string const& name,
std::vector<cmTarget*>& tgts, std::set<cmTarget*>& emitted)
@@ -5387,7 +5401,7 @@ void processILibs(const char* config,
}
//----------------------------------------------------------------------------
-void cmTarget::GetTransitiveTargetClosure(const char* config,
+void cmTarget::GetTransitiveTargetClosure(const std::string& config,
cmTarget const* headTarget,
std::vector<cmTarget*> &tgts) const
{
@@ -5404,7 +5418,7 @@ void cmTarget::GetTransitiveTargetClosure(const char* config,
}
//----------------------------------------------------------------------------
-void cmTarget::GetTransitivePropertyTargets(const char* config,
+void cmTarget::GetTransitivePropertyTargets(const std::string& config,
cmTarget const* headTarget,
std::vector<cmTarget*> &tgts) const
{
@@ -5464,14 +5478,14 @@ void cmTarget::GetTransitivePropertyTargets(const char* config,
}
//----------------------------------------------------------------------------
-const char* cmTarget::ComputeLinkInterfaceLibraries(const char* config,
+const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
LinkInterface& iface,
cmTarget const* headTarget,
bool &exists) const
{
// Construct the property name suffix for this configuration.
std::string suffix = "_";
- if(config && *config)
+ if(!config.empty())
{
suffix += cmSystemTools::UpperCase(config);
}
@@ -5642,7 +5656,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const char* config,
//----------------------------------------------------------------------------
void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
- const char* config,
+ const std::string& config,
OptionalLinkInterface& iface,
cmTarget const* headTarget,
const char* explicitLibraries) const
@@ -5714,7 +5728,7 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
{
// Construct the property name suffix for this configuration.
std::string suffix = "_";
- if(config && *config)
+ if(!config.empty())
{
suffix += cmSystemTools::UpperCase(config);
}
@@ -5742,7 +5756,8 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
//----------------------------------------------------------------------------
cmTarget::LinkImplementation const*
-cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
+cmTarget::GetLinkImplementation(const std::string& config,
+ cmTarget const* head) const
{
// There is no link implementation for imported targets.
if(this->IsImported())
@@ -5751,7 +5766,7 @@ cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
}
// Lookup any existing link implementation for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
+ TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkImplMapType::iterator
i = this->Internal->LinkImplMap.find(key);
@@ -5776,7 +5791,7 @@ cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
//----------------------------------------------------------------------------
cmTarget::LinkImplementation const*
-cmTarget::GetLinkImplementationLibraries(const char* config,
+cmTarget::GetLinkImplementationLibraries(const std::string& config,
cmTarget const* head) const
{
// There is no link implementation for imported targets.
@@ -5786,7 +5801,7 @@ cmTarget::GetLinkImplementationLibraries(const char* config,
}
// Lookup any existing link implementation for this configuration.
- TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : ""));
+ TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkImplMapType::iterator
i = this->Internal->LinkImplMap.find(key);
@@ -5805,7 +5820,7 @@ cmTarget::GetLinkImplementationLibraries(const char* config,
}
//----------------------------------------------------------------------------
-void cmTarget::ComputeLinkImplementation(const char* config,
+void cmTarget::ComputeLinkImplementation(const std::string& config,
LinkImplementation& impl,
cmTarget const* head) const
{
@@ -5970,14 +5985,14 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const
template<typename PropertyType>
PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt,
const std::string& prop,
- const char *config,
+ const std::string& config,
CompatibleType,
PropertyType *);
template<>
bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
const std::string& prop,
- const char *config,
+ const std::string& config,
CompatibleType, bool *)
{
return tgt->GetLinkInterfaceDependentBoolProperty(prop, config);
@@ -5986,7 +6001,7 @@ bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
template<>
const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
const std::string& prop,
- const char *config,
+ const std::string& config,
CompatibleType t,
const char **)
{
@@ -6012,7 +6027,7 @@ void checkPropertyConsistency(cmTarget const* depender,
cmTarget const* dependee,
const std::string& propName,
std::set<std::string> &emitted,
- const char *config,
+ const std::string& config,
CompatibleType t,
PropertyType *)
{
@@ -6101,7 +6116,7 @@ static std::string intersect(const std::set<std::string> &s1,
//----------------------------------------------------------------------------
void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
- const char* config) const
+ const std::string& config) const
{
const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
@@ -6205,12 +6220,12 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
//----------------------------------------------------------------------------
cmComputeLinkInformation*
-cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const
+cmTarget::GetLinkInformation(const std::string& config,
+ cmTarget const* head) const
{
cmTarget const* headTarget = head ? head : this;
// Lookup any existing information for this configuration.
- TargetConfigPair key(headTarget,
- cmSystemTools::UpperCase(config?config:""));
+ TargetConfigPair key(headTarget, cmSystemTools::UpperCase(config));
cmTargetLinkInformationMap::iterator
i = this->LinkInformation.find(key);
if(i == this->LinkInformation.end())
@@ -6237,7 +6252,7 @@ cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetFrameworkDirectory(const char* config,
+std::string cmTarget::GetFrameworkDirectory(const std::string& config,
bool rootDir) const
{
std::string fpath;
@@ -6252,7 +6267,7 @@ std::string cmTarget::GetFrameworkDirectory(const char* config,
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetCFBundleDirectory(const char* config,
+std::string cmTarget::GetCFBundleDirectory(const std::string& config,
bool contentOnly) const
{
std::string fpath;
@@ -6271,7 +6286,7 @@ std::string cmTarget::GetCFBundleDirectory(const char* config,
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetAppBundleDirectory(const char* config,
+std::string cmTarget::GetAppBundleDirectory(const std::string& config,
bool contentOnly) const
{
std::string fpath = this->GetFullName(config, false);
@@ -6283,7 +6298,7 @@ std::string cmTarget::GetAppBundleDirectory(const char* config,
//----------------------------------------------------------------------------
std::string cmTarget::BuildMacContentDirectory(const std::string& base,
- const char* config,
+ const std::string& config,
bool contentOnly) const
{
std::string fpath = base;
@@ -6303,7 +6318,7 @@ std::string cmTarget::BuildMacContentDirectory(const std::string& base,
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetMacContentDirectory(const char* config,
+std::string cmTarget::GetMacContentDirectory(const std::string& config,
bool implib) const
{
// Start with the output directory for the target.
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 41f84a6..65fbb0f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -155,15 +155,15 @@ public:
return this->LinkLibraries;}
const LinkLibraryVectorType &GetOriginalLinkLibraries() const
{return this->OriginalLinkLibraries;}
- void GetDirectLinkLibraries(const char *config,
+ void GetDirectLinkLibraries(const std::string& config,
std::vector<std::string> &,
cmTarget const* head) const;
- void GetInterfaceLinkLibraries(const char *config,
+ void GetInterfaceLinkLibraries(const std::string& config,
std::vector<std::string> &,
cmTarget const* head) const;
/** Compute the link type to use for the given configuration. */
- LinkLibraryType ComputeLinkType(const char* config) const;
+ LinkLibraryType ComputeLinkType(const std::string& config) const;
/**
* Clear the dependency information recorded for this target, if any.
@@ -232,7 +232,8 @@ public:
bool GetPropertyAsBool(const std::string& prop) const;
void CheckProperty(const std::string& prop, cmMakefile* context) const;
- const char* GetFeature(const char* feature, const char* config) const;
+ const char* GetFeature(const char* feature,
+ const std::string& config) const;
bool IsImported() const {return this->IsImportedTarget;}
@@ -264,14 +265,14 @@ public:
/** Get the link interface for the given configuration. Returns 0
if the target cannot be linked. */
- LinkInterface const* GetLinkInterface(const char* config,
+ LinkInterface const* GetLinkInterface(const std::string& config,
cmTarget const* headTarget) const;
- LinkInterface const* GetLinkInterfaceLibraries(const char* config,
+ LinkInterface const* GetLinkInterfaceLibraries(const std::string& config,
cmTarget const* headTarget) const;
- void GetTransitivePropertyTargets(const char* config,
+ void GetTransitivePropertyTargets(const std::string& config,
cmTarget const* headTarget,
std::vector<cmTarget*> &libs) const;
- void GetTransitiveTargetClosure(const char* config,
+ void GetTransitiveTargetClosure(const std::string& config,
cmTarget const* headTarget,
std::vector<cmTarget*> &libs) const;
@@ -289,10 +290,11 @@ public:
// Needed only for OLD behavior of CMP0003.
std::vector<std::string> WrongConfigLibraries;
};
- LinkImplementation const* GetLinkImplementation(const char* config,
+ LinkImplementation const* GetLinkImplementation(const std::string& config,
cmTarget const* head) const;
- LinkImplementation const* GetLinkImplementationLibraries(const char* config,
+ LinkImplementation const* GetLinkImplementationLibraries(
+ const std::string& config,
cmTarget const* head) const;
/** Link information from the transitive closure of the link
@@ -305,7 +307,7 @@ public:
// Languages whose runtime libraries must be linked.
std::vector<std::string> Languages;
};
- LinkClosure const* GetLinkClosure(const char* config,
+ LinkClosure const* GetLinkClosure(const std::string& config,
cmTarget const* head) const;
/** Strip off leading and trailing whitespace from an item named in
@@ -316,23 +318,24 @@ public:
configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
output directory is given. */
- std::string GetDirectory(const char* config = 0, bool implib = false) const;
+ std::string GetDirectory(const std::string& config = "",
+ bool implib = false) const;
/** Get the directory in which this targets .pdb files will be placed.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
pdb output directory is given. */
- std::string GetPDBDirectory(const char* config) const;
+ std::string GetPDBDirectory(const std::string& config) const;
/** Get the directory in which to place the target compiler .pdb file.
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
compiler pdb output directory is given. */
- std::string GetCompilePDBDirectory(const char* config = 0) const;
+ std::string GetCompilePDBDirectory(const std::string& config = "") const;
/** Get the location of the target in the build tree for the given
configuration. */
- const char* GetLocation(const char* config) const;
+ const char* GetLocation(const std::string& config) const;
/** Get the location of the target in the build tree with a placeholder
referencing the configuration in the native build system. This
@@ -351,44 +354,46 @@ public:
GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
///! Return the preferred linker language for this target
- std::string GetLinkerLanguage(const char* config = 0,
+ std::string GetLinkerLanguage(const std::string& config = "",
cmTarget const* head = 0) const;
/** Get the full name of the target according to the settings in its
makefile. */
- std::string GetFullName(const char* config=0, bool implib = false) const;
+ std::string GetFullName(const std::string& config="",
+ bool implib = false) const;
void GetFullNameComponents(std::string& prefix,
std::string& base, std::string& suffix,
- const char* config=0, bool implib = false) const;
+ const std::string& config="",
+ bool implib = false) const;
/** Get the name of the pdb file for the target. */
- std::string GetPDBName(const char* config) const;
+ std::string GetPDBName(const std::string& config) const;
/** Get the name of the compiler pdb file for the target. */
- std::string GetCompilePDBName(const char* config=0) const;
+ std::string GetCompilePDBName(const std::string& config="") const;
/** Get the path for the MSVC /Fd option for this target. */
- std::string GetCompilePDBPath(const char* config=0) const;
+ std::string GetCompilePDBPath(const std::string& config="") const;
/** Whether this library has soname enabled and platform supports it. */
- bool HasSOName(const char* config) const;
+ bool HasSOName(const std::string& config) const;
/** Get the soname of the target. Allowed only for a shared library. */
- std::string GetSOName(const char* config) const;
+ std::string GetSOName(const std::string& config) const;
/** Whether this library has \@rpath and platform supports it. */
- bool HasMacOSXRpathInstallNameDir(const char* config) const;
+ bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
/** Whether this library defaults to \@rpath. */
bool MacOSXRpathInstallNameDirDefault() const;
/** Test for special case of a third-party shared library that has
no soname at all. */
- bool IsImportedSharedLibWithoutSOName(const char* config) const;
+ bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
/** Get the full path to the target according to the settings in its
makefile and the configuration type. */
- std::string GetFullPath(const char* config=0, bool implib = false,
+ std::string GetFullPath(const std::string& config="", bool implib = false,
bool realname = false) const;
/** Get the names of the library needed to generate a build rule
@@ -396,14 +401,15 @@ public:
should be called only on a library target. */
void GetLibraryNames(std::string& name, std::string& soName,
std::string& realName, std::string& impName,
- std::string& pdbName, const char* config) const;
+ std::string& pdbName, const std::string& config) const;
/** Get the names of the executable needed to generate a build rule
that takes into account executable version numbers. This should
be called only on an executable target. */
void GetExecutableNames(std::string& name, std::string& realName,
std::string& impName,
- std::string& pdbName, const char* config) const;
+ std::string& pdbName,
+ const std::string& config) const;
/** Does this target have a GNU implib to convert to MS format? */
bool HasImplibGNUtoMS() const;
@@ -416,24 +422,24 @@ public:
/**
* Compute whether this target must be relinked before installing.
*/
- bool NeedRelinkBeforeInstall(const char* config) const;
+ bool NeedRelinkBeforeInstall(const std::string& config) const;
- bool HaveBuildTreeRPATH(const char *config) const;
+ bool HaveBuildTreeRPATH(const std::string& config) const;
bool HaveInstallTreeRPATH() const;
/** Return true if builtin chrpath will work for this target */
- bool IsChrpathUsed(const char* config) const;
+ bool IsChrpathUsed(const std::string& config) const;
/** Return the install name directory for the target in the
* build tree. For example: "\@rpath/", "\@loader_path/",
* or "/full/path/to/library". */
- std::string GetInstallNameDirForBuildTree(const char* config) const;
+ std::string GetInstallNameDirForBuildTree(const std::string& config) const;
/** Return the install name directory for the target in the
* install tree. For example: "\@rpath/" or "\@loader_path/". */
std::string GetInstallNameDirForInstallTree() const;
- cmComputeLinkInformation* GetLinkInformation(const char* config,
+ cmComputeLinkInformation* GetLinkInformation(const std::string& config,
cmTarget const* head = 0) const;
// Get the properties
@@ -452,7 +458,7 @@ public:
const char* GetExportMacro() const;
void GetCompileDefinitions(std::vector<std::string> &result,
- const char *config) const;
+ const std::string& config) const;
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
@@ -500,26 +506,29 @@ public:
/** Return whether this target uses the default value for its output
directory. */
- bool UsesDefaultOutputDir(const char* config, bool implib) const;
+ bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
/** @return the mac content directory for this target. */
- std::string GetMacContentDirectory(const char* config,
+ std::string GetMacContentDirectory(const std::string& config,
bool implib) const;
/** @return whether this target have a well defined output file name. */
bool HaveWellDefinedOutputFiles() const;
/** @return the Mac framework directory without the base. */
- std::string GetFrameworkDirectory(const char* config, bool rootDir) const;
+ std::string GetFrameworkDirectory(const std::string& config,
+ bool rootDir) const;
/** @return the Mac CFBundle directory without the base */
- std::string GetCFBundleDirectory(const char* config, bool contentOnly) const;
+ std::string GetCFBundleDirectory(const std::string& config,
+ bool contentOnly) const;
/** @return the Mac App directory without the base */
- std::string GetAppBundleDirectory(const char* config,
+ std::string GetAppBundleDirectory(const std::string& config,
bool contentOnly) const;
- std::vector<std::string> GetIncludeDirectories(const char *config) const;
+ std::vector<std::string> GetIncludeDirectories(
+ const std::string& config) const;
void InsertInclude(const cmValueWithOrigin &entry,
bool before = false);
void InsertCompileOption(const cmValueWithOrigin &entry,
@@ -529,29 +538,29 @@ public:
void AppendBuildInterfaceIncludes();
void GetCompileOptions(std::vector<std::string> &result,
- const char *config) const;
+ const std::string& config) const;
void GetAutoUicOptions(std::vector<std::string> &result,
- const char *config) const;
+ const std::string& config) const;
bool IsNullImpliedByLinkLibraries(const std::string &p) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
bool IsLinkInterfaceDependentStringProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
const char *GetLinkInterfaceDependentStringProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
- const char *config) const;
+ const std::string& config) const;
std::string GetDebugGeneratorExpressions(const std::string &value,
cmTarget::LinkLibraryType llt) const;
@@ -631,8 +640,9 @@ private:
const char* GetSuffixVariableInternal(bool implib) const;
const char* GetPrefixVariableInternal(bool implib) const;
- std::string GetFullNameInternal(const char* config, bool implib) const;
- void GetFullNameInternal(const char* config, bool implib,
+ std::string GetFullNameInternal(const std::string& config,
+ bool implib) const;
+ void GetFullNameInternal(const std::string& config, bool implib,
std::string& outPrefix, std::string& outBase,
std::string& outSuffix) const;
@@ -645,23 +655,25 @@ private:
const char* GetOutputTargetType(bool implib) const;
// Get the target base name.
- std::string GetOutputName(const char* config, bool implib) const;
+ std::string GetOutputName(const std::string& config, bool implib) const;
- std::string GetFullNameImported(const char* config, bool implib) const;
+ std::string GetFullNameImported(const std::string& config,
+ bool implib) const;
- std::string ImportedGetFullPath(const char* config, bool implib) const;
- std::string NormalGetFullPath(const char* config, bool implib,
+ std::string ImportedGetFullPath(const std::string& config,
+ bool implib) const;
+ std::string NormalGetFullPath(const std::string& config, bool implib,
bool realname) const;
/** Get the real name of the target. Allowed only for non-imported
targets. When a library or executable file is versioned this is
the full versioned name. If the target is not versioned this is
the same as GetFullName. */
- std::string NormalGetRealName(const char* config) const;
+ std::string NormalGetRealName(const std::string& config) const;
/** Append to @a base the mac content directory and return it. */
std::string BuildMacContentDirectory(const std::string& base,
- const char* config,
+ const std::string& config,
bool contentOnly) const;
private:
@@ -698,37 +710,38 @@ private:
// Cache target output paths for each configuration.
struct OutputInfo;
- OutputInfo const* GetOutputInfo(const char* config) const;
+ OutputInfo const* GetOutputInfo(const std::string& config) const;
bool
- ComputeOutputDir(const char* config, bool implib, std::string& out) const;
- bool ComputePDBOutputDir(const char* kind, const char* config,
+ ComputeOutputDir(const std::string& config,
+ bool implib, std::string& out) const;
+ bool ComputePDBOutputDir(const char* kind, const std::string& config,
std::string& out) const;
// Cache import information from properties for each configuration.
struct ImportInfo;
- ImportInfo const* GetImportInfo(const char* config,
+ ImportInfo const* GetImportInfo(const std::string& config,
cmTarget const* workingTarget) const;
void ComputeImportInfo(std::string const& desired_config, ImportInfo& info,
cmTarget const* head) const;
// Cache target compile paths for each configuration.
struct CompileInfo;
- CompileInfo const* GetCompileInfo(const char* config) const;
+ CompileInfo const* GetCompileInfo(const std::string& config) const;
mutable cmTargetLinkInformationMap LinkInformation;
void CheckPropertyCompatibility(cmComputeLinkInformation *info,
- const char* config) const;
+ const std::string& config) const;
- const char* ComputeLinkInterfaceLibraries(const char* config,
+ const char* ComputeLinkInterfaceLibraries(const std::string& config,
LinkInterface& iface,
cmTarget const* head,
bool &exists) const;
- void ComputeLinkImplementation(const char* config,
+ void ComputeLinkImplementation(const std::string& config,
LinkImplementation& impl,
cmTarget const* head) const;
void ComputeLinkImplementationLanguages(LinkImplementation& impl) const;
- void ComputeLinkClosure(const char* config, LinkClosure& lc,
+ void ComputeLinkClosure(const std::string& config, LinkClosure& lc,
cmTarget const* head) const;
void ClearLinkMaps();
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 5dc3e60..a21e1aa 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -64,7 +64,7 @@ void cmTestGenerator::GenerateScriptActions(std::ostream& os,
//----------------------------------------------------------------------------
void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
Indent const& indent)
{
this->TestGenerated = true;
diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h
index 2c69fc3..5446553 100644
--- a/Source/cmTestGenerator.h
+++ b/Source/cmTestGenerator.h
@@ -32,7 +32,7 @@ protected:
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os,
- const char* config,
+ const std::string& config,
Indent const& indent);
virtual void GenerateScriptNoConfig(std::ostream& os, Indent const& indent);
virtual bool NeedsScriptNoConfig() const;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index aa721b7..90155b4 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -140,7 +140,7 @@ cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator()
void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
const char* tag,
- const char* config,
+ const std::string& config,
int indentLevel,
const char* attribute,
const char* end,
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8d69254..02b951c 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -35,7 +35,7 @@ public:
// used by cmVisualStudioGeneratorOptions
void WritePlatformConfigTag(
const char* tag,
- const char* config,
+ const std::string& config,
int indentLevel,
const char* attribute = 0,
const char* end = 0,
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index 8eaf2aa..3a6528a 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -122,26 +122,18 @@ public:
void CopyAttributes(cmXCodeObject* );
- void AddDependLibrary(const char* configName,
+ void AddDependLibrary(const std::string& configName,
const std::string& l)
{
- if(!configName)
- {
- configName = "";
- }
this->DependLibraries[configName].push_back(l);
}
std::map<std::string, StringVec> const& GetDependLibraries()
{
return this->DependLibraries;
}
- void AddDependTarget(const char* configName,
+ void AddDependTarget(const std::string& configName,
const std::string& tName)
{
- if(!configName)
- {
- configName = "";
- }
this->DependTargets[configName].push_back(tName);
}
std::map<std::string, StringVec> const& GetDependTargets()
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 603b6d0..047f09d 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -666,7 +666,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "cmake_autogen" && args.size() >= 4)
{
cmQtAutoGenerators autogen;
- const char *config = args[3].empty() ? 0 : args[3].c_str();
+ std::string const& config = args[3];
bool autogenSuccess = autogen.Run(args[2].c_str(), config);
return autogenSuccess ? 0 : 1;
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3332377f569a35c3e73c53083a109141446143a1
commit 3332377f569a35c3e73c53083a109141446143a1
Author: Brad King <brad.king at kitware.com>
AuthorDate: Sat Mar 8 07:55:46 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Sat Mar 8 08:13:35 2014 -0500
cmTarget: Refactor GetLocation API
When given a non-NULL configuration the GetLocation returned the
location for the given configuration. When given a NULL configuration
the GetLocation method returned a location with the build-system
placeholder for the configuration name. Split the latter use case out
into a separate GetLocationForBuild method and update call sites
accordingly.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index a7b2efa..f7f6feb 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -742,7 +742,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
{
// This is really only for compatibility so we do not need to
// worry about configuration names and output names.
- std::string tLocation = t->GetLocation(0);
+ std::string tLocation = t->GetLocationForBuild();
tLocation = cmSystemTools::GetFilenamePath(tLocation);
std::string depLocation = cmSystemTools::GetFilenamePath(dep);
depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 25df953..2d485f6 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -76,7 +76,7 @@ void cmGlobalKdevelopGenerator::Generate()
{
if (ti->second.GetType()==cmTarget::EXECUTABLE)
{
- executable = ti->second.GetLocation(0);
+ executable = ti->second.GetLocation("");
break;
}
}
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 17b2424..fbb3b1c 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -610,7 +610,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
autogenTargetName.c_str());
return;
}
- makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(0));
+ makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(""));
}
else if (strcmp(qtVersion, "4") == 0)
{
@@ -621,7 +621,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
autogenTargetName.c_str());
return;
}
- makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(0));
+ makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(""));
}
else
{
@@ -782,7 +782,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
}
else
{
- makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(0));
+ makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(""));
}
}
else if (strcmp(qtVersion, "4") == 0)
@@ -794,7 +794,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
targetName.c_str());
return;
}
- makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(0));
+ makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(""));
}
else
{
@@ -931,7 +931,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
targetName.c_str());
return;
}
- makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(0));
+ makefile->AddDefinition("_qt_rcc_executable", qt5Rcc->GetLocation(""));
}
else if (strcmp(qtVersion, "4") == 0)
{
@@ -942,7 +942,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
targetName.c_str());
return;
}
- makefile->AddDefinition("_qt_rcc_executable", qt4Rcc->GetLocation(0));
+ makefile->AddDefinition("_qt_rcc_executable", qt4Rcc->GetLocation(""));
}
else
{
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 99f2c1f..3273437 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2458,32 +2458,25 @@ std::string cmTarget::GetCompilePDBDirectory(const char* config) const
//----------------------------------------------------------------------------
const char* cmTarget::GetLocation(const char* config) const
{
+ static std::string location;
if (this->IsImported())
{
- return this->ImportedGetLocation(config);
+ location = this->ImportedGetFullPath(config, false);
}
else
{
- return this->NormalGetLocation(config);
+ location = this->GetFullPath(config, false);
}
-}
-
-//----------------------------------------------------------------------------
-const char* cmTarget::ImportedGetLocation(const char* config) const
-{
- static std::string location;
- location = this->ImportedGetFullPath(config, false);
return location.c_str();
}
//----------------------------------------------------------------------------
-const char* cmTarget::NormalGetLocation(const char* config) const
+const char* cmTarget::GetLocationForBuild() const
{
static std::string location;
- // Handle the configuration-specific case first.
- if(config)
+ if(this->IsImported())
{
- location = this->GetFullPath(config, false);
+ location = this->ImportedGetFullPath("", false);
return location.c_str();
}
@@ -2503,7 +2496,7 @@ const char* cmTarget::NormalGetLocation(const char* config) const
if(this->IsAppBundleOnApple())
{
- std::string macdir = this->BuildMacContentDirectory("", config, false);
+ std::string macdir = this->BuildMacContentDirectory("", "", false);
if(!macdir.empty())
{
location += "/";
@@ -2511,7 +2504,7 @@ const char* cmTarget::NormalGetLocation(const char* config) const
}
}
location += "/";
- location += this->GetFullName(config, false);
+ location += this->GetFullName("", false);
return location.c_str();
}
@@ -2659,7 +2652,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// cannot take into account the per-configuration name of the
// target because the configuration type may not be known at
// CMake time.
- this->Properties.SetProperty("LOCATION", this->GetLocation(0),
+ this->Properties.SetProperty("LOCATION", this->GetLocationForBuild(),
cmProperty::TARGET);
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index ec74e05..41f84a6 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -331,10 +331,14 @@ public:
std::string GetCompilePDBDirectory(const char* config = 0) const;
/** Get the location of the target in the build tree for the given
- configuration. This location is suitable for use as the LOCATION
- target property. */
+ configuration. */
const char* GetLocation(const char* config) const;
+ /** Get the location of the target in the build tree with a placeholder
+ referencing the configuration in the native build system. This
+ location is suitable for use as the LOCATION target property. */
+ const char* GetLocationForBuild() const;
+
/** Get the target major and minor version numbers interpreted from
the VERSION property. Version 0 is returned if the property is
not set or cannot be parsed. */
@@ -643,9 +647,6 @@ private:
// Get the target base name.
std::string GetOutputName(const char* config, bool implib) const;
- const char* ImportedGetLocation(const char* config) const;
- const char* NormalGetLocation(const char* config) const;
-
std::string GetFullNameImported(const char* config, bool implib) const;
std::string ImportedGetFullPath(const char* config, bool implib) const;
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list