Skip to content

Commit

Permalink
CMakeLists: Use the jsoncpp submodule as part of VRPN.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Sep 1, 2015
1 parent b9670d2 commit 59d55a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ endif()

find_package(Threads REQUIRED)

find_package(jsoncpp REQUIRED)
if(TARGET jsoncpp_lib_static AND NOT TARGET jsoncpp_lib)
add_library(jsoncpp_lib INTERFACE)
target_link_libraries(jsoncpp_lib INTERFACE jsoncpp_lib_static)
endif()

include(CompilerFeatures)

set(OPENCV_MODULES_USED)
Expand Down
11 changes: 11 additions & 0 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ endif()

# Build VRPN as subproject
set(VRPN_GPL_SERVER FALSE CACHE INTERNAL "" FORCE)
set(VRPN_USE_JSONNET TRUE CACHE INTERNAL "" FORCE)
set(VRPN_USE_LOCAL_JSONCPP TRUE CACHE INTERNAL "" FORCE)
if(BUILD_CLIENT AND NOT BUILD_SERVER)
set(VRPN_BUILD_SERVER_LIBRARY FALSE CACHE INTERNAL "" FORCE)
set(VRPN_BUILD_CLIENT_LIBRARY TRUE CACHE INTERNAL "" FORCE)
Expand Down Expand Up @@ -45,6 +47,15 @@ else()
target_include_directories(vendored-hidapi INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/vrpn/submodules/hidapi")
endif()

# Interface target for jsoncpp compiled as part of VRPN.
add_library(jsoncpp_lib INTERFACE)
target_link_libraries(jsoncpp_lib INTERFACE vendored-vrpn)
if(JSONCPP_INCLUDE_DIRS)
target_include_directories(jsoncpp_lib INTERFACE "${JSONCPP_INCLUDE_DIRS}")
else()
target_include_directories(jsoncpp_lib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/vrpn/submodules/jsoncpp/include")
endif()

# Interface target for util headers
add_library(util-headers INTERFACE)
target_include_directories(util-headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/util-headers")
Expand Down

0 comments on commit 59d55a2

Please sign in to comment.