summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-08-25 19:40:29 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-08-25 19:40:29 (GMT)
commit39f0fa725e71c62eda5a039aba2098bef348bb9b (patch)
tree43a63dbac32767c446a31764d2317b9c66772b00 /Source/cmTarget.cxx
parent50b64fb0121d8f0ce5302486276c4a3b604e42b1 (diff)
parent920a046015799a14374e5c69072aa14f2723fda0 (diff)
downloadCMake-39f0fa725e71c62eda5a039aba2098bef348bb9b.zip
CMake-39f0fa725e71c62eda5a039aba2098bef348bb9b.tar.gz
CMake-39f0fa725e71c62eda5a039aba2098bef348bb9b.tar.bz2
Merge topic 'AutomocForQt'
920a046 QtAutomoc: Eliminate compiler warning b00463f QtAutomoc test: Pass QT_QMAKE_EXECUTABLE e78ce44 Fix automoc with VS builds: apply patch from Bill 71165e9 Silence warning in automoc: use long instead of int 1879bcc Fix build: use std::ios::out|ios::trunc instead of std::ios_base::out 678e124 Only enable the automoc test after checking that Qt4 works 71c29d1 Fix bootstrap test with automoc afb3edc Fix warnings add30e9 Fix build: non-void function must return a value 7e6d845 Automoc.cmake is not needed anymore 2963d0b Fix logic which decides when to execute automoc test 77a5c6e Add documentation for AUTOMOC, add initialization via CMAKE_AUTOMOC bf8ef77 Add a test for automoc d045fd4 Nicer progress message for the automoc target 50cd6ce Move automoc processing from add_executable/library to cmGlobalGenerator cbaac2a Remove trailing whitespace c27607b Refactor SetupAutomocTarget() so it can be run after creating the target 24d9b7d Remove trailing whitespace 58b7fe6 Use cout instead of printf() 72caf4d Add the generated automoc.cpp file to the cleaned files ddb517d Color output when running moc 9303295 Initialize verbose based onb the env.var. ace1215 Move code for parsing a cpp-file from the big loop to separate function 735a5bb Fix line lengths 83b730c Add AUTOMOC to the add_library() command 126c6ea Add the cmake module required currently for automoc de91feb Remove the need to check for .h/.cxx during buildtime d65689a Add actual automoc code from automoc d1c0a5f Start implementing skeleton for automoc in cmake a65011b Start work on automoc: add empty cmQtAutomoc class
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 17a26cc..4969b65 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -115,6 +115,28 @@ cmTarget::cmTarget()
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
("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET,
"Should build tree targets have install tree rpaths.",
"BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link "
@@ -1118,6 +1140,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
+ this->SetPropertyDefault("AUTOMOC", 0);
// Collect the set of configuration types.
std::vector<std::string> configNames;
@@ -1420,7 +1443,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
// the fact that the name matched a target was just a coincidence.
if(cmSystemTools::FileIsFullPath(dep.c_str()))
{
- if(t->GetType() >= cmTarget::EXECUTABLE &&
+ if(t->GetType() >= cmTarget::EXECUTABLE &&
t->GetType() <= cmTarget::MODULE_LIBRARY)
{
// This is really only for compatibility so we do not need to