[Cmake-commits] CMake branch, next, updated. v2.8.6-1757-gb447c1d

Alexander Neundorf neundorf at kde.org
Tue Nov 1 14:57:11 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  b447c1d1dbdd3b6adebae779eedf0ca4fbde329b (commit)
       via  2c648ab7e204540a8a669b597cc7d3510c84647e (commit)
       via  52719a1d66db0bbdb17019bcb2ea5ab0a1258e22 (commit)
      from  d4621bdb308056f286a445fd01444b1cf8638119 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b447c1d1dbdd3b6adebae779eedf0ca4fbde329b
commit b447c1d1dbdd3b6adebae779eedf0ca4fbde329b
Merge: d4621bd 2c648ab
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Tue Nov 1 14:57:04 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 1 14:57:04 2011 -0400

    Merge topic 'AddMocOptionsToAutomoc' into next
    
    2c648ab add documentation for the AUTOMOC_MOC_OPTIONS property
    52719a1 automoc: fix #12541, support moc options


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c648ab7e204540a8a669b597cc7d3510c84647e
commit 2c648ab7e204540a8a669b597cc7d3510c84647e
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Tue Nov 1 19:54:04 2011 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Tue Nov 1 19:54:04 2011 +0100

    add documentation for the AUTOMOC_MOC_OPTIONS property
    
    Alex

diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index f4d4e7c..a759a82 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1103,6 +1103,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "Variables that Control the Build");
 
   cm->DefineProperty
+    ("CMAKE_AUTOMOC_MOC_OPTIONS", cmProperty::VARIABLE,
+     "Additional options for moc when using automoc (see CMAKE_AUTOMOC).",
+     "This variable is used to initialize the "
+     "AUTOMOC_MOC_OPTIONS property on all the targets. "
+     "See that target property for additional information.",
+     false,
+     "Variables that Control the Build");
+
+  cm->DefineProperty
     ("CMAKE_DEBUG_POSTFIX", cmProperty::VARIABLE,
      "See variable CMAKE_<CONFIG>_POSTFIX.",
      "This variable is a special case of the more-general "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e8064d0..d669a5b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -157,7 +157,20 @@ void cmTarget::DefineProperties(cmake *cm)
      "files are included in a generated <targetname>_automoc.cpp file, "
      "which is compiled as part of the target."
      "This property is initialized by the value of the variable "
-     "CMAKE_AUTOMOC if it is set when a target is created.");
+     "CMAKE_AUTOMOC if it is set when a target is created.\n"
+     "Additional command line options for moc can be set via the "
+     "AUTOMOC_MOC_OPTIONS property."
+    );
+
+  cm->DefineProperty
+    ("AUTOMOC_MOC_OPTIONS", cmProperty::TARGET,
+    "Additional options for moc when using automoc (see the AUTOMOC property)",
+     "This property is only used if the AUTOMOC property is set to TRUE for "
+     "this target. In this case, it holds additional command line options "
+     "which will be used when moc is executed during the build, i.e. it is "
+     "equivalent to the optional OPTIONS argument of the qt4_wrap_cpp() "
+     "macro.\n"
+     "By default it is empty.");
 
   cm->DefineProperty
     ("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52719a1d66db0bbdb17019bcb2ea5ab0a1258e22
commit 52719a1d66db0bbdb17019bcb2ea5ab0a1258e22
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Tue Nov 1 14:33:11 2011 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Tue Nov 1 14:33:11 2011 +0100

    automoc: fix #12541, support moc options
    
    This commit adds a new target property AUTOMOC_MOC_OPTIONS, which
    can be set to add extra options for the moc invocations done via automoc.
    This is equivalent to the OPTIONS parameter in the qt4_wrap_cpp() macro.
    
    Alex

diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in
index 2dc3aa2..9c71952 100644
--- a/Modules/AutomocInfo.cmake.in
+++ b/Modules/AutomocInfo.cmake.in
@@ -3,6 +3,7 @@ set(AM_HEADERS "@_moc_headers@" )
 set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@")
 set(AM_MOC_DEFINITIONS "@_moc_defs@")
 set(AM_MOC_INCLUDES "@_moc_incs@")
+set(AM_MOC_OPTIONS "@_moc_options@")
 set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
 set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
 set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index e9cc9d1..eb89c90 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -130,6 +130,8 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   std::string _moc_defs = (tmp!=0 ? tmp : "");
   tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
   std::string _moc_compile_defs = (tmp!=0 ? tmp : "");
+  tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
+  std::string _moc_options = (tmp!=0 ? tmp : "");
 
   // forget the variables added here afterwards again:
   cmMakefile::ScopePushPop varScope(makefile);
@@ -139,6 +141,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   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());
 
@@ -230,6 +233,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
                                                  "AM_MOC_COMPILE_DEFINITIONS");
   this->MocDefinitionsStr = makefile->GetSafeDefinition("AM_MOC_DEFINITIONS");
   this->MocIncludesStr = makefile->GetSafeDefinition("AM_MOC_INCLUDES");
+  this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS");
   this->ProjectBinaryDir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR");
   this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR");
   this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME");
@@ -306,6 +310,8 @@ void cmQtAutomoc::Init()
       }
     }
 
+  cmSystemTools::ExpandListArgument(this->MocOptionsStr, this->MocOptions);
+
   std::vector<std::string> incPaths;
   cmSystemTools::ExpandListArgument(this->MocIncludesStr, incPaths);
 
@@ -715,6 +721,12 @@ bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile,
       {
       command.push_back(*it);
       }
+    for(std::vector<std::string>::const_iterator it=this->MocOptions.begin();
+        it != this->MocOptions.end();
+        ++it)
+      {
+      command.push_back(*it);
+      }
 #ifdef _WIN32
     command.push_back("-DWIN32");
 #endif
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h
index c3550a4..db53b21 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutomoc.h
@@ -62,6 +62,7 @@ private:
   std::string MocCompileDefinitionsStr;
   std::string MocDefinitionsStr;
   std::string MocIncludesStr;
+  std::string MocOptionsStr;
   std::string ProjectBinaryDir;
   std::string ProjectSourceDir;
   std::string TargetName;
@@ -71,6 +72,7 @@ private:
   std::string OutMocCppFilename;
   std::list<std::string> MocIncludes;
   std::list<std::string> MocDefinitions;
+  std::vector<std::string> MocOptions;
 
   bool Verbose;
   bool ColorOutput;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f7d3ba9..e8064d0 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1179,6 +1179,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
   this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
   this->SetPropertyDefault("AUTOMOC", 0);
+  this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0);
   this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0);
 
   // Collect the set of configuration types.

-----------------------------------------------------------------------

Summary of changes:
 Modules/AutomocInfo.cmake.in   |    1 +
 Source/cmDocumentVariables.cxx |    9 +++++++++
 Source/cmQtAutomoc.cxx         |   12 ++++++++++++
 Source/cmQtAutomoc.h           |    2 ++
 Source/cmTarget.cxx            |   16 +++++++++++++++-
 5 files changed, 39 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list