Skip to content

Commit

Permalink
properly use pkg_check_modules for jsoncpp (BespokeSynth#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
KottV authored Jan 15, 2024
1 parent 2c22097 commit ab5a79c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ message(STATUS "Python version: ${Python_VERSION}")
message(STATUS "Python executable: ${Python_EXECUTABLE}")
message(STATUS "Python library: ${Python_LIBRARIES}")

if(BESPOKE_SYSTEM_JSONCPP)
find_package(jsoncpp REQUIRED)
endif()

if(NOT BESPOKE_SYSTEM_JUCE)
message(STATUS "Using JUCE from ${BESPOKE_JUCE_LOCATION}")
add_subdirectory(${BESPOKE_JUCE_LOCATION} ${CMAKE_BINARY_DIR}/JUCE EXCLUDE_FROM_ALL)
Expand All @@ -100,6 +96,12 @@ else()
endif()
endif()

if(BESPOKE_SYSTEM_JSONCPP)
find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
include_directories(${JSONCPP_INCLUDE_DIRS})
endif()

if (BESPOKE_VST2_SDK_LOCATION)
juce_set_vst2_sdk_path(${BESPOKE_VST2_SDK_LOCATION})
message(STATUS "Enabling VST2 - caution, non FOSS build")
Expand Down
2 changes: 1 addition & 1 deletion Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ endif ()
target_link_libraries(BespokeSynth PRIVATE
bespoke::exprtk
bespoke::freeverb
$<IF:$<STREQUAL:${BESPOKE_SYSTEM_JSONCPP},OFF>,bespoke::json,jsoncpp_lib>
$<IF:$<STREQUAL:${BESPOKE_SYSTEM_JSONCPP},OFF>,bespoke::json,jsoncpp>
bespoke::leathers
bespoke::nanovg
bespoke::psmove
Expand Down
4 changes: 0 additions & 4 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ add_subdirectory(freeverb EXCLUDE_FROM_ALL)
if(NOT BESPOKE_SYSTEM_JSONCPP)
add_subdirectory(json EXCLUDE_FROM_ALL)
message(STATUS "Using bundled jsoncpp")
else()
include(FindPkgConfig)
pkg_search_module(json REQUIRED jsoncpp)
message(STATUS "Using system provided jsoncpp")
endif()
add_subdirectory(leathers EXCLUDE_FROM_ALL)
add_subdirectory(nanovg EXCLUDE_FROM_ALL)
Expand Down

0 comments on commit ab5a79c

Please sign in to comment.