Add documentation for AUTOMOC, add initialization via CMAKE_AUTOMOC

Alex
This commit is contained in:
Alex Neundorf 2011-08-16 22:05:33 +02:00
parent bf8ef778a3
commit 77a5c6e0d8
2 changed files with 33 additions and 1 deletions

View File

@ -1084,6 +1084,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
false, false,
"Variables that Control the Build"); "Variables that Control the Build");
cm->DefineProperty
("CMAKE_AUTOMOC", cmProperty::VARIABLE,
"Whether to handle moc automatically for Qt targets.",
"This variable is used to initialize the "
"AUTOMOC property on all the targets. "
"See that target property for additional information.",
false,
"Variables that Control the Build");
cm->DefineProperty cm->DefineProperty
("CMAKE_DEBUG_POSTFIX", cmProperty::VARIABLE, ("CMAKE_DEBUG_POSTFIX", cmProperty::VARIABLE,
"See variable CMAKE_<CONFIG>_POSTFIX.", "See variable CMAKE_<CONFIG>_POSTFIX.",

View File

@ -114,6 +114,28 @@ cmTarget::cmTarget()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::DefineProperties(cmake *cm) void cmTarget::DefineProperties(cmake *cm)
{ {
cm->DefineProperty
("AUTOMOC", cmProperty::TARGET,
"Should the target be processed with automoc (for Qt projects).",
"AUTOMOC is a boolean specifying whether CMake will handle "
"the Qt moc preprocessor automatically, i.e. without having to use "
"the QT4_WRAP_CPP() macro. Currently Qt4 is supported. "
"When this property is set to TRUE, CMake will scan the source files "
"at build time and invoke moc accordingly. "
"If an #include statement like #include \"moc_foo.cpp\" is found, "
"the Q_OBJECT class declaration is expected in the header, and moc is "
"run on the header file. "
"If an #include statement like #include \"foo.moc\" is found, "
"then a Q_OBJECT is expected in the current source file and moc "
"is run on the file itself. "
"Additionally, all header files are parsed for Q_OBJECT macros, "
"and if found, moc is also executed on those files. The resulting "
"moc files, which are not included as shown above in any of the source "
"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.");
cm->DefineProperty cm->DefineProperty
("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET, ("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET,
"Should build tree targets have install tree rpaths.", "Should build tree targets have install tree rpaths.",
@ -1118,6 +1140,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0); this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0); this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("OSX_ARCHITECTURES", 0); this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
this->SetPropertyDefault("AUTOMOC", 0);
// Collect the set of configuration types. // Collect the set of configuration types.
std::vector<std::string> configNames; std::vector<std::string> configNames;