diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-24 17:38:30 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 13:05:38 -0500 |
commit | 24b5e93de2c753e94cae3b41c1ca7cddaa03e5e7 (patch) | |
tree | 5ec6ae8e35601e8762007e248ab8f5e1da7b771c | |
parent | 11ed3e2cfe70e7d9d5a8e1f8e24fa61bbf6420b0 (diff) | |
download | cmake-24b5e93de2c753e94cae3b41c1ca7cddaa03e5e7.tar.gz |
stringapi: Use strings for directories
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 6 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 9 | ||||
-rw-r--r-- | Source/cmMakefile.h | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 20 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 8 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 |
19 files changed, 44 insertions, 38 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index a14696d256..c1cce2ed6e 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 5b979605a6..761fb0760b 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 16e9788ebf..73a6245d5d 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 86c2912f7a..4a284864a8 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 d94715096f..9ddbe5b453 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 8924fa8369..d64afaf6f4 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 0bc572b36e..3819a5be67 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 085f2d2aec..5d902eedb7 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 82047d7441..3a51fce80c 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 f7ef9729a4..eb3dddf976 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 c65bdaacbc..3927100492 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 342fa88d5d..b659480365 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 ec2e1e9831..e1f2a919a6 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 e9149c2d40..aec795841e 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 bb88bc4ab4..e61b12bf45 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 7c82ec21ae..fb40c1bbf1 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 8eee991a0a..48a6b38e30 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 af4ceb9f8c..a593dd5da6 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 5ada30e5cd..13572f418e 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, |