summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.cxx1
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx1
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx1
-rw-r--r--Source/cmLocalGenerator.cxx7
-rw-r--r--Source/cmLocalGenerator.h7
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx15
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h5
7 files changed, 13 insertions, 24 deletions
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index 1ce506d..bba00ae 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -43,7 +43,6 @@ void cmGlobalBorlandMakefileGenerator
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
- lg->SetEchoNeedsQuote(false);
lg->SetIncludeDirective("!include");
lg->SetWindowsShell(true);
lg->SetDefineWindowsNULL(true);
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 35a2a86..e86c7c6 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -39,7 +39,6 @@ void cmGlobalNMakeMakefileGenerator
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
- lg->SetEchoNeedsQuote(false);
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("/nologo");
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 6f6c8cf..29a60d4 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -48,7 +48,6 @@ cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
lg->SetSilentNoColon(true);
- lg->SetEchoNeedsQuote(false);
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("-s -h");
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index fe89580..3436d6f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2278,7 +2278,8 @@ std::string cmLocalGenerator::EscapeForShellOldStyle(const char* str)
}
//----------------------------------------------------------------------------
-std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars)
+std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars,
+ bool forEcho)
{
// Compute the flags for the target shell environment.
int flags = 0;
@@ -2294,6 +2295,10 @@ std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars)
{
flags |= cmsysSystem_Shell_Flag_AllowMakeVariables;
}
+ if(forEcho)
+ {
+ flags |= cmsysSystem_Shell_Flag_EchoWindows;
+ }
// Compute the buffer size needed.
int size = (this->WindowsShell ?
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index f12ed9c..53b4220 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -204,8 +204,11 @@ public:
/** Escape the given string to be used as a command line argument in
the native build system shell. Optionally allow the build
- system to replace make variable references. */
- std::string EscapeForShell(const char* str, bool makeVars = false);
+ system to replace make variable references. Optionally adjust
+ escapes for the special case of passing to the native echo
+ command. */
+ std::string EscapeForShell(const char* str, bool makeVars = false,
+ bool forEcho = false);
/** Backwards-compatibility version of EscapeForShell. */
std::string EscapeForShellOldStyle(const char* str);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4460c46..c39b898 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -44,7 +44,6 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
this->MakefileVariableSize = 0;
this->IgnoreLibPrefix = false;
this->PassMakeflags = false;
- this->EchoNeedsQuote = true;
this->DefineWindowsNULL = false;
this->UnixCD = true;
this->ForceVerboseMakefiles=false;
@@ -1046,24 +1045,14 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands,
{
// Use the native echo command.
cmd = "@echo ";
- if(this->EchoNeedsQuote)
- {
- cmd += "\"";
- }
- cmd += line;
- if(this->EchoNeedsQuote)
- {
- cmd += "\"";
- }
+ cmd += this->EscapeForShell(line.c_str(), false, true);
}
else
{
// Use cmake to echo the text in color.
cmd = "@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) ";
cmd += color_name;
- cmd += "\"";
- cmd += line;
- cmd += "\"";
+ cmd += this->EscapeForShell(line.c_str());
}
commands.push_back(cmd);
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 31c3e58..260f2aa 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -97,9 +97,6 @@ public:
void SetMakeSilentFlag(const char* s) { this->MakeSilentFlag = s; }
std::string &GetMakeSilentFlag() { return this->MakeSilentFlag; }
- /** Set whether the echo command needs its argument quoted. */
- void SetEchoNeedsQuote(bool b) { this->EchoNeedsQuote = b; }
-
/**
* Set to true if the shell being used is the windows shell.
* This controls if statements in the makefile and the SHELL variable.
@@ -339,8 +336,6 @@ private:
bool UnixCD;
bool PassMakeflags;
bool SilentNoColon;
- // Flag for whether echo command needs quotes.
- bool EchoNeedsQuote;
//==========================================================================
std::string HomeRelativeOutputPath;