Skip to content

Different include paths in macOS and Ubuntu #790

@dmitry1100

Description

@dmitry1100

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    solution: duplicatethe issue is a duplicate; refer to the linked issue instead

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions