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

Fix/cmake install #911

Merged
merged 3 commits into from
Jan 14, 2018
Merged

Fix/cmake install #911

merged 3 commits into from
Jan 14, 2018

Conversation

theodelrieu
Copy link
Contributor

This PR fixes the CMake installation directory issue described in #910. (Due to PR #700)

It also adds a new CMake option to let users install the non-amalgamated version of the library.
The amalgamate tool was moved to avoid it to be installed as well

Pull request checklist

@@ -16,12 +16,12 @@ include(ExternalProject)
## OPTIONS
##
option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ON)
option(JSON_MultipleHeaders "Use non-amalgamated version of the library." OFF)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would anyone want this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To include the json_fwd.hpp file, or the adl_serializer.hpp. That's something I want to use at work, I like to only include what I need.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@nlohmann nlohmann added this to the Release 3.1.0 milestone Jan 13, 2018
@nlohmann nlohmann self-assigned this Jan 13, 2018
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 5775084 on theodelrieu:fix/cmake_install into a66b2d2 on nlohmann:develop.

@nlohmann nlohmann merged commit d9446b0 into nlohmann:develop Jan 14, 2018
@nlohmann
Copy link
Owner

Thanks!

@theodelrieu theodelrieu deleted the fix/cmake_install branch January 14, 2018 21:12
@amilcarlucas
Copy link

Would be nice if you would include a bit of documentation on how to install this.
make install, does not seam to do it :)

@nlohmann
Copy link
Owner

It's like any other CMake project:

mkdir build
cd build
mkdir local
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/local
make
make install

After that, you should have

local
├── include
│   └── nlohmann
│       └── json.hpp
└── lib
    └── cmake
        └── nlohmann_json
            ├── nlohmann_jsonConfig.cmake
            ├── nlohmann_jsonConfigVersion.cmake
            └── nlohmann_jsonTargets.cmake

@amilcarlucas
Copy link

Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants