# How to prevent CMake File API from generating irrelevant build information

**URL:** https://discourse.cmake.org/t/how-to-prevent-cmake-file-api-from-generating-irrelevant-build-information/9865
**Category:** Usage
**Created:** [January 16, 2024, 1:35pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-file-api-from-generating-irrelevant-build-information/9865 "2024-01-16T13:35:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_Cao](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jason_cao/32/3575_2.png) [@Jason\_Cao](https://discourse.cmake.org/u/Jason_Cao)
#### Post date: [January 16, 2024, 1:35pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-file-api-from-generating-irrelevant-build-information/9865/1 "2024-01-16T13:35:40Z")

</div>

I am currently developing a tool that utilizes the CMake File API to obtain build information from a CMake project, such as targets, source files, compilation options, etc., to facilitate the porting of build scripts. This is effective in many cases.

However, sometimes the CMake File API generates some targets that are not of reference value. For example:  
Target: ‘Continuous’:  
Source File: [‘my\_oh\_build/CMakeFiles/Continuous’, ‘my\_oh\_build/CMakeFiles/Continuous.rule’]

The ‘my\_oh\_build’ is a folder I generated, and the original project does not contain this file. The ‘.rule’ files here are also of no use for project compilation (they are not C/C++ files), and I don’t want it to generate such files. Alternatively, can someone tell me how these files can help me better obtain build information? Thank you!

---

<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: [January 16, 2024, 2:00pm UTC](https://discourse.cmake.org/t/how-to-prevent-cmake-file-api-from-generating-irrelevant-build-information/9865/2 "2024-01-16T14:00:10Z")

</div>

That target comes from `add_custom_target()` via `include(CTest)`. So it is _there_, but closer to “implicit” due to being part of CTest.
