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

Please expose a NLOHMANN_JSON_VERSION macro #943

Closed
ringerc opened this issue Jan 29, 2018 · 4 comments
Closed

Please expose a NLOHMANN_JSON_VERSION macro #943

ringerc opened this issue Jan 29, 2018 · 4 comments
Assignees
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@ringerc
Copy link

ringerc commented Jan 29, 2018

Hi folks

It'd be very handy if the library exposed a NLOHMANN_JSON_VERSION macro for easy version detection in configure scripts, cmake files, etc. Especially since the fancy formatting in the comment header makes text extraction harder.

@nlohmann
Copy link
Owner

Would the meta function help your use case?

@ringerc
Copy link
Author

ringerc commented Jan 31, 2018

@nlohmann Yeah, that'd probably do. I never would've thought to look for it there. But a configure test / CMake Find module etc could compile a trivial program to print the version based on that, assuming it's not cross-compiling.

For now I landed up with a hideous regexp based hack to match the version from the comment header.

@nlohmann
Copy link
Owner

@ringerc Is e8bf1f6 satisfying your needs?

@nlohmann nlohmann self-assigned this Jan 31, 2018
@nlohmann nlohmann added this to the Release 3.1.0 milestone Jan 31, 2018
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Jan 31, 2018
@ringerc
Copy link
Author

ringerc commented Feb 1, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants