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

Different include paths in macOS and Ubuntu #790

Closed
dmitry1100 opened this issue Oct 17, 2017 · 3 comments
Closed

Different include paths in macOS and Ubuntu #790

dmitry1100 opened this issue Oct 17, 2017 · 3 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@dmitry1100
Copy link

I want to use json.hpp in my project and it must be compiled for the latest macOS and for Ubuntu 16.04 LTS. I use CMake for the project. For macOS I followed the guide and installed json via homebrew, so I have /usr/local/include/json.hpp. But Ubuntu 16.04 does not have nlohmann-json-dev in apt repository (only 16.10 and newer have). So, I decided to clone json and generate makefiles via CMake to install it. And I noticed that it is installed into /usr/local/include/nlohmann/json.hpp. So, now I have to solve the problem with different include paths using platform dependent conditions in CMake file that is not so convenient.
Maybe it would be better to change installation path in homebrew version and make it /usr/local/include/nlohmann/json.hpp too? As I see it is good practice to put includes in some subfolder. So, users may include it like this:
#include <nlohmann/json.hpp>

@nlohmann
Copy link
Owner

Maybe related: #741

@dmitry1100
Copy link
Author

Yes, it seems, I guess we can close the issue as duplicate.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Oct 18, 2017
@nlohmann
Copy link
Owner

Unfortunately, I see no way to tell Homebrew to install to a different directory as /usr/local/Cellar/nlohmann_json/2.1.1. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

2 participants