Skip to content

Commit 59d55a2

Browse files
committed
CMakeLists: Use the jsoncpp submodule as part of VRPN.
1 parent b9670d2 commit 59d55a2

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,6 @@ endif()
162162

163163
find_package(Threads REQUIRED)
164164

165-
find_package(jsoncpp REQUIRED)
166-
if(TARGET jsoncpp_lib_static AND NOT TARGET jsoncpp_lib)
167-
add_library(jsoncpp_lib INTERFACE)
168-
target_link_libraries(jsoncpp_lib INTERFACE jsoncpp_lib_static)
169-
endif()
170-
171165
include(CompilerFeatures)
172166

173167
set(OPENCV_MODULES_USED)

vendor/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ endif()
1212

1313
# Build VRPN as subproject
1414
set(VRPN_GPL_SERVER FALSE CACHE INTERNAL "" FORCE)
15+
set(VRPN_USE_JSONNET TRUE CACHE INTERNAL "" FORCE)
16+
set(VRPN_USE_LOCAL_JSONCPP TRUE CACHE INTERNAL "" FORCE)
1517
if(BUILD_CLIENT AND NOT BUILD_SERVER)
1618
set(VRPN_BUILD_SERVER_LIBRARY FALSE CACHE INTERNAL "" FORCE)
1719
set(VRPN_BUILD_CLIENT_LIBRARY TRUE CACHE INTERNAL "" FORCE)
@@ -45,6 +47,15 @@ else()
4547
target_include_directories(vendored-hidapi INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/vrpn/submodules/hidapi")
4648
endif()
4749

50+
# Interface target for jsoncpp compiled as part of VRPN.
51+
add_library(jsoncpp_lib INTERFACE)
52+
target_link_libraries(jsoncpp_lib INTERFACE vendored-vrpn)
53+
if(JSONCPP_INCLUDE_DIRS)
54+
target_include_directories(jsoncpp_lib INTERFACE "${JSONCPP_INCLUDE_DIRS}")
55+
else()
56+
target_include_directories(jsoncpp_lib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/vrpn/submodules/jsoncpp/include")
57+
endif()
58+
4859
# Interface target for util headers
4960
add_library(util-headers INTERFACE)
5061
target_include_directories(util-headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/util-headers")

0 commit comments

Comments
 (0)