summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2010-02-04 10:18:47 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2010-02-04 11:54:24 (GMT)
commit1ef9b16f76b3ec2e8e12911777387a723185e518 (patch)
treed0a7734fc075d05c54e652186f5ffd60b90e267f /qmake/generators
parent818ef4e93f40f2c3c6cf9d2a0a1fc42150f0d0cd (diff)
downloadQt-1ef9b16f76b3ec2e8e12911777387a723185e518.zip
Qt-1ef9b16f76b3ec2e8e12911777387a723185e518.tar.gz
Qt-1ef9b16f76b3ec2e8e12911777387a723185e518.tar.bz2
Add the QMAKE_FILE_EXT variable to extra compilers generation.
This give the possibility to get the file name with the extension and without the path. Reviewed-by: Joao Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/makefile.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 0f5bdcd..cb68e7c 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1519,6 +1519,19 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const
base = fi.fileName();
val += base;
}
+ } else if(var == QLatin1String("QMAKE_FILE_EXT")) {
+ filePath = true;
+ for(int i = 0; i < in.size(); ++i) {
+ QFileInfo fi(fileInfo(Option::fixPathToLocalOS(in.at(i))));
+ QString ext;
+ // Ensure complementarity with QMAKE_FILE_BASE
+ int baseLen = fi.completeBaseName().length();
+ if(baseLen == 0)
+ ext = fi.fileName();
+ else
+ ext = fi.fileName().remove(0, baseLen);
+ val += ext;
+ }
} else if(var == QLatin1String("QMAKE_FILE_PATH") || var == QLatin1String("QMAKE_FILE_IN_PATH")) {
filePath = true;
for(int i = 0; i < in.size(); ++i)