diff options
author | David Cole <david.cole@kitware.com> | 2012-03-27 19:56:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-03-27 19:56:31 (GMT) |
commit | a3b7caaf5f661a9e07e1af5ee8a677f676714025 (patch) | |
tree | 724496c24ab597f7132f30851bdba0baa2f7b3ca /Source | |
parent | ef309e94cb85d359db3cbf0aac3e7e290a0125f0 (diff) | |
parent | 9b32475587c1b7a911e5c635611c1fe5296b8740 (diff) | |
download | CMake-a3b7caaf5f661a9e07e1af5ee8a677f676714025.zip CMake-a3b7caaf5f661a9e07e1af5ee8a677f676714025.tar.gz CMake-a3b7caaf5f661a9e07e1af5ee8a677f676714025.tar.bz2 |
Merge topic 'AutomocProperCMakeEscaping_13018'
9b32475 automoc: add define to test which caused bug #13018
2066511 automoc: fix #13018, proper cmake escaping to avoid false rebuilds
c652812 make cmLocalGenerator::EscapeForCMake() static
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmQtAutomoc.cxx | 26 |
2 files changed, 18 insertions, 10 deletions
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 124747b..3e93819 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -251,7 +251,7 @@ public: std::string EscapeForShellOldStyle(const char* str); /** Escape the given string as an argument in a CMake script. */ - std::string EscapeForCMake(const char* str); + static std::string EscapeForCMake(const char* str); enum FortranFormat { diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 0d0d80c..8b899bc 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -202,13 +202,20 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) cmMakefile::ScopePushPop varScope(makefile); static_cast<void>(varScope); - makefile->AddDefinition("_moc_target_name", automocTargetName.c_str()); - makefile->AddDefinition("_moc_incs", _moc_incs.c_str()); - makefile->AddDefinition("_moc_defs", _moc_defs.c_str()); - makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str()); - makefile->AddDefinition("_moc_options", _moc_options.c_str()); - makefile->AddDefinition("_moc_files", _moc_files.c_str()); - makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); + makefile->AddDefinition("_moc_target_name", + cmLocalGenerator::EscapeForCMake(automocTargetName.c_str()).c_str()); + makefile->AddDefinition("_moc_incs", + cmLocalGenerator::EscapeForCMake(_moc_incs.c_str()).c_str()); + makefile->AddDefinition("_moc_defs", + cmLocalGenerator::EscapeForCMake(_moc_defs.c_str()).c_str()); + makefile->AddDefinition("_moc_compile_defs", + cmLocalGenerator::EscapeForCMake(_moc_compile_defs.c_str()).c_str()); + makefile->AddDefinition("_moc_options", + cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str()); + makefile->AddDefinition("_moc_files", + cmLocalGenerator::EscapeForCMake(_moc_files.c_str()).c_str()); + makefile->AddDefinition("_moc_headers", + cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str()); makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); @@ -340,8 +347,9 @@ void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory) std::fstream outfile; outfile.open(filename.c_str(), std::ios::out | std::ios::trunc); - outfile << "set(AM_OLD_MOC_DEFINITIONS \"" - << this->Join(this->MocDefinitions, ' ') << "\")\n"; + outfile << "set(AM_OLD_MOC_DEFINITIONS " + << cmLocalGenerator::EscapeForCMake( + this->Join(this->MocDefinitions, ' ').c_str()) << ")\n"; outfile.close(); } |