summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-08-09 07:18:37 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-08-14 13:58:00 (GMT)
commit126c6ead7707ac29f3b2fa779752025c7cc0da32 (patch)
tree04480eb055d4baf3a9631c8ce8fbabbb02145012 /Source/cmAddExecutableCommand.cxx
parentde91feb367c127294a56b492799c4bf042954fd8 (diff)
downloadCMake-126c6ead7707ac29f3b2fa779752025c7cc0da32.zip
CMake-126c6ead7707ac29f3b2fa779752025c7cc0da32.tar.gz
CMake-126c6ead7707ac29f3b2fa779752025c7cc0da32.tar.bz2
Add the cmake module required currently for automoc
Alex
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;
}