diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index 79a2a9c6bb4..acfaf78ada7 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -77,7 +77,7 @@ enum ExpandFunc { E_FIND, E_SYSTEM, E_UNIQUE, E_REVERSE, E_QUOTE, E_ESCAPE_EXPAND, E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE, E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS, - E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH + E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH }; enum TestFunc { @@ -127,6 +127,7 @@ void QMakeEvaluator::initFunctionStatics() { "shadowed", E_SHADOWED }, { "absolute_path", E_ABSOLUTE_PATH }, { "relative_path", E_RELATIVE_PATH }, + { "clean_path", E_CLEAN_PATH }, }; for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i) statics.expands.insert(ProString(expandInits[i].name), expandInits[i].func); @@ -854,6 +855,13 @@ ProStringList QMakeEvaluator::evaluateExpandFunction( QDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory()) .relativeFilePath(args.at(0).toQString(m_tmp1))), NoHash).setSource(args.at(0)); break; + case E_CLEAN_PATH: + if (args.count() != 1) + evalError(fL1S("clean_path(path) requires one argument.")); + else + ret << ProString(QDir::cleanPath(args.at(0).toQString(m_tmp1)), + NoHash).setSource(args.at(0)); + break; case E_INVALID: evalError(fL1S("'%1' is not a recognized replace function.") .arg(func.toQString(m_tmp1)));