[CMake] How to add project files?

rleigh at codelibre.net rleigh at codelibre.net
Fri Jul 14 06:16:58 EDT 2017


On 2017-07-14 03:33, Florian Lindner wrote:
> Now, in the docs I everywhere read not to add the files using GLOB.
> However, I have found no definitive guide how to add
> project files in a large project with subdirs like that.
> 
> How would you do it in cmakeish fashion?

List each file explicitly.  For example, see 
https://github.com/apache/xerces-c/blob/trunk/src/CMakeLists.txt

No potential for inclusion of a stray file which gets globbed 
unintentionally, and any change to the lists will force cmake to be 
re-run, and the targets rebuilt.


Regards,
Roger



More information about the CMake mailing list