diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-02-04 10:18:47 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-02-04 11:44:05 (GMT) |
commit | 4c8b2aa00acc00a95b6f950a4ab7de737631e494 (patch) | |
tree | 8662477291e418fb4652a94cfdb88e7f121835ef /qmake/generators | |
parent | 26b696f9333147218bb7dca0abdf0e5f321763f9 (diff) | |
download | Qt-4c8b2aa00acc00a95b6f950a4ab7de737631e494.zip Qt-4c8b2aa00acc00a95b6f950a4ab7de737631e494.tar.gz Qt-4c8b2aa00acc00a95b6f950a4ab7de737631e494.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.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 69e1d8a..db2737b 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1513,6 +1513,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) |