Skip to content
Merged
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ endif()
if(OSSIA_TESTING)
set(CMAKE_CTEST_ARGUMENTS --rerun-failed --output-on-failure)
include(CTest)
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys Catch2)
if(use_sys)
find_package(Catch2 CONFIG REQUIRED)
if(NOT TARGET Catch2::Catch2WithMain)
add_library(Catch2WithMain INTERFACE)
Expand Down
11 changes: 11 additions & 0 deletions cmake/OssiaOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Build settings :
option(OSSIA_USE_SYSTEM_LIBRARIES "Use system versions of the third-party libraries if possible")

function(ossia_use_system out pkg)
if(NOT DEFINED OSSIA_USE_SYSTEM_${pkg})
set(OSSIA_USE_SYSTEM_${pkg} "" CACHE STRING "")
endif()
if(NOT "${OSSIA_USE_SYSTEM_${pkg}}" STREQUAL "")
set(${out} "${OSSIA_USE_SYSTEM_${pkg}}" PARENT_SCOPE)
else()
set(${out} "${OSSIA_USE_SYSTEM_LIBRARIES}" PARENT_SCOPE)
endif()
endfunction()
option(OSSIA_STATIC "Make a static build" OFF)
option(OSSIA_INSTALL_STATIC_DEPENDENCIES "Generate install rules for wiiuse, etc" OFF)
option(OSSIA_FAST_DEVELOPER_BUILD "Create shared libraries for some third-party libraries" OFF)
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/coap.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys libcoap)
if(use_sys)
find_path(LIBCOAP_INCLUDEDIR coap3/libcoap.h)
find_library(LIBCOAP_GNUTLS_LIBRARIES coap-3-gnutls)
find_library(LIBCOAP_LIBRARIES coap-3)
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/concurrentqueue.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys concurrentqueue)
if(use_sys)
find_package(concurrentqueue 1.0 CONFIG GLOBAL)
if(TARGET concurrentqueue::concurrentqueue)
get_target_property(cq_include_dirs concurrentqueue::concurrentqueue INTERFACE_INCLUDE_DIRECTORIES)
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/ctre.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys ctre)
if(use_sys)
find_package(ctre 3.7 CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/dno.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys dno)
if(use_sys)
find_package(dno CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/dr_libs.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys dr_libs)
if(use_sys)
find_path(DR_LIBS_INCLUDE_DIR dr_wav.h)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/exprtk.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys exprtk)
if(use_sys)
find_path(EXPRTK_INCLUDE_DIR exprtk.hpp)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/fmt.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys fmt)
if(use_sys)
find_package(fmt CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/kfr.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys KFR)
if(use_sys)
# KFR
if(OSSIA_ENABLE_KFR)
find_package(KFR)
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/magic_enum.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys magic_enum)
if(use_sys)
find_package(magic_enum CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/mdspan.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys mdspan)
if(use_sys)
find_package(mdspan CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/mqtt.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys async-mqtt5)
if(use_sys)
find_package(async-mqtt5 CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/nano-signal-slot.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys nanosignal)
if(use_sys)
find_path(NANOSIGNAL_INCLUDE_DIR nano_observer.hpp)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/oscpack.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys oscpack)
if(use_sys)
find_package(oscpack 1.2 CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/perlinnoise.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys perlinnoise)
if(use_sys)
find_path(PERLINNOISE_INCLUDE_DIR PerlinNoise.hpp)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/rapidfuzz.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys rapidfuzz)
if(use_sys)
find_package(rapidfuzz CONFIG REQUIRED GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/rapidhash.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys rapidhash)
if(use_sys)
find_package(rapidhash CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/rapidjson.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys RapidJSON)
if(use_sys)
find_package(RapidJSON 1.2 CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/re2.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys re2)
if(use_sys)
find_package(re2 QUIET CONFIG)
if(NOT TARGET re2::re2)
find_library(RE2_LIBRARY NAMES re2)
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/readerwriterqueue.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys readerwriterqueue)
if(use_sys)
find_path(READERWRITERQUEUE_INCLUDE_DIR readerwriterqueue.h)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/rnd.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys rnd)
if(use_sys)
find_package(rnd CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/rubberband.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys rubberband)
if(use_sys)
find_library(RUBBERBAND_LIBRARY NAMES rubberband)
find_path(RUBBERBAND_INCLUDE_DIR rubberband/RubberBandStretcher.h)

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/samplerate.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys SampleRate)
if(use_sys)
find_package(SampleRate CONFIG GLOBAL)

if(NOT TARGET SampleRate::samplerate)
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/servus.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys Servus)
if(use_sys)
find_package(Servus CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/smallfunction.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys smallfun)
if(use_sys)
find_path(SMALLFUN_INCLUDE_DIR smallfun.hpp)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/span.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys span)
if(use_sys)
find_package(span CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/spdlog.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys spdlog)
if(use_sys)
if(NOT OSSIA_FMT_INTERNAL)
find_package(spdlog CONFIG REQUIRED GLOBAL)
endif()
Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/tuplet.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys tuplet)
if(use_sys)
find_package(tuplet CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/unordered_dense.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys unordered_dense)
if(use_sys)
find_package(unordered_dense CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/verdigris.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys verdigris)
if(use_sys)
find_package(verdigris CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/websocketpp.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys websocketpp)
if(use_sys)
find_package(websocketpp CONFIG GLOBAL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/wiiuse.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys wiiuse)
if(use_sys)
find_library(WIIUSE_LIBRARY NAMES wiiuse)
find_path(WIIUSE_INCLUDE_DIR wiiuse.h)

Expand Down
3 changes: 2 additions & 1 deletion cmake/deps/zita-alsa-pcmi.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys zita-alsa-pcmi)
if(use_sys)
find_path(ZITA_ALSA_PCMI_INCLUDE_DIR zita-alsa-pcmi.h)
find_library(ZITA_ALSA_PCMI_LIBRARY zita-alsa-pcmi)

Expand Down
3 changes: 2 additions & 1 deletion src/ossia_features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ endif()

if(OSSIA_PROTOCOL_WIIMOTE)
target_sources(ossia PRIVATE ${OSSIA_WIIMOTE_SRCS} ${OSSIA_WIIMOTE_HEADERS})
if(NOT OSSIA_USE_SYSTEM_LIBRARIES)
ossia_use_system(use_sys wiiuse)
if(NOT use_sys)
target_include_directories(ossia PRIVATE "${WIIUSE_DIR}/src")
endif()
target_link_libraries(ossia PRIVATE $<BUILD_INTERFACE:wiiuse>)
Expand Down
Loading