# How to get cmake to monitor a specific file

**URL:** https://discourse.cmake.org/t/how-to-get-cmake-to-monitor-a-specific-file/8903
**Category:** Usage
**Tags:** os:android
**Created:** [September 7, 2023, 2:54am UTC](https://discourse.cmake.org/t/how-to-get-cmake-to-monitor-a-specific-file/8903 "2023-09-07T02:54:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aidexie](https://discourse.cmake.org/user_avatar/discourse.cmake.org/aidexie/32/3439_2.png) [@aidexie](https://discourse.cmake.org/u/aidexie)
#### Post date: [September 7, 2023, 2:54am UTC](https://discourse.cmake.org/t/how-to-get-cmake-to-monitor-a-specific-file/8903/1 "2023-09-07T02:54:36Z")

</div>

I am using android studio to compile a large project with many modules. When I modify CMakeList.txt, xxx.cmake files, it triggers android studio to go and regenerate the cmake project. I want to add some file types to monitor but not using .cmake suffix like .py. after modifying such files it also triggers cmake to regenerate the project.  
How should I do this?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [September 13, 2023, 2:25am UTC](https://discourse.cmake.org/t/how-to-get-cmake-to-monitor-a-specific-file/8903/2 "2023-09-13T02:25:33Z")

</div>

You can use [`CMAKE_CONFIGURE_DEPENDS`](https://cmake.org/cmake/help/latest/prop_dir/CMAKE_CONFIGURE_DEPENDS.html) to do this:

```cmake
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND
  PROPERTY CMAKE_CONFIGURE_DEPENDS path/to/something.py)

```
