

But what I'm doing is already highly automated and this will greatly simplify the workflow without requiring the use of a meta-meta-buildsystem that I'd otherwise have to use or make (or require manual alterations to the buildsystem files every time an addition is made. My understanding as to why is because unlike simple buildsystems such as Tup, CMake has the limitation of being a meta-buildsystem: the buildfiles are only aware of modifications to tracked files and can't trigger automatic CMake regeneration upon file/folder additions, etc. I'm aware that GLOB is discouraged and is bad practice.

Any or suggestions help would be greatly appreciated.
#Cmake glob pattern how to#
So far I've figured out that I probably want to begin with file(GLOB V_GLOB LIST_DIRECTORIES true "*")īut I'm not quite sure how to filter out the non-directory files and then format it in a way that is acceptable for add_subdirectory. You probably take this option from file (COPYINSTALL.

I figured that I should ask here instead. In computer programming, glob ( / lb /) patterns specify sets of filenames with wildcard characters.
#Cmake glob pattern code#
New to C++? Learn at READ BEFORE POSTINGīefore you post, please read our sticky on proper code formatting. For general discussion and news about c++ see r/cpp. For other path manipulation, handling only syntactic aspects, have a. I'd still rather use an existing feature of the generally20 release CMake if it were reasonably similar. This is a subreddit for c++ questions with answers. This command is dedicated to file and path manipulation requiring access to the filesystem. Since Glob assembles the filenames without any path information in a single string (with semicolons between filenames), I expand the string to a vector, and assemble a new string in which I've inserted the path in front of each filename.
