I have a plugin which was initially built with the Projucer, I just switched to CMake with the help of FRUT to generate the CMakeLists.txt from the old .jucer file. The build sets up fine and the VST3 target compiles fine, but attempting to build the AudioUnit I get this fatal error:
JUCE/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUBase.cpp:5:10: fatal error: 'AudioUnitSDK/AUBase.h' file not found
Looking within the JUCE modules folder, all the header files are there so I’m not sure why it isn’t found; the same code builds to AU just fine when using the Projucer and Xcode. For context I’m on macOS Monterey using Unix Makefiles as a generator and a global installation of JUCE 7.0.4. Any help appreciated!
You would need to provide more info … perhaps the rest of the build log … as it is likely just an issue with the CPATH (-I option) not being set up properly… You could try to remove the “AudioUnitSDK” portion of the path used in the include statement …
Are you using the correct Projucer version to generate the Unix Makefiles?
The CMake project needs to add juce/module/path/juce_audio_plugin_client/AU
to the header search paths. Are you using the latest FRUT? If so, perhaps FRUT needs to be updated with this new requirement.
Thanks for the reply- yes I am using the latest FRUT. Where are the header search paths set? Sorry if that’s a silly question, I’m new to CMake. I’m already including the audio plugin client module like so:
jucer_project_module(
juce_audio_plugin_client
PATH "${JUCE_MODULES_GLOBAL_PATH}"
JUCE_VST3_CAN_REPLACE_VST2 OFF
# JUCE_FORCE_USE_LEGACY_PARAM_IDS
# JUCE_FORCE_LEGACY_PARAMETER_AUTOMATION_TYPE
# JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
# JUCE_AU_WRAPPERS_SAVE_PROGRAM_STATES
# JUCE_STANDALONE_FILTER_WINDOW_USE_KIOSK_MODE
)
Thanks, I can’t change the include statement because the error is coming from AUBase.cpp within the AudioUnit SDK. How does CPATH need to be set to find the headers?
If your CMake configuration is set up so that one of the -I (include directory) paths points to:
JUCE/modules/juce_audio_plugin_client/AU/AudioUnitSDK/
… then the include statement:
#include "AudioUnitSDK/AUBase.h"
… is going to fail, since its expecting to find:
JUCE/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AudioUnitSDK/AUBase.h
By removing the “AudioUnitSDK/” prefix in the #include statement, you’ll be conforming to the path as configured and won’t need to change your configuration - just the #include path.
This is a style issue though - some people prefer to have framework prefixes in their include paths, as its informative to know where a header was imported from …
@hsetlik Thanks for starting this thread and opening Not finding AudioUnitSDK files inside of juce_audio_plugin_client module · Issue #751 · McMartin/FRUT · GitHub.
As @reuk suggested, FRUT needs to be updated to handle the changes made in https://github.com/juce-framework/JUCE/commit/f8e91d400. I opened Support building AudioUnit plugins with the AudioUnitSDK by McMartin · Pull Request #753 · McMartin/FRUT · GitHub to fix the issue and I hope you can give it a try and tell me whether you can now successfully build an AU plugin. Thanks!
Thanks- yes I did end up switching to 7.0.2 and it works now