-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
CMake alias to nlohmann::json #1291
Copy link
Copy link
Closed
Labels
state: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Metadata
Metadata
Assignees
Labels
state: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
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_NAMEtonlohmann_json; but have your target name asjsonwith a library alias prefix and export namespace asnlohmann::.Thus
nlohmann::jsoncan 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.