AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Apache License 2.0
2.71k stars 660 forks source link

Don't update timestamp when regenerating instantation files. #1657

Closed jdumas closed 1 year ago

jdumas commented 1 year ago

Currently, when USE_EXPLICIT_INSTANTIATION=ON, re-running CMake will trigger recompilation of OpenVDB instantiation files. The culprit is the following line:

https://github.com/AcademySoftwareFoundation/openvdb/blob/3f8b6f30cf7c7d0d7f8fa7714965fb15d5db555b/openvdb/openvdb/CMakeLists.txt#L601

As the documentation for file(WRITE) mentions, one should use configure_file() to copy generated files used as build sources, only if the content changes. Given that USE_EXPLICIT_INSTANTIATION was created to save time when recompiling dependent files, this is quite an unfortunate mistake. This PR fixes that.