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

jsoncpp cmake module not getting installed #459

Open
themightyoarfish opened this issue Nov 23, 2022 · 10 comments · May be fixed by #618
Open

jsoncpp cmake module not getting installed #459

themightyoarfish opened this issue Nov 23, 2022 · 10 comments · May be fixed by #618
Assignees
Labels
question Further information is requested

Comments

@themightyoarfish
Copy link

Client projects cannot compile against this project (when installed anyway), because FindJsoncpp.cmake is not getting installed alongside the rest. When find_package()ing ouster sdk:

CMake Warning at /opt/homebrew/Cellar/cmake/3.24.2/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "Findjsoncpp.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "jsoncpp", but
  CMake did not find one.

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

    jsoncppConfig.cmake
    jsoncpp-config.cmake

  Add the installation prefix of "jsoncpp" to CMAKE_PREFIX_PATH or set
  "jsoncpp_DIR" to a directory containing one of the above files.  If
  "jsoncpp" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  deps/lib/cmake/OusterSDK/OusterSDKConfig.cmake:7 (find_dependency)
  CMakeLists.txt:507 (find_package)


CMake Warning at CMakeLists.txt:507 (find_package):
  Found package configuration file:

    /Users/rasmus/Documents/Projects/autocrane-core/deps/lib/cmake/OusterSDK/OusterSDKConfig.cmake

  but it set OusterSDK_FOUND to FALSE so package "OusterSDK" is considered to
  be NOT FOUND.  Reason given by package:

  OusterSDK could not be found because dependency jsoncpp could not be found.

In my fork I had to make sure the module was installed.

@themightyoarfish
Copy link
Author

Any progress on this?

@Samahu
Copy link
Collaborator

Samahu commented Dec 9, 2022

@themightyoarfish our documentation mentions that you need to install libjsoncpp-dev to build the project:
https://static.ouster.dev/sdk-docs/cpp/building.html

Do you still face the issue even when installing libjsoncpp-dev through your system package manager?

@Samahu Samahu self-assigned this Dec 9, 2022
@Samahu Samahu added the question Further information is requested label Dec 9, 2022
@themightyoarfish
Copy link
Author

I've looked into this again, and on Ubuntu the problem does not appear to arise, as libjsoncpp-dev ships with cmake scripts (/usr/lib/x86_64-linux-gnu/cmake/jsoncpp/jsoncppConfig.cmake on 18.04) . On macos however, where many will install jsoncpp with homebrew, this does not hold. I guess this is more of a brew packaging issue, but it might still be worth installing the custom cmake modules like in #460.
After all, on ubuntu this custom module shouldn't be needed at all, should it?

@themightyoarfish
Copy link
Author

So even if macOS isn't supported as such, I'm curious why the custom cmake module is needed at all, when one is shipped with the apt package.

@Samahu
Copy link
Collaborator

Samahu commented Dec 9, 2022

've looked into this again, and on Ubuntu the problem does not appear to arise, as libjsoncpp-dev ships with cmake scripts (/usr/lib/x86_64-linux-gnu/cmake/jsoncpp/jsoncppConfig.cmake on 18.04) . On macos however, where many will install jsoncpp with homebrew, this does not hold. I guess this is more of a brew packaging issue, but it might still be worth installing the custom cmake modules like in #460.
After all, on ubuntu this custom module shouldn't be needed at all, should it?

I don't think you need to install Findjsoncpp.cmake into your system to make use of it, if you are compiling the SDK you should be able to make use of the file simply by referencing the sdk cmake folder:

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ouster-sdk/cmake)

@themightyoarfish
Copy link
Author

themightyoarfish commented Dec 10, 2022 via email

@themightyoarfish
Copy link
Author

Still a problem on current macos 116aa44b7699134c85bac63dd194331a789b8fa6 can't be used in client cmake projects because JsonCpp does not get found

CMake Warning at /opt/homebrew/Cellar/cmake/3.30.2/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
  By not providing "Findjsoncpp.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "jsoncpp", but
  CMake did not find one.

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

    jsoncppConfig.cmake
    jsoncpp-config.cmake

  Add the installation prefix of "jsoncpp" to CMAKE_PREFIX_PATH or set
  "jsoncpp_DIR" to a directory containing one of the above files.  If
  "jsoncpp" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  deps/lib/cmake/OusterSDK/OusterSDKConfig.cmake:7 (find_dependency)
  CMakeLists.txt:671 (find_package)


CMake Warning at CMakeLists.txt:671 (find_package):
  Found package configuration file:

    /Users/rasmus/Documents/Projects/autocrane-core/deps/lib/cmake/OusterSDK/OusterSDKConfig.cmake

  but it set OusterSDK_FOUND to FALSE so package "OusterSDK" is considered to
  be NOT FOUND.  Reason given by package:

  OusterSDK could not be found because dependency jsoncpp could not be found.

@themightyoarfish
Copy link
Author

It seems like the simple fix is just install the jsoncpp cmake module with the ouster library.

@themightyoarfish
Copy link
Author

And then you can't even use your own install of jsoncpp with the cmake integration (which homebrew seems to not have), because the ouster library links to a target called jsoncpp_lib, which only exists when using the bundled JsonCpp cmake module and not with JsonCpp's own cmake files.

@themightyoarfish themightyoarfish linked a pull request Oct 17, 2024 that will close this issue
@themightyoarfish
Copy link
Author

A change such as this fixes it: https://github.com/ouster-lidar/ouster-sdk/pull/618/files

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

Successfully merging a pull request may close this issue.

2 participants