I want to have my custom commands rerun every time a file from a list I supply gets modified.
My example: my project has the following files:
- main.cpp
- CMakeLists.txt
- dep1.txt
- dep2.txt
cmake_minimum_required(VERSION 3.17)
project(dummy)
set(DummyFiles dep1.txt, dep2.txt)
add_executable(test_dummy main.cpp)
add_custom_command(TARGET test_dummy
COMMENT "ran custom command on file change"
DEPENDS ${DummyFiles}
)
My expectation is that after I have already configured that project, every time I modify dep1.txt or dep2.txt and reconfigure, CMake will print out the COMMENT section above. It however doesn't.
Any help would be appreciated.