I’m also using CMake only for nearly a year now because it is so much easier to use from my point of view. Don’t know much about the current Projucer and I also barely use XCode but CLion as IDE and Ninja as build system instead, however I assume that there is a way to do it there. But from your post I’m not sure if you already understand the technical problem? Understanding that will likely help you understanding errors and finding the solution that fits your project best. So let me try to give a quick explanation:
So Apple decided to switch the CPU architecture for their computers from Intel x86_64 CPUs to their own “M1” chips which are based on an ARMv8 architecture. Code compiled for x86_64 won’t run on ARM (and also not the other way round). At the moment there are a lot of “old” x86_64 based macs still out there, so current mac software should be built twice, as an x86_64 version and as an ARM version. Since the usual user does not know anything about CPU architectures, Apple uses so called universal binaries, that means binaries actually containing two versions of the binary, one slice compiled for x86_64 and one slice for ARMv8.
The clang-based compiler toolchain used by XCode 12 makes it easy for you to compile your code as universal binary in one run, it will simply compile it twice and put together both binary slices into a universal binary. Now if you are linking to a third party library and are building a universal binary, the library you are linking against needs to be universal binary too – otherwise one slice of the binary won’t be complete.
If you are using XCode 12.2 or higher, it will offer you to build your project for “Any Mac” – this means it will attempt to build a universal binary. If you try that for an AAX plugin you will fail, since the AAX SDK as a dependency for that target is not configured to be built as universal binary at this time point, so it will fail to link to the non-existing ARMv8 slice at link time. Therefore you can build all your formats as universal binary, except for your AAX target which should be x86_64 only. With CMake all the magic is this single line
set_target_properties (myPlugin_AAX PROPERTIES OSX_ARCHITECTURES x86_64)
I’m quite sure that there is a similar option in the Projucer. You certainly don’t have to use CMake to do this. I hoped this helped you to get an idea what’s the problem. We will simply have to stick to this workaround until Avid releases a universal binary AAX sdk.