Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically detect newly added source file

Tags:

cmake

My problem is that I am forced to rerun CMake each time I add a new source file, which is really annoying... Is there any way CMake could detect newly added source file automatically?

like image 457
l0w-sec Avatar asked Feb 25 '26 14:02

l0w-sec


1 Answers

CMake does not have functionality to observe a folder. Some OS (e.g. MacOS X) can execute an action in case a folder was changed. Some IDEs (e.g. QtCreator V4.1 and newer) trigger an re-run of CMake in case any of the CMake files where changed.

I do not know your use case but I recommend not to use file(GLOB ...). It is better to know which files are part of your project.

like image 94
Th. Thielemann Avatar answered Feb 27 '26 07:02

Th. Thielemann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!