Skip to content
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ if (BUILD_JSON_SERIALIZATION)
if(nlohmann_json_FOUND)
message(STATUS "Building JSON serialization helper functions")
else()
message(STATUS "Could not find nlohmann json. Skipping JSON serialization helpers")
message(WARNING "Could not find nlohmann json. Skipping JSON serialization helpers")
set(BUILD_JSON_SERIALIZATION OFF)
endif()
endif()

Expand Down
6 changes: 2 additions & 4 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ target_link_libraries(
MultiSense)

if (BUILD_JSON_SERIALIZATION)
if(nlohmann_json_FOUND)
message("Building python bindings with json print support")
target_compile_definitions(_libmultisense PRIVATE BUILD_JSON="True")
endif()
message("Building python bindings with json print support")
target_compile_definitions(_libmultisense PRIVATE BUILD_JSON="True")
endif()

install(TARGETS _libmultisense DESTINATION libmultisense)
8 changes: 2 additions & 6 deletions source/LibMultiSense/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ set(MULTISENSE_HEADERS ${CMAKE_CURRENT_LIST_DIR}/include/MultiSense/MultiSenseCh
${CMAKE_CURRENT_LIST_DIR}/include/MultiSense/MultiSenseUtilities.hh)

if (BUILD_JSON_SERIALIZATION)
if(nlohmann_json_FOUND)
list("APPEND" MULTISENSE_HEADERS ${CMAKE_CURRENT_LIST_DIR}/include/MultiSense/MultiSenseSerialization.hh)
endif()
list("APPEND" MULTISENSE_HEADERS ${CMAKE_CURRENT_LIST_DIR}/include/MultiSense/MultiSenseSerialization.hh)
endif()

set(DETAILS_SRC details/factory.cc
Expand Down Expand Up @@ -47,9 +45,7 @@ if (BUILD_OPENCV)
endif()

if (BUILD_JSON_SERIALIZATION)
if(nlohmann_json_FOUND)
target_link_libraries(MultiSense nlohmann_json::nlohmann_json)
endif()
target_link_libraries(MultiSense nlohmann_json::nlohmann_json)
endif()

set_target_properties(MultiSense PROPERTIES VERSION "${version}")
Expand Down
3 changes: 3 additions & 0 deletions source/LibMultiSense/MultiSenseConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

include(CMakeFindDependencyMacro)
find_dependency(MultiSenseWire)
if (@BUILD_JSON_SERIALIZATION@)
find_dependency(nlohmann_json 3.9 REQUIRED)
endif ()

include("${CMAKE_CURRENT_LIST_DIR}/MultiSenseTargets.cmake")

Expand Down
Loading