Skip to content

Commit

Permalink
Qt modules on Mac: add framework include paths
Browse files Browse the repository at this point in the history
This is needed to let moc know about Q_OS_MAC and friends.

Change-Id: I0c71e8a95b32dd34f47eaec857c3ffd455cd5eef
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
  • Loading branch information
Joerg Bornemann committed Mar 16, 2012
1 parent 8855fcc commit edf8d30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
7 changes: 6 additions & 1 deletion share/qbs/modules/qt/QtModule.qbs
Expand Up @@ -18,7 +18,12 @@ Module {

Properties {
condition: qtModuleName != undefined
cpp.includePaths: [incPath + '/' + internalQtModuleName]
cpp.includePaths: {
var paths = [incPath + '/' + internalQtModuleName];
if (qbs.targetOS === "mac")
paths.unshift(libPath + '/' + internalQtModuleName + qtLibInfix + '.framework/Versions/' + qtcore.versionMajor + '/Headers');
return paths;
}
cpp.dynamicLibraries: qbs.targetOS !== 'mac' ? [internalLibraryName] : undefined
cpp.frameworks: qbs.targetOS === 'mac' ? [internalLibraryName] : undefined
cpp.defines: [ "QT_" + qtModuleName.toUpperCase() + "_LIB" ]
Expand Down
15 changes: 9 additions & 6 deletions share/qbs/modules/qt/core/qtcore.qbs
Expand Up @@ -28,12 +28,15 @@ Module {
return undefined;
return ["QT_NAMESPACE=" + qtNamespace]
}
cpp.includePaths: [
mkspecsPath + '/default',
incPath + '/QtCore',
incPath,
product.buildDirectory + '/' + generatedFilesDir
]
cpp.includePaths: {
var paths = [mkspecsPath + '/default'];
if (qbs.targetOS === "mac")
paths.push(libPath + '/QtCore' + qtLibInfix + '.framework/Versions/' + versionMajor + '/Headers');
paths.push(incPath + '/QtCore');
paths.push(incPath);
paths.push(product.buildDirectory + '/' + generatedFilesDir);
return paths;
}
cpp.libraryPaths: [libPath]
cpp.dynamicLibraries: qbs.targetOS !== 'mac' ? [QtFunctions.getLibraryName('QtCore' + qtLibInfix, versionMajor, qbs.targetOS, cpp.debugInformation)] : undefined
cpp.frameworkPaths: qbs.targetOS === 'mac' ? [libPath] : undefined
Expand Down

0 comments on commit edf8d30

Please sign in to comment.