Reputation: 1344
My editor always generates temp files like #foo.cpp
or ~bar.cpp
.
How to exclude these files from my glob?
file(GLOB_RECURSE SRC_CPP ${PROJECT_SOURCE_DIR} src/*.cpp src/*.cxx)
Upvotes: 2
Views: 538
Reputation: 2237
You can specify which characters a file should start with:
file(GLOB FILES [a-z]*.cpp)
This will match only files starting with a-z. If you have files starting with other characters like underscore just add it to the expression:
file(GLOB FILES [_a-z]*.cpp)
Upvotes: 1