Problem with ARA plugin built with CMake

Hey all,

I’m in the process of building an ARA plugin using CMake. I use :

  • Windows 10 (VS 19 2022)
  • The develop branch of JUCE
  • The 2.2.0 release of ARA_SDK
  • Reaper for testing/loading the plugin.

As a first step, I started with opening the PIP demo JUCE/examples/Plugins/ARAPluginDemo.h in Projucer, exported the the solution and built from within VS and it worked fine.

Now, I’m trying to do the same thing using the following CMake file. After reading the instructions in JUCE/docs/ARA.md, this is the CMake I use:

cmake_minimum_required(VERSION 3.15)
project(ARA_TEST VERSION 0.0.1)
add_subdirectory(JUCE) 
juce_set_ara_sdk_path("C:\\SDKs\\ARA_SDK")

juce_add_plugin(ARA_TEST(
    PLUGIN_MANUFACTURER_CODE Xrib
    PLUGIN_CODE Xrib
    IS_ARA_EFFECT TRUE
    FORMATS VST3
    PRODUCT_NAME "ARA_TEST")

juce_generate_juce_header(ARA_TEST)

target_sources(ARA_TEST
    PRIVATE
    Source/main.cpp
    Source/ARAPluginDemo.h)

target_compile_definitions(ARA_TEST
    PUBLIC
    JUCE_PLUGINHOST_ARA=1 # tried with and without this flag
    JUCE_WEB_BROWSER=0
    JUCE_USE_CURL=0
    JUCE_VST3_CAN_REPLACE_VST2=0)

target_link_libraries(ARA_TEST
    PRIVATE
        # Copied the libraries from the PIP file ARAPluginDemo.h
        juce::juce_audio_basics
        juce::juce_audio_devices
        juce::juce_audio_formats
        juce::juce_audio_plugin_client
        juce::juce_audio_processors
        juce::juce_audio_utils
        juce::juce_core
        juce::juce_data_structures
        juce::juce_events
        juce::juce_graphics
        juce::juce_gui_basics
        juce::juce_gui_extra
    PUBLIC
        juce::juce_recommended_config_flags
        juce::juce_recommended_lto_flags
        juce::juce_recommended_warning_flags)

My ARAPluginDemo.h is exactly the same as JUCE/examples/Plugins/ARAPluginDemo.h
And also added the createARAFactory() in the Main.cpp file as indicated in the JUCE/docs/ARA.md

I can successfully build the plugin, but when loading it in Reaper, I get the following:
ARA host isn't detected. This plugin only supports ARA mode.

Additionally, I used the validator.exe from ARA_SDK/ARA_Examples to validate the plugin. The one built using Projucer passes all 47 tests, while the one built with CMake it throws the following error:

Invalid Module!
LoadLibray failed: The specified module could not be found.

Is there any flag I’m missing in CMake ? I’d appreciate any help,
Christos

I can see on the Reaper window that during your failed attempt, you’re trying to load a 32 bit version of the ARA plugin. I can confirm that my 64 bit Reaper is also unable to use ARA features in this setup, but I haven’t figured out if this is a bug yet.

I think what happens is when using the Projucer you were building a 64 bit version of the ARA plugin, which is working correctly. You can also select a 64 bit build when using CMake by selecting x64 in the Optional platform generator dropdown in the CMake GUI, or by passing -A x64 to the CMake command line.

Also, can you check that when using validator.exe both the plugin and the validator are either 32 or 64 bit builds? Mixing builds would cause a LoadLibrary failure like you described.

You are right, it works now. The validator.exe was also 64bit so it couldn’t work with the 32bit plugin.
Thank you very much !!