Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid installation if included as a subproject #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nicola-gigante
Copy link

When clipp is included as a subproject with add_subdirectory, the target is installed alongside the other targets of the main project. This is not always advisable, especially not if the main project installs an executable (so the headers file are not needed for users of the main target).

This PR provides a variable that the user can set to enable the install target. The variable is set by default on ON or OFF depending on whether the project is being built as a subproject or not.

A potential problem might arise for compatibility with existing clients that implicitly relied on the current behavior. They would have to explicitly set the CLIPP_INSTALL variable to ON. If this breaking change has to be avoided, another acceptable solution would be to simply set the variable to ON by default and at least let the client disable it if needed.

nicola-gigante and others added 3 commits March 27, 2020 12:24
C++20 removed the deprecated std::result_of in favor of
std::invoke_result.
Switch between usage of those depending on the cpp_lib_is_invocable
feature test macro.

See:
 - https://en.cppreference.com/w/cpp/types/result_of
 - https://en.cppreference.com/w/cpp/feature_test#Library_features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants