fileapi: Generate reply if special environment variable (`CMAKE_FILE_API`) is set
With CMake 3.27 there are only 2 ways to force the generation of file API reply:
- put special
query
files into the project build directory - add
cmake_file_api()
command into CMakeLists.txt - #24951 (closed)
For an IDE, it would be much easier and less invasive to simply specify some environment variable - e.g. CMAKE_FILE_API
. If CMake sees such a variable, it can generate a corresponding file API reply.
Additionally, CMake can generate file API response in some external location, instead of the project build directory.
This feature would be useful for CLion to implement this feature: https://youtrack.jetbrains.com/issue/CPP-8414 Also, it can be useful for #22826