diff options
author | Brad King <brad.king@kitware.com> | 2014-03-10 17:53:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-12 14:44:00 (GMT) |
commit | d45e7f34611cd678bdda29d7d2b2ff4ce1abbce7 (patch) | |
tree | 8ebbe10ac12a7d52520ee22b01c6a4391e2dd319 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | cb8f87f6229359790956a6640639bbe6b8c346f7 (diff) | |
download | CMake-d45e7f34611cd678bdda29d7d2b2ff4ce1abbce7.zip CMake-d45e7f34611cd678bdda29d7d2b2ff4ce1abbce7.tar.gz CMake-d45e7f34611cd678bdda29d7d2b2ff4ce1abbce7.tar.bz2 |
cmCustomCommand: Return std::string from GetWorkingDirectory
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3681e0e..d3f63f5 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1023,9 +1023,9 @@ cmLocalUnixMakefileGenerator3 } // if the command specified a working directory use it. - const char* dir = this->Makefile->GetStartOutputDirectory(); - const char* workingDir = cc.GetWorkingDirectory(); - if(workingDir) + std::string dir = this->Makefile->GetStartOutputDirectory(); + std::string workingDir = cc.GetWorkingDirectory(); + if(!workingDir.empty()) { dir = workingDir; } @@ -1066,7 +1066,7 @@ cmLocalUnixMakefileGenerator3 // Convert the command to a relative path only if the current // working directory will be the start-output directory. bool had_slash = cmd.find("/") != cmd.npos; - if(!workingDir) + if(workingDir.empty()) { cmd = this->Convert(cmd,START_OUTPUT); } @@ -1079,7 +1079,8 @@ cmLocalUnixMakefileGenerator3 cmd = "./" + cmd; } std::string launcher = - this->MakeLauncher(cc, target, workingDir? NONE : START_OUTPUT); + this->MakeLauncher(cc, target, + workingDir.empty()? START_OUTPUT : NONE); cmd = launcher + this->ConvertShellCommand(cmd, NONE); ccg.AppendArguments(c, cmd); @@ -1125,7 +1126,7 @@ cmLocalUnixMakefileGenerator3 } // Setup the proper working directory for the commands. - this->CreateCDCommand(commands1, dir, relative); + this->CreateCDCommand(commands1, dir.c_str(), relative); // push back the custom commands commands.insert(commands.end(), commands1.begin(), commands1.end()); |