Friday, May 18, 2012

How to evaluate variables in project (.pro) files


If you need to evaluate a variable inside a project file (.pro) the variable must be enclosed in curly braces.
So let's say we want to create translation files based on the name of the target, it's just simple as:


TRANSLATIONS += translations/$${TARGET}_en.ts \
     translations/$${TARGET}_es.ts \
     translations/$${TARGET}_de.ts \
     translations/$${TARGET}_fr.ts \
     translations/$${TARGET}_pt.ts

No comments:

Post a Comment