Skip to content

Protect jsoncpp against multiple find_package() calls #288

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

Merged
merged 4 commits into from
Apr 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion trajopt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ find_package(trajopt_utils REQUIRED)
find_package(tesseract_common REQUIRED)
find_package(tesseract_environment REQUIRED)
find_package(tesseract_visualization REQUIRED)
find_package(jsoncpp REQUIRED)
if(NOT TARGET JsonCpp::JsonCpp)
find_package(jsoncpp REQUIRED)
endif()
find_package(ros_industrial_cmake_boilerplate REQUIRED)

if(NOT TARGET console_bridge::console_bridge)
Expand Down
2 changes: 2 additions & 0 deletions trajopt/cmake/trajopt-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ find_dependency(trajopt_sco)
find_dependency(trajopt_utils)
find_dependency(tesseract_environment)
find_dependency(tesseract_visualization)
if(NOT TARGET JsonCpp::JsonCpp)
find_dependency(jsoncpp)
endif()

if(NOT TARGET console_bridge::console_bridge)
add_library(console_bridge::console_bridge INTERFACE IMPORTED)
Expand Down
4 changes: 3 additions & 1 deletion trajopt_sco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ find_package(osqp QUIET)
find_package(qpOASES QUIET)
find_package(Eigen3 REQUIRED)
find_package(trajopt_utils REQUIRED)
find_package(jsoncpp REQUIRED)
if(NOT TARGET JsonCpp::JsonCpp)
find_package(jsoncpp REQUIRED)
endif()
find_package(ros_industrial_cmake_boilerplate REQUIRED)
find_package(Boost REQUIRED)

Expand Down
2 changes: 2 additions & 0 deletions trajopt_sco/cmake/trajopt_sco-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
include(CMakeFindDependencyMacro)
find_dependency(Eigen3)
find_dependency(trajopt_utils)
if(NOT TARGET JsonCpp::JsonCpp)
find_dependency(jsoncpp)
endif()
if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
find_package(Boost REQUIRED)
else()
Expand Down