arrowd
arrowd

Reputation: 34401

Does file(GLOB ...) search directory on every cmake invocation?

When file(GLOB ...) is called, CMake applies regex to all files it can find. The question is whether it's done only on first cmake invocation, or every time?

In other words, does use of file(GLOB ...) slows down Makefiles regenration process? The same question can be applied to file(GLOB_RECURSE ...).

Upvotes: 1

Views: 463

Answers (1)

Dietrich Epp
Dietrich Epp

Reputation: 213328

It's done every time (the results might be different, naturally).

Don't worry about it slowing you down. Build systems have to do a stat (or equivalent) on tens, hundreds, or thousands of files every invocation and a glob or two won't even show up as a blip.

Upvotes: 1

Related Questions