When I open juce_ARA_utils.h its missing the ARA Library. When I try to build solution it obviously doesn’t work. Any advice? I’m on Windows 10
I installed it and specified the path in CMakesList.txt and still get the same error. I tried to specify the absolute file path in juce_ARA_utils.h but get errors from a bunch of other files that use the ARA library
You can link your plugin with the juce::juce_ara_headers
library (using target_link_libraries()
). Or you can simply use target_include_directories(YourPlugin PRIVATE "Path/To/ARA_SDK")
.
@attila If we define juce_set_ara_sdk_path(...)
and juce_add_plugin(... IS_ARA_EFFECT TRUE)
, the plugin should be linked automatically with the juce::juce_ara_headers
library?
That’s correct. No way to say for sure what could be the problem here, so just one guess: was the recursive option used when cloning th ARA SDK? Also it could be worth a shot to test using the Projucer instead to generate the project. In this case the ARA SDK path must be specified in Preferences → Global Settings…
In my case, I use git clone --recursive
on the project. If I manually link against juce::juce_ara_headers
or if I add target_include_directories(YourPlugin PRIVATE "Path/To/ARA_SDK")
, it works fine. So I doubt that’s the problem. I’ll try with the Projucer but I think it is related to the way the juce_ara_sdk and the juce_ara_headers are created and managed by Juce:
The included directories are well-defined and the compilation succeeds if I do:
set(JUCE_GLOBAL_ARA_SDK_PATH "Path/To/ARA_SDK")
add_subdirectory(JUCE)
But not, if do as specified in the doc ARA.md:
add_subdirectory(JUCE)
juce_set_ara_sdk_path(Path/To/ARA_SDK)
It seems to me that in the first case, juce_ara_sdk
is created before juce_ara_headers
. And of course, we can’t put juce_set_ara_sdk_path(${CMAKE_CURRENT_SOURCE_DIR}/ARA_SDK)
before add_subdirectory(JUCE)
.
Thank you, this is solid information. I will take a closer look early next week to see if there’s a problem with juce_set_ara_sdk_path.
Are you trying to build an extra or example provided by JUCE?
I’m sorry, I’m just guessing here, because I haven’t been able to repro the issue yet.
I don’t think this can be tested with the extra or examples provided by JUCE because the examples are configured with JUCE (so it requires -DJUCE_GLOBAL_ARA_SDK_PATH="Path/To/ARA_SDK"
or set(JUCE_GLOBAL_ARA_SDK_PATH "Path/To/ARA_SDK")
but in this case, we would like to use juce_set_ara_sdk_path(Path/To/ARA_SDK)
. Here is a very basic CMake example:
cmake_minimum_required(VERSION 3.16)
add_subdirectory("Path/To/JUCE")
juce_set_ara_sdk_path("Path/To/ARA_SDK") # doesn't seem to work
juce_add_plugin(MySuperPlugin
VERSION 1.0.0
DESCRIPTION "MySuperPlugin"
IS_SYNTH FALSE
NEEDS_MIDI_INPUT FALSE
NEEDS_MIDI_OUTPUT FALSE
IS_MIDI_EFFECT FALSE
EDITOR_WANTS_KEYBOARD_FOCUS TRUE
PLUGIN_MANUFACTURER_CODE ...
PLUGIN_CODE ...
FORMATS AU VST3
PRODUCT_NAME "MySuperPlugin"
AU_MAIN_TYPE kAudioUnitType_Effect
VST3_CATEGORIES Fx
IS_ARA_EFFECT TRUE
)
file(GLOB_RECURSE MySuperPluginSource Source/*.cpp Source/*.h)
target_sources(MySuperPlugin PRIVATE ${MySuperPluginSource})
target_link_libraries(MySuperPlugin PRIVATE
juce::juce_audio_utils
juce::juce_dsp
juce::juce_audio_plugin_client
# juce::juce_ara_headers // necessary to compile
)
target_link_libraries(MySuperPlugin PUBLIC
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
)
I can create a real project to share with you if necessary.
Your CMake example is correct and I can use it to compile source files taken from a Projucer generated empty ARA plugin on Windows and MacOS.
I can even include ARA Library headers directly in a separate .cpp
file, so it’s not even the case of a missing include through which ARA classes would be included.
It would be good to see an example project with a concrete error message.
I might have done something wrong with CMake or mixed up things I’m sorry. I’ll create a clean and simple project to check that.