summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutomoc.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-08-27 20:08:54 (GMT)
committerAlex Neundorf <neundorf@kde.org>2012-09-05 19:49:44 (GMT)
commit825d1abf14f8ad880c7e2b3207881b06c43385a6 (patch)
treef1d7c1a3fcc401c0be95878755dbf5679baf2f0e /Source/cmQtAutomoc.cxx
parentb001b6e129134e88dc958cecbcd4c326e8daf36a (diff)
downloadCMake-825d1abf14f8ad880c7e2b3207881b06c43385a6.zip
CMake-825d1abf14f8ad880c7e2b3207881b06c43385a6.tar.gz
CMake-825d1abf14f8ad880c7e2b3207881b06c43385a6.tar.bz2
Automoc: fix #13493, use target properties for include dirs
Alex
Diffstat (limited to 'Source/cmQtAutomoc.cxx')
-rw-r--r--Source/cmQtAutomoc.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 71feffd..a5ae4c0 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -111,6 +111,7 @@ cmQtAutomoc::cmQtAutomoc()
void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
{
cmMakefile* makefile = target->GetMakefile();
+ cmLocalGenerator* localGen = makefile->GetLocalGenerator();
const char* targetName = target->GetName();
// don't do anything if there is no Qt4 or Qt5Core (which contains moc):
std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
@@ -193,11 +194,22 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
}
}
- const char* tmp = makefile->GetProperty("INCLUDE_DIRECTORIES");
- std::string _moc_incs = (tmp!=0 ? tmp : "");
- tmp = makefile->GetProperty("DEFINITIONS");
+ std::vector<std::string> includeDirs = target->GetIncludeDirectories();
+ localGen->GetIncludeDirectories(includeDirs, target, "CXX");
+ std::string _moc_incs = "";
+ const char* sep = "";
+ for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
+ incDirIt != includeDirs.end();
+ ++incDirIt)
+ {
+ _moc_incs += sep;
+ sep = ";";
+ _moc_incs += *incDirIt;
+ }
+
+ const char* tmp = makefile->GetProperty("DEFINITIONS");
std::string _moc_defs = (tmp!=0 ? tmp : "");
- tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
+ tmp = target->GetProperty("COMPILE_DEFINITIONS");
std::string _moc_compile_defs = (tmp!=0 ? tmp : "");
tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
std::string _moc_options = (tmp!=0 ? tmp : "");