summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-10-02 12:01:02 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-10-02 12:01:21 (GMT)
commit275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5 (patch)
tree1863a4e43cd68b578996eade2522c55c0d90e0e9 /Source
parent9288c291cb56f75ad0ed8a86b0882d1998c8b79d (diff)
parent6bbc1e775d46cbe1ad97ecea0862d030680b332a (diff)
downloadCMake-275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5.zip
CMake-275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5.tar.gz
CMake-275b4a53eef8d10af069fbcb0d1d9bc4d0b5f6d5.tar.bz2
Merge topic 'autogen-predefs'
6bbc1e77 Autogen: Add release notes for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES 75c98b5e Autogen: Doc: Add documentation for (CMAKE_)AUTOMOC_COMPILER_PREDEFINES 1d7f099d Autogen: Add (CMAKE_)AUTOMOC_COMPILER_PREDEFINES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1328
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx13
-rw-r--r--Source/cmTarget.cxx1
2 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index c6f0a51..217865b 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -363,11 +363,14 @@ static void SetupAutoTargetMoc(cmQtAutoGenDigest const& digest,
AddDefinitionEscaped(makefile, "_moc_depend_filters",
GetSafeProperty(target, "AUTOMOC_DEPEND_FILTERS"));
- if (QtVersionGreaterOrEqual(digest.QtVersionMajor, digest.QtVersionMinor, 5,
- 8)) {
- AddDefinitionEscaped(
- makefile, "_moc_predefs_cmd",
- makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_PREDEFINES_COMMAND"));
+ // Compiler predefines
+ if (target->GetPropertyAsBool("AUTOMOC_COMPILER_PREDEFINES")) {
+ if (QtVersionGreaterOrEqual(digest.QtVersionMajor, digest.QtVersionMinor,
+ 5, 8)) {
+ AddDefinitionEscaped(
+ makefile, "_moc_predefs_cmd",
+ makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_PREDEFINES_COMMAND"));
+ }
}
// Moc includes and compile definitions
{
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 49b0664..7a3cc76 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -244,6 +244,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("AUTOMOC", nullptr);
this->SetPropertyDefault("AUTOUIC", nullptr);
this->SetPropertyDefault("AUTORCC", nullptr);
+ this->SetPropertyDefault("AUTOMOC_COMPILER_PREDEFINES", nullptr);
this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr);
this->SetPropertyDefault("AUTOMOC_MACRO_NAMES", nullptr);
this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", nullptr);