-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
CMake alias to nlohmann::json
#1291
Comments
@parnmatt I am not a CMake expert, so I am calling out to @chuckatkins about this idea. |
TLDR: the current behavior should remain default but making it configurable would be a useful addition. Long answer: That being said, the target name of |
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. |
Currently you have the internal name
nlohmann_json
, and a library alias tonlohmann_json::nlohmann_json
, and an export namespace ofnlohmann_json::
as per regular conventionThus when including this project, you can always refer to
nlohmann_json::nlohmann_json
.Keep the
PROJECT_NAME
tonlohmann_json
; but have your target name asjson
with a library alias prefix and export namespace asnlohmann::
.Thus
nlohmann::json
can be used; which is not only shorter to type, but also in line with the C++ namespacing.In theory you can make a library alias and separate export group to the current form as well as the suggest form, to not break compatibility. Potentially being deprecated, and optionally removed in a much future version.
The text was updated successfully, but these errors were encountered: