Whatever generator you use, if you modify one of your CMakeLists.txt files, launching a build will trigger cmake
and update your project. Let's take the case now of a different file, not in cmake language. How can one get the build process to trigger cmake automatically if this file is modified?
Getting to a concrete example, a project with
CMakeLists.txt:
cmake_minimum_required(VERSION 3.9.2)
project(dummy)
add_executable(dummy dummy.cpp)
dummy.py:
# Some python code
print("This line will be printed.")
dummy.cpp:
int main()
{
return 0;
}
How can I get cmake to re-run automatically when I build when dummy.py gets modified?