summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmAddExecutableCommand.cxx')
-rw-r--r--Source/cmAddExecutableCommand.cxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index a625c47..9710d20 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -10,6 +10,7 @@
See the License for more information.
============================================================================*/
#include "cmAddExecutableCommand.h"
+#include "cmQtAutomoc.h"
// cmExecutableCommand
bool cmAddExecutableCommand
@@ -29,6 +30,7 @@ bool cmAddExecutableCommand
bool use_macbundle = false;
bool excludeFromAll = false;
bool importTarget = false;
+ bool doAutomoc = false;
while ( s != args.end() )
{
if (*s == "WIN32")
@@ -41,6 +43,11 @@ bool cmAddExecutableCommand
++s;
use_macbundle = true;
}
+ else if ( *s == "AUTOMOC" )
+ {
+ ++s;
+ doAutomoc = true;
+ }
else if(*s == "EXCLUDE_FROM_ALL")
{
++s;
@@ -58,12 +65,18 @@ bool cmAddExecutableCommand
}
// Special modifiers are not allowed with IMPORTED signature.
- if(importTarget && (use_win32 || use_macbundle || excludeFromAll))
+ if(importTarget
+ && (use_win32 || use_macbundle || excludeFromAll || doAutomoc))
{
if(use_win32)
{
this->SetError("may not be given WIN32 for an IMPORTED target.");
}
+ else if(doAutomoc)
+ {
+ this->SetError(
+ "may not be given AUTOMOC for an IMPORTED target.");
+ }
else if(use_macbundle)
{
this->SetError(
@@ -113,6 +126,14 @@ bool cmAddExecutableCommand
}
std::vector<std::string> srclists(s, args.end());
+ cmQtAutomoc* automoc = 0;
+ if ( doAutomoc )
+ {
+ automoc = new cmQtAutomoc;
+ automoc->SetupAutomocTarget(this->Makefile, exename.c_str(), srclists);
+ }
+
+
cmTarget* tgt = this->Makefile->AddExecutable(exename.c_str(), srclists,
excludeFromAll);
if ( use_win32 )
@@ -124,5 +145,12 @@ bool cmAddExecutableCommand
tgt->SetProperty("MACOSX_BUNDLE", "ON");
}
+ if ( automoc )
+ {
+ automoc->AddTargetDependency(this->Makefile, tgt);
+ delete automoc;
+ automoc = 0;
+ }
+
return true;
}