Skip to content

Commit f090085

Browse files
committed
CMakeLists: Use the jsoncpp submodule as part of VRPN.
1 parent e9bf4b5 commit f090085

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CMakeLists.txt

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

174174
find_package(Threads REQUIRED)
175175

176-
find_package(jsoncpp REQUIRED)
177-
if(TARGET jsoncpp_lib_static AND NOT TARGET jsoncpp_lib)
178-
add_library(jsoncpp_lib INTERFACE)
179-
target_link_libraries(jsoncpp_lib INTERFACE jsoncpp_lib_static)
180-
endif()
181-
182176
include(CompilerFeatures)
183177

184178
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)