Automatically detect newly added source file

后端 未结 2 1579
孤独总比滥情好
孤独总比滥情好 2020-12-21 22:45

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 auto

2条回答
  •  天涯浪人
    2020-12-21 23:25

    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.

提交回复
热议问题