GLOB or regex in source
-
I would like to add all the files from the directory. I did it this way.
SOURCES += ./source/*
I also tried so source/* , source*, .\source*
But this does not work, an error occurs$ qmake.exe ..
WARNING: Failure to find: source\*
WARNING: Failure to find: source\*What am I doing wrong?
-
Hi
Normally itsSOURCES += *.cpp HEADERS += *.h so maybe SOURCES += source/*.cpp HEADERS += source/*.h
Update: Nope. This works.
SOURCES += $$PWD$$/source/*.cpp HEADERS += $$PWD$$/source/*.h
Note that it will complain if it dont find at least one cpp and .h
-
I would like to add all the files from the directory. I did it this way.
SOURCES += ./source/*
I also tried so source/* , source*, .\source*
But this does not work, an error occurs$ qmake.exe ..
WARNING: Failure to find: source\*
WARNING: Failure to find: source\*What am I doing wrong?
@danyal said in GLOB or regex in source:
$ qmake.exe ..
Are you calling
qmake
from a subdir? What happens if you call it from the directory the.pro
file is in? -
Hi
Normally itsSOURCES += *.cpp HEADERS += *.h so maybe SOURCES += source/*.cpp HEADERS += source/*.h
Update: Nope. This works.
SOURCES += $$PWD$$/source/*.cpp HEADERS += $$PWD$$/source/*.h
Note that it will complain if it dont find at least one cpp and .h
-
Hi
Just testedSOURCES += $$PWD$$/source/*.cpp HEADERS += $$PWD$$/source/*.h
and files was found and included.
Note that it will complain if it dont find at least one cpp and 1 .h
Also this assumes that source is a subfolder to the folder where .pro is. -
Hi
Just testedSOURCES += $$PWD$$/source/*.cpp HEADERS += $$PWD$$/source/*.h
and files was found and included.
Note that it will complain if it dont find at least one cpp and 1 .h
Also this assumes that source is a subfolder to the folder where .pro is. -
@danyal said in GLOB or regex in source:
$ qmake.exe ..
Are you calling
qmake
from a subdir? What happens if you call it from the directory the.pro
file is in? -