Glob for .h/.cpp files in qmake file

This commit is contained in:
miruka 2020-07-16 13:50:06 -04:00
parent 292d88a9bf
commit cc8d552adc

View File

@ -1,3 +1,15 @@
# Custom functions
defineReplace(glob_filenames) {
for(pattern, ARGS) {
results *= $$files(src/$${pattern}, true)
}
return($$results)
}
# Base configuration
# widgets: Make native file dialogs available to QML (must use QApplication)
QT = quick quickcontrols2 widgets
DEFINES += QT_DEPRECATED_WARNINGS
@ -12,8 +24,8 @@ RCC_DIR = $$BUILD_DIR/rcc
QRC_FILE = $$BUILD_DIR/resources.qrc
RESOURCES += $$QRC_FILE
HEADERS += src/utils.h src/clipboard.h submodules/hsluv-c/src/hsluv.h
SOURCES += src/main.cpp submodules/hsluv-c/src/hsluv.c
HEADERS += $$glob_filenames(*.h) submodules/hsluv-c/src/hsluv.h
SOURCES += $$glob_filenames(*.cpp) submodules/hsluv-c/src/hsluv.c
TARGET = mirage
unix:!macx {
@ -58,16 +70,6 @@ dev {
}
# Custom functions
defineReplace(glob_filenames) {
for(pattern, ARGS) {
results *= $$files(src/$${pattern}, true)
}
return($$results)
}
# Generate resource file
RESOURCE_FILES *= $$glob_filenames(qmldir, *.qml, *.qpl, *.js, *.py)