Project files which are ignored (or not built) increases configure/generate time significantly
For context, we have a large project which also includes many (thousands) of xml files. They aren't needed to be built but are included in the project for ease of access and editing in the IDE etc.
This causes our configure/generate time to roughly double. I've profiled cmake and the hottest path seems to be cmSystemTools::FileExists
inside cmSourceFileLocation::UpdateExtension
which is called for every single xml file. Expect the windows filesystem is playing some part here, but ideally there would be a way in cmake to add a file/path to a project without cmake verifying the file exists, especially on incremental builds (where this problem is most noticeable)
I've tried:
- Setting
HEADER_FILE_ONLY
on the files, which of course excludes them from the build, but cmake still checks they exist so we still lose lots of time - Setting
CMAKE_<LANG>_IGNORE_EXTENSIONS
to ignore xml, but they are still checked
I can understand the logic behind checking a file exists if it's been added to a project, but would be good if there was a way to avoid this check when we don't care about it