Skip to content

CMake alias to nlohmann::json #1291

@parnmatt

Description

@parnmatt

Currently you have the internal name nlohmann_json, and a library alias to nlohmann_json::nlohmann_json, and an export namespace of nlohmann_json:: as per regular convention

Thus when including this project, you can always refer to nlohmann_json::nlohmann_json.

Keep the PROJECT_NAME to nlohmann_json; but have your target name as json with a library alias prefix and export namespace as nlohmann::.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: please discussplease 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 updated

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions