CMake: Optional Install if Embedded#1330
Conversation
When adding this library as embedded library with private "target link", e.g. only used inside private source files, the library does not need to be installed when the main project gets installed. This adds an additional option `JSON_Install` similar to the test-build control switch in order to skip installing headers and CMake config files if requested. Avoids using ```cmake add_subdirectory(path/to/nlohmann_json EXCLUDE_FROM_ALL) ``` which has further side-effects: https://cmake.org/cmake/help/v3.0/command/add_subdirectory.html
|
Yes, I would also know what @chuckatkins thinks about this. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Any thoughts, @chuckatkins ? |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Hi @chuckatkins, sorry to bother you about this but I wonder if this is good practice or if you also just go with |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
ping @chuckatkins any idea? |
|
@t-b I am still wondering what other projects do, since this seems to be a common workflow that a simple |
|
Thanks a lot! |
|
@nlohmann Thanks for merging. @ax3l According to https://stackoverflow.com/a/51746390 most projects add an option to skip the installation. |
|
Good to know, so my intuition wasn't all off. Thanks for merging! |
When adding this library as embedded library with private "target link", e.g. only used inside private source files, the library does not need to be installed when the main project gets installed.
This adds an additional option
JSON_Installsimilar to the test-build control switch in order to skip installing headers and CMake config files if requested.Avoids using
which has further side-effects:
https://cmake.org/cmake/help/v3.0/command/add_subdirectory.html
cc @chuckatkins do you have an opinion on this?