Issue with VST 3.8.0 and CMake

I tried to upgrade my framework and ran into an issue with CMake. I then used VST3 Project Generator included with the SDK to make sure this is not my problem, and indeed I am seeing the exact same problem (as you can see in the screenshot)

I am on macOS (14.7.7). Using “Unix Makefiles” as the generator fails with the error message:

CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_OBJCXX_COMPILE_OBJECT

Note that using VST 3.7.14 (previous version) with “Unix Makefiles” work fine with the same version of CMake. Using “Xcode” as the generator with 3.8.0 works.

As far as I know, we don’t support building with make on macOS. But I also cannot think of any change we made that leads to this error.

At least it doesn’t look like it was intentional… I guess I will try to investigate what broke this. During development, using CLion, it is much faster/easier to use make than Xcode

ObjectiveC is used in vstgui.

Something has changed in vstgui, a direct call to enable_language(OBJCXX). This should work, except that from the enable_language documentation, this must not be called from a function (“It must be called in file scope, not in a function call”).

When VSTGUI is used from the vst sdk in a project generated by the project generator, it ends up being enabled (in CMake) via a call to a function smtg_enable_vstgui_support and I believe that is why it doesn’t work.

Anyway, adding

project(MyPlugin380
    # This is your plug-in version number. Change it here only.
    # Version number symbols usable in C++ can be found in
    # source/version.h and ${PROJECT_BINARY_DIR}/projectversion.h.
    VERSION 1.0.0.0 
    DESCRIPTION "MyPlugin380 VST 3 Plug-in"
)
if(SMTG_MAC)
  enable_language(OBJCXX)
endif()

fixes this problem…

Hmm, good catch, but strange that this only happens when using the make generator.

Just another question, when you say that you use CLion for building. Does CLion produce workable VST3 plug-ins out of the box with the VST3 SDK?

I agree it is strange that it works with Xcode, but maybe the Xcode generator simply enables Objective C no matter what…

CLion understands CMake natively and so if you tell it to build the main target, then yes it produces a workable VST3 plug-ins because it simply delegates to CMake to do the build.

What I mean is, we setup so much things with cmake only when the Xcode generator is used, like signing or support for AudioUnit. For example on Apple Silicon systems you cannot run anything when it is not properly signed. As far as I can see, we only do this with the Xcode generator. How does this work with CLion?

I am sorry I did not understand your question. During development I use CLion because it is much faster to build/deploy and test locally (and use “Unix Makefiles” for the generator).

But for release you are correct that I use the command line and the XCode generator so that the rest can be done (like building the audio unit, multiple architecture, etc…)