HowardHinnant / date

A date and time library based on the C++11/14/17 <chrono> header
Other
3.14k stars 677 forks source link

CMake: Allow user to opt out of install #751

Closed OlivierLDff closed 3 days ago

OlivierLDff commented 2 years ago

Hi, thanks for the great work!

It would be very nice to make this part optional: https://github.com/HowardHinnant/date/blob/22ceabf205d8d678710a43154da5a06b701c5830/CMakeLists.txt#L161-L202

For example when installing a shared library, using date as a private dependency, we don't want to install date. A new option should be introduced ENABLE_DATE_INSTALL to match project convention, or DATE_ENABLE_INSTALL to match cmake project conventions.

Would you consider such PR? Make ENABLE_DATE_INSTALL default to ON shouldn't change any behavior, and it would give users using date with add_subdirectory to opt-out of install.

Have a nice day.

HowardHinnant commented 2 years ago

I don't personally use or maintain CMake files here, so yes, a PR would be appreciated.

OlivierLDff commented 2 years ago

Ok, will do. I will go with ENABLE_DATE_INSTALL so that it match what is already there.