fix(build): install should not always copy header files
Description
On Windows, when installing Sight, header files are always copied in the install directory. This is annoying in a development setup with Sight as a dependency, because any modification brought implies that the whole child project will be rebuilt, since headers timestamps are newer.
Steps to reproduce
In a child project of Sight
- Install Sight
- Build your project
- Install Sight again: in the log, observe header files are copied whereas they should be marked as already up-to-date
- Build your project again: observe everything is rebuilt from scratch whereas nothing should be rebuilt
Functional specifications
This occurs because of the modifications brought to all headers files to replace the *_API
macros. This is done directly in the install folder as a post-install process, thus it is performed each time.
We have to use correct CMake dependencies to perform this step only when headers files are modified and install the generated header instead of the source header.
Technical specifications
- Add a custom target to generate library headers without
*_API
macros in the build folder - Install the generated headers
Test plan
CI tests + reproduce the steps described above.