diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-11-08 22:59:20 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-11-08 22:59:20 (GMT) |
commit | 34e78344516f1ddc8951ab3087fa8c6263021087 (patch) | |
tree | 295feffcc108b2ad97348ebc777b2565d5fae5d8 /Source/cmLocalGenerator.cxx | |
parent | eccc4779e44baeb0bdec8b0a83901bcbbf3ff7b8 (diff) | |
download | CMake-34e78344516f1ddc8951ab3087fa8c6263021087.zip CMake-34e78344516f1ddc8951ab3087fa8c6263021087.tar.gz CMake-34e78344516f1ddc8951ab3087fa8c6263021087.tar.bz2 |
ENH: Add support for output reguilar expression
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1aa0686..f48f760 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -184,7 +184,36 @@ void cmLocalGenerator::GenerateTestFiles() fout << "SET_TESTS_PROPERTIES(" << test->GetName() << " PROPERTIES "; for ( pit = mpit->begin(); pit != mpit->end(); ++ pit ) { - fout << " " << pit->first.c_str() << " \"" << pit->second.c_str() << "\""; + fout << " " << pit->first.c_str() << " \""; + const char* value = pit->second.c_str(); + for ( ; *value; ++ value ) + { + switch ( *value ) + { + case '\\': + case '"': + case ' ': + case '#': + case '(': + case ')': + case '$': + case '^': + fout << "\\" << *value; + break; + case '\t': + fout << "\\t"; + break; + case '\n': + fout << "\\n"; + break; + case '\r': + fout << "\\r"; + break; + default: + fout << *value; + } + } + fout << "\""; } fout << ")" << std::endl; } |