summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-29 12:52:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-29 12:53:13 (GMT)
commit194dd9ea8b6fb8b73aa6484551e87bb7676015cc (patch)
tree56fae753a54c2f8faedf8d87d4c48bcbef244a13 /Source
parent460a94e29f19846bc219f8f8a02cddb196472be9 (diff)
parent93c8d55d049cacaa884d71b6c3177ce3757ab817 (diff)
downloadCMake-194dd9ea8b6fb8b73aa6484551e87bb7676015cc.zip
CMake-194dd9ea8b6fb8b73aa6484551e87bb7676015cc.tar.gz
CMake-194dd9ea8b6fb8b73aa6484551e87bb7676015cc.tar.bz2
Merge topic 'autogen-macro-names2'
93c8d55d Autogen: Update (CMAKE_)AUTOMOC_MACRO_NAMES release notes 084ace47 Autogen: Tests: Update AUTOMOC_MACRO_NAMES test 08041dd1 Autogen: Doc: Update documentation for (CMAKE_)AUTOMOC_MACRO_NAMES 7b33d67b Autogen: Create info file directory before writing 786b5be0 Autogen: Define all macro names in CMAKE_AUTOMOC_MACRO_NAMES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1321
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx15
-rw-r--r--Source/cmQtAutoGenerators.cxx8
2 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 1ce350f..c6f0a51 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -613,6 +613,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
cmGlobalGenerator* globalGen = localGen->GetGlobalGenerator();
std::string const autogenTargetName = GetAutogenTargetName(target);
+ std::string const autogenInfoDir = GetAutogenTargetFilesDir(target);
std::string const autogenBuildDir = GetAutogenTargetBuildDir(target);
std::string const workingDirectory =
cmSystemTools::CollapseFullPath("", makefile->GetCurrentBinaryDirectory());
@@ -630,8 +631,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
AddCleanFile(makefile, autogenBuildDir);
// Remove old settings on cleanup
{
- std::string base = GetAutogenTargetFilesDir(target);
- base += "/AutogenOldSettings";
+ std::string base = autogenInfoDir + "/AutogenOldSettings";
if (multiConfig == cmQtAutoGen::SINGLE) {
AddCleanFile(makefile, base.append(".cmake"));
} else {
@@ -652,7 +652,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
currentLine.push_back(cmSystemTools::GetCMakeCommand());
currentLine.push_back("-E");
currentLine.push_back("cmake_autogen");
- currentLine.push_back(GetAutogenTargetFilesDir(target));
+ currentLine.push_back(autogenInfoDir);
currentLine.push_back("$<CONFIGURATION>");
commandLines.push_back(currentLine);
}
@@ -1097,8 +1097,13 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
// Generate info file
{
- std::string infoFile = GetAutogenTargetFilesDir(target);
- infoFile += "/AutogenInfo.cmake";
+ std::string const infoDir = GetAutogenTargetFilesDir(target);
+ if (!cmSystemTools::MakeDirectory(infoDir)) {
+ std::string emsg = ("Could not create directory: ");
+ emsg += cmQtAutoGen::Quoted(infoDir);
+ cmSystemTools::Error(emsg.c_str());
+ }
+ std::string const infoFile = infoDir + "/AutogenInfo.cmake";
{
std::string infoFileIn = cmSystemTools::GetCMakeRoot();
infoFileIn += "/Modules/AutogenInfo.cmake.in";
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index bd0fb9a..f13312f 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -149,12 +149,6 @@ cmQtAutoGenerators::cmQtAutoGenerators()
}
}
- // Moc macro filters
- this->MocMacroFilters.emplace_back(
- "Q_OBJECT", "[\n][ \t]*{?[ \t]*Q_OBJECT[^a-zA-Z0-9_]");
- this->MocMacroFilters.emplace_back(
- "Q_GADGET", "[\n][ \t]*{?[ \t]*Q_GADGET[^a-zA-Z0-9_]");
-
// Precompile regular expressions
this->MocRegExpInclude.compile(
"[\n][ \t]*#[ \t]*include[ \t]+"
@@ -326,7 +320,7 @@ bool cmQtAutoGenerators::InitInfoFile(cmMakefile* makefile,
InfoGetList("AM_MOC_MACRO_NAMES");
for (std::string const& item : MocMacroNames) {
this->MocMacroFilters.emplace_back(
- item, ("[^a-zA-Z0-9_]" + item).append("[^a-zA-Z0-9_]"));
+ item, ("[\n][ \t]*{?[ \t]*" + item).append("[^a-zA-Z0-9_]"));
}
}
{