fileapi: Provide CONFIGURE_DEPENDS glob verification info
Problem Description
When using the CONFIGURE_DEPENDS flag in CMake to specify file globbing for source file lists, CMake automatically generates a VerifyGlobs.cmake file. This file is used to re-check the specified globs before each build, allowing CMake to reconfigure the project automatically if any changes are detected in the globbed files. This feature ensures that the build system remains up-to-date with the project's files and directories structure.
However, this process poses a challenge for IDEs, particularly in terms of IntelliSense and other code navigation features. Currently, the information necessary for verifying globs is only available internally within CMake, with no official method for IDEs to access this information ahead of time. This limitation can hinder the IDE's ability to perform early reconfiguration, which is essential for maintaining accurate IntelliSense and code analysis features.
Suggested Solution
To address this issue, it would be beneficial for CMake to provide an idiomatic way for IDEs to access glob verification information. One proposed method is to expose this information through CMake's File API. By making glob verification details accessible via the File API, IDEs could perform early reconfiguration based on the most current file and directory structures. This enhancement would significantly improve the development experience by ensuring that code navigation features remain accurate and up-to-date.
Expected Benefits
- Improved accuracy of IntelliSense and other code analysis tools in IDEs.
- Enhanced developer experience by ensuring that project configurations are always up-to-date with the current state of the file system.
- Streamlined development process, reducing the need for manual project reconfiguration.
Related Issue
This proposal is helpful to resolve microsoft/vscode-cmake-tools#3558.