[cmake-commits] king committed cmGlobalBorlandMakefileGenerator.cxx
1.23 1.24 cmGlobalNMakeMakefileGenerator.cxx 1.22 1.23
cmGlobalWatcomWMakeGenerator.cxx 1.8 1.9 cmLocalGenerator.cxx
1.155 1.156 cmLocalGenerator.h 1.67 1.68
cmLocalUnixMakefileGenerator3.cxx 1.179 1.180
cmLocalUnixMakefileGenerator3.h 1.60 1.61
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Oct 4 18:52:31 EDT 2006
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv22457/Source
Modified Files:
cmGlobalBorlandMakefileGenerator.cxx
cmGlobalNMakeMakefileGenerator.cxx
cmGlobalWatcomWMakeGenerator.cxx cmLocalGenerator.cxx
cmLocalGenerator.h cmLocalUnixMakefileGenerator3.cxx
cmLocalUnixMakefileGenerator3.h
Log Message:
BUG: Fixed display of custom command comments with quotes, dollars, and other special characters in them.
Index: cmLocalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- cmLocalUnixMakefileGenerator3.h 28 Sep 2006 14:37:19 -0000 1.60
+++ cmLocalUnixMakefileGenerator3.h 4 Oct 2006 22:52:29 -0000 1.61
@@ -97,9 +97,6 @@
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 @@
bool UnixCD;
bool PassMakeflags;
bool SilentNoColon;
- // Flag for whether echo command needs quotes.
- bool EchoNeedsQuote;
//==========================================================================
std::string HomeRelativeOutputPath;
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -d -r1.155 -r1.156
--- cmLocalGenerator.cxx 28 Sep 2006 20:40:35 -0000 1.155
+++ cmLocalGenerator.cxx 4 Oct 2006 22:52:28 -0000 1.156
@@ -2278,7 +2278,8 @@
}
//----------------------------------------------------------------------------
-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 @@
{
flags |= cmsysSystem_Shell_Flag_AllowMakeVariables;
}
+ if(forEcho)
+ {
+ flags |= cmsysSystem_Shell_Flag_EchoWindows;
+ }
// Compute the buffer size needed.
int size = (this->WindowsShell ?
Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- cmLocalGenerator.h 28 Sep 2006 14:37:19 -0000 1.67
+++ cmLocalGenerator.h 4 Oct 2006 22:52:29 -0000 1.68
@@ -204,8 +204,11 @@
/** 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);
Index: cmGlobalNMakeMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalNMakeMakefileGenerator.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmGlobalNMakeMakefileGenerator.cxx 15 Jun 2006 20:17:11 -0000 1.22
+++ cmGlobalNMakeMakefileGenerator.cxx 4 Oct 2006 22:52:28 -0000 1.23
@@ -39,7 +39,6 @@
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
- lg->SetEchoNeedsQuote(false);
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("/nologo");
Index: cmGlobalBorlandMakefileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalBorlandMakefileGenerator.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- cmGlobalBorlandMakefileGenerator.cxx 15 Jun 2006 20:17:10 -0000 1.23
+++ cmGlobalBorlandMakefileGenerator.cxx 4 Oct 2006 22:52:28 -0000 1.24
@@ -43,7 +43,6 @@
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
- lg->SetEchoNeedsQuote(false);
lg->SetIncludeDirective("!include");
lg->SetWindowsShell(true);
lg->SetDefineWindowsNULL(true);
Index: cmGlobalWatcomWMakeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalWatcomWMakeGenerator.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmGlobalWatcomWMakeGenerator.cxx 2 Oct 2006 14:20:52 -0000 1.8
+++ cmGlobalWatcomWMakeGenerator.cxx 4 Oct 2006 22:52:28 -0000 1.9
@@ -48,7 +48,6 @@
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
lg->SetSilentNoColon(true);
- lg->SetEchoNeedsQuote(false);
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("-s -h");
Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -d -r1.179 -r1.180
--- cmLocalUnixMakefileGenerator3.cxx 29 Sep 2006 13:11:22 -0000 1.179
+++ cmLocalUnixMakefileGenerator3.cxx 4 Oct 2006 22:52:29 -0000 1.180
@@ -44,7 +44,6 @@
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 @@
{
// 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);
}
More information about the Cmake-commits
mailing list