Skip to content
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

Add ability to build with system installed jsoncpp #1716

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option(BUILD_UNIVERSAL "Builds the shared or framework as a universal (fat, 32-
option(BUILD_OSX_I386 "Builds the shared or framework as a 32-bit binary, even on a 64-bit platform" OFF)
option(USE_LIBCXX "Uses libc++ instead of libstdc++" ON)
option(USE_CUSTOM_LIBCXX "Uses a custom libc++" OFF)
option(USE_SYSTEM_JSONCPP "Uses the system installed jsoncpp." OFF)

add_definitions( -DVR_API_PUBLIC )

Expand Down
12 changes: 11 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ endif()
# Set the source group and files.
set(CORE_FILES
openvr_api_public.cpp
jsoncpp.cpp
)

if(NOT USE_SYSTEM_JSONCPP)
set(JSON_CPP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/jsoncpp)
include_directories(${JSON_CPP_DIR})
list(APPEND CORE_FILES ${JSON_CPP_DIR}/jsoncpp.cpp)
endif()

set(VRCORE_FILES
vrcore/dirtools_public.cpp
vrcore/envvartools_public.cpp
Expand Down Expand Up @@ -100,6 +106,10 @@ if(USE_CUSTOM_LIBCXX)
set(EXTRA_LIBS ${EXTRA_LIBS} c++ c++abi)
endif()

if(USE_SYSTEM_JSONCPP)
list(APPEND EXTRA_LIBS jsoncpp)
endif()

target_link_libraries(${LIBNAME} ${EXTRA_LIBS} ${CMAKE_DL_LIBS})
target_include_directories(${LIBNAME} PUBLIC ${OPENVR_HEADER_DIR})

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.