-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I tried to compile on a macOS (x86_64) and had to make the following changes to enable compilation without errors.
-
A fix to
clients/softcut_jack_osc/src/BufDiskWorker.cppto include<array> -
Some additions to
clients/softcut_jack_osc/CMakeLists.txtto make it work nicely with homebrew installed dependencies if available.
The patch is as follows and attached at the end of this post:
diff --git a/clients/softcut_jack_osc/CMakeLists.txt b/clients/softcut_jack_osc/CMakeLists.txt
index 08798c0..6381cc6 100644
--- a/clients/softcut_jack_osc/CMakeLists.txt
+++ b/clients/softcut_jack_osc/CMakeLists.txt
@@ -13,9 +13,38 @@ set(SRC src/main.cpp
add_executable(softcut_jack_osc ${SRC})
-include_directories(../../softcut-lib/include)
-target_link_libraries(softcut_jack_osc softcut jack lo pthread sndfile)
+if(CMAKE_HOST_APPLE)
+ execute_process(
+ COMMAND brew --prefix
+ OUTPUT_VARIABLE HOMEBREW_PREFIX
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(DEFINED HOMEBREW_PREFIX)
+ set(HAS_HOMEBREW 1)
+ message(STATUS "HAS_HOMEBREW: ${HAS_HOMEBREW}")
+ message(STATUS "HOMEBREW_PREFIX: ${HOMEBREW_PREFIX}")
+ endif()
+endif()
+
+
+include_directories(
+ ../../softcut-lib/include
+ $<${HAS_HOMEBREW}:${HOMEBREW_PREFIX}>/include
+)
+
+target_link_directories(softcut_jack_osc
+ PRIVATE
+ $<${HAS_HOMEBREW}:${HOMEBREW_PREFIX}>/lib
+)
+
+target_link_libraries(softcut_jack_osc
+ softcut
+ jack
+ lo
+ pthread
+ sndfile
+)
target_compile_options(softcut_jack_osc PRIVATE -Wall -Wextra -pedantic)
diff --git a/clients/softcut_jack_osc/src/BufDiskWorker.cpp b/clients/softcut_jack_osc/src/BufDiskWorker.cpp
index e5c8dc4..8b65230 100644
--- a/clients/softcut_jack_osc/src/BufDiskWorker.cpp
+++ b/clients/softcut_jack_osc/src/BufDiskWorker.cpp
@@ -12,6 +12,7 @@
#include <sndfile.hh>
#include <utility>
+#include <array>
#include "BufDiskWorker.h"Metadata
Metadata
Assignees
Labels
No labels