diff options
-rw-r--r-- | Source/cmQtAutomoc.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index fdc19e4..e9cc9d1 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -124,18 +124,21 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) } } - const char* _moc_incs = makefile->GetProperty("INCLUDE_DIRECTORIES"); - const char* _moc_defs = makefile->GetProperty("DEFINITIONS"); - const char* _moc_compile_defs = makefile->GetProperty("COMPILE_DEFINITIONS"); + const char* tmp = makefile->GetProperty("INCLUDE_DIRECTORIES"); + std::string _moc_incs = (tmp!=0 ? tmp : ""); + tmp = makefile->GetProperty("DEFINITIONS"); + std::string _moc_defs = (tmp!=0 ? tmp : ""); + tmp = makefile->GetProperty("COMPILE_DEFINITIONS"); + std::string _moc_compile_defs = (tmp!=0 ? tmp : ""); + // forget the variables added here afterwards again: cmMakefile::ScopePushPop varScope(makefile); static_cast<void>(varScope); makefile->AddDefinition("_moc_target_name", automocTargetName.c_str()); - makefile->AddDefinition("_moc_incs", _moc_incs!=0 ? _moc_incs : ""); - makefile->AddDefinition("_moc_defs", _moc_defs!=0 ? _moc_defs : ""); - makefile->AddDefinition("_moc_compile_defs", - _moc_compile_defs!=0 ? _moc_compile_defs : ""); + 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_files", _moc_files.c_str()); makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); |