diff options
author | Brad King <brad.king@kitware.com> | 2008-01-18 00:58:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-18 00:58:01 (GMT) |
commit | 8d1d5500c8cb7ebabce73777c79c33074e679ab5 (patch) | |
tree | 27c37321fe8aff93398c9309462eb4f05b735778 /Source/cmLocalGenerator.cxx | |
parent | 7f589c9f23ee64ca0d36e81a02a70a87bc7fbbbe (diff) | |
download | CMake-8d1d5500c8cb7ebabce73777c79c33074e679ab5.zip CMake-8d1d5500c8cb7ebabce73777c79c33074e679ab5.tar.gz CMake-8d1d5500c8cb7ebabce73777c79c33074e679ab5.tar.bz2 |
ENH: Enable use of COMPILE_DEFINITIONS property for Fortran sources.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 23179dc..66007d4 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2948,6 +2948,38 @@ std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars, } //---------------------------------------------------------------------------- +std::string cmLocalGenerator::EscapeForCMake(const char* str) +{ + // Always double-quote the argument to take care of most escapes. + std::string result = "\""; + for(const char* c = str; *c; ++c) + { + if(*c == '"') + { + // Escape the double quote to avoid ending the argument. + result += "\\\""; + } + else if(*c == '$') + { + // Escape the dollar to avoid expanding variables. + result += "\\$"; + } + else if(*c == '\\') + { + // Escape the backslash to avoid other escapes. + result += "\\\\"; + } + else + { + // Other characters will be parsed correctly. + result += *c; + } + } + result += "\""; + return result; +} + +//---------------------------------------------------------------------------- std::string cmLocalGenerator::GetTargetDirectory(cmTarget const&) const { |