Details
-
Suggestion
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
6.5
-
None
Description
$$files(..) is extremely useful when you work with git and you don't want merge issues each time a file is added to the project.
But when you add assets, you have to be sure that the extension of the file match with the project file. But if you have a lot of assets and the extension have uppercase, you don't want to rename each files.
Luckily it was images and the extension was full uppercase so this work.
FORMATS_SOURCES = .c .cpp for(FORMAT, FORMATS_SOURCES) { SOURCES += $$files(*$$FORMAT, true) SOURCES += $$files(*$$upper($$FORMAT), true) SOURCES += $$files(*$$lower($$FORMAT), true) } SOURCES = $$unique(SOURCES) FORMATS_HEADERS = .h .hpp for(FORMAT, FORMATS_HEADERS) { HEADERS += $$files(*$$FORMAT, true) HEADERS += $$files(*$$upper($$FORMAT), true) HEADERS += $$files(*$$lower($$FORMAT), true) } HEADERS = $$unique(HEADERS) FORMATS = .png .jpg .jpeg .svg FORMATS += .qml .js qmldir for(FORMAT, FORMATS) { resources.files += $$files(*$$FORMAT, true) resources.files += $$files(*$$upper($$FORMAT), true) resources.files += $$files(*$$lower($$FORMAT), true) } resources.files = $$unique(resources.files) #resources.prefix = / RESOURCES += resources
But it's a bit ugly and it doesn't take every possible case into account.