Skip to content

The cmake_import example does not build #1976

Description

@coderDec
  • What is the issue you have?
    I am trying to build the cmake_import example json-develop/test/cmake_import/project.
    However it fails to build.
    Following error:

`
cmake .
-- The CXX compiler identification is GNU 7.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"nlohmann_json", but CMake did not find one.

Could not find a package configuration file provided by "nlohmann_json"
with any of the following names:

nlohmann_jsonConfig.cmake
nlohmann_json-config.cmake

Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
"nlohmann_json_DIR" to a directory containing one of the above files. If
"nlohmann_json" provides a separate development package or SDK, be sure it
has been installed.

-- Configuring incomplete, errors occurred!
`

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?
    I also put the nlohmann_jsonConfig.cmake file generated while building the project here.

  • What is the expected behavior?
    It should build the project

  • And what is the actual behavior instead?
    Unable to build using cmake.

  • Which compiler and operating system are you using? Is it a supported compiler?
    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.3 LTS
    Release: 18.04
    Codename: bionic

  • Did you use a released version of the library or the version from the develop branch?
    develop branch

  • If you experience a compilation error: can you compile and run the unit tests?
    yes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions