No cmake modules installed

Bug #1933871 reported by Paul Bovbel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nlohmann-json3 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Upstream (https://github.com/nlohmann/json/tree/develop/cmake) provides modules to use find_package to import into a CMake project.

The project install this file here (https://github.com/nlohmann/json/blob/develop/CMakeLists.txt#L155), but it is not included in the deb package.

Tags: packaging
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting.

I noticed that the package does contain some cmake files, though I am not sure if that means they are incomplete or if cmake fails to find them:

/usr/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake
/usr/lib/cmake/nlohmann_json/nlohmann_jsonConfigVersion.cmake
/usr/lib/cmake/nlohmann_json/nlohmann_jsonTargets.cmake
(https://packages.ubuntu.com/focal/all/nlohmann-json3-dev/filelist)

Btw, when reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. This will automatically add additional information like version numbers and Ubuntu release. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

tags: added: packaging
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

cat array.cpp
#include <iostream>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

int main()
{
    // create JSON arrays
    json j_no_init_list = json::array();
    json j_empty_init_list = json::array({});
    json j_nonempty_init_list = json::array({1, 2, 3, 4});
    json j_list_of_pairs = json::array({ {"one", 1}, {"two", 2} });

    // serialize the JSON arrays
    std::cout << j_no_init_list << '\n';
    std::cout << j_empty_init_list << '\n';
    std::cout << j_nonempty_init_list << '\n';
    std::cout << j_list_of_pairs << '\n';
}

cat CMakeLists.txt
project(foo)
cmake_minimum_required(VERSION 3.0)
find_package(nlohmann_json)
add_executable(array main.cpp)

cmake .

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
-- Found nlohmann_json: /usr/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.10.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/nlohmann

make
[ 50%] Building CXX object CMakeFiles/array.dir/main.cpp.o
[100%] Linking CXX executable array
[100%] Built target array

Changed in nlohmann-json3 (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nlohmann-json3 (Ubuntu) because there has been no activity for 60 days.]

Changed in nlohmann-json3 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.