-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
REFACTOR: rewrite CMakeLists.txt for better inlcude and reuse #669
REFACTOR: rewrite CMakeLists.txt for better inlcude and reuse #669
Conversation
The rewrite uses more cmake build-in automatisms and build-in generates variables to allow better generic reuse. * cmake files are installed to ``` <install_prefix>/lib/cmake/nlohmann_json/ ``` for best support on most systems * include path is set to ``` include ``` for usage as ``` #include <nlohmann/json.hpp> ```
@dan-42, thanks for your PR! By analyzing the history of the files in this pull request, we identified @robertmrk, @nlohmann and @ChrisKitching to be potential reviewers. |
## PROJECT | ||
## name and version | ||
## | ||
project(nlohmann_json VERSION 2.1.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity: why did you remove the LANGUAGES
part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it is enabled by default, so no need for that. see https://cmake.org/cmake/help/v3.0/command/project.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking back! Just out of coincidence: would it help to explicitly enable C++, because we do not use C at all?
Thanks a lot! |
awesome thank you |
The rewrite uses more cmake build-in functions and build-in automaticly generated
variables to allow better generic reuse.
This is based on the cmake example project package-example
<install_prefix>/lib/cmake/nlohmann_json/
for best support onmost systems
include
for usage as#include <nlohmann/json.hpp>
Motivation
The motivation is the reintegration of
nlohmann_json
into the cmake package-manager hunterand to avoid possible naming collissions with other packages( e.g. jsoncpp, etc)
compile install and run with unit tests
Usage on an external project after installation
CMakeLists.txt
main.cpp
I'm looking forward on comments and thoughts about the changes.
Many thanks in advance