Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown cmake command “smtg_add_vst3plugin” #20

Closed
LamebrainEddy opened this issue Nov 7, 2018 · 5 comments
Closed

Unknown cmake command “smtg_add_vst3plugin” #20

LamebrainEddy opened this issue Nov 7, 2018 · 5 comments

Comments

@LamebrainEddy
Copy link

LamebrainEddy commented Nov 7, 2018

Followed the vst3sdk wiki to the letter and have compiled the example build from vst3sdk>cmakelists.txt with no issue.

However when attempting to do the same on both other projects and the helloworld plugin example from older versions of the vst sdk, I get the error as in the title and the following post:

#4

Namely:
Unknown cmake command “smtg_add_vst3plugin”

From what I can gather this is referencing a cmake command inside the cmake modules folder of the sdk
[vst3sdk>cmake>modules]

However I have next to no idea what the fix is for this. Addionally, the user meem40 says he fixed this issue here:
#4 (comment)

However I have no idea what he means by this solution.

Can anyone point me in the right direction here?
Thanks

@aclex
Copy link

aclex commented Nov 7, 2018

@LamebrainEddy do you use the clone of this repo, when trying to build the projects which fail? If so, did you happen to try git submodule update --recursive (just an idea, as cmake directory seems to be submodule)? Could you also check, that include(AddVST3Library) is there in projects' CMakeLists.txt and CMAKE_MODULE_PATH references the cmake/modules directory if the repository correctly (e.g. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "path-to-cmake-modules-of-the-repo-here")?

@LamebrainEddy
Copy link
Author

LamebrainEddy commented Nov 9, 2018

Thanks for your help on this matter

I'm not too clear on what you mean here - neither of those things seem to exist in the CMakeLists.txt file, however this is a steinberg supplied example so I am confused as to why it would be missing anything that is key to it's operation?

I added your include() line to the file (before the smtg call) and it gives me the response that it "cannot find the load file AddVST3Library". So I assume that the cmake include command is searching a PATH for certain modules somewhere - however I don't know where this path is.

For clarity here is the original CMakeLists.txt file:
`
set(plug_sources
include/plugcontroller.h
include/plugids.h
include/plugprocessor.h
include/version.h
source/plugfactory.cpp
source/plugcontroller.cpp
source/plugprocessor.cpp
)

#--- HERE change the target Name for your plug-in (for ex. set(target myDelay))-------
set(target helloworld)

smtg_add_vst3plugin(${target} ${SDK_ROOT} ${plug_sources})
set_target_properties(${target} PROPERTIES ${SDK_IDE_MYPLUGINS_FOLDER})
target_link_libraries(${target} PRIVATE base sdk)

if(MAC)
smtg_set_bundle(${target} INFOPLIST "${CMAKE_CURRENT_LIST_DIR}/resource/Info.plist" PREPROCESS)
elseif(WIN)
target_sources(${target} PRIVATE resource/plug.rc)
endif()
`

This file is located inside the steinberg named "helloworld" folder, with the vst3sdk folder located at the same folder level.

PS: apologies I can't seem to make the above format to code and not plain text

@aclex
Copy link

aclex commented Nov 19, 2018

@LamebrainEddy sorry me for the delay, but if the problem is still relevant, I've experimented here a little bit and, I think, the best I can suggest you is to create a directory at ./public.sdk/samples/vst of the clone of this repository with just the same CMakeLists.txt file, as you wrote, inside — then it just compiles for me (though blames for bad source files, as I just put an empty .cpp as a source).

If you planned to create an external project (i.e. somewhere else, out of repository tree), to have it depend to VST3 SDK, then, I'm afraid, this is a question for me, too. I've tried to quickly find out, where it installs stuff, but there's surprisingly no install target in my fresh build, perhaps, I miss something. Generally, you'd just want to find the path to SDK and use its includes. You also can just copy those smtg_ macros e.g. to custom module path of your project, if you like/need them, but you can also not use them in this case.

@LamebrainEddy
Copy link
Author

@aclex likewise apologies, I have done this and it compiles as said, however could you explain what changes this makes to general use of VST and cmake?

By this I mean I have some other projects which I assume I copy the same folder, where am I then targeting the Windows cmake command? I note that compiling the 'root' cmakelists.txt file in the vst3sdk folder also seems to compile those in the public sdk folder, what would your recommended shell command be to compile projects that I copy to public.sdk? Thanks for all your help with this

@aclex
Copy link

aclex commented Nov 28, 2018

@LamebrainEddy yes, sure: to make all these CMake instructions work you actually want to reproduce the CMake context this exact folder has. This, for example, means included modules, definitions etc.

You can start by copying the vst3sdk (this repo) directory, open its CMakeLists.txt file and remove parts you don't need (I'd start with add_directory instructions) to finally come to some bare minimum. Then go down to samples subdirectory and repeat the procedure, then to vst subdirectory in it. Finally you can put all the CMakeLists.txt files content to one file of your example.

Another way is to put your plugin directory somewhere, open its CMakeLists.txt and add lines from the corresponding file of vst3sdk to it one by one (or more portions) to see what happens. But you might need then to also copy some directories with header files, CMake modules or something. I think, the first way is easier to follow.

The essential idea of CMake here is quite simple: the settings in CMakeLists.txt files of all the parent directories in hierarchy affect the context of CMakeLists.txt in the current directory, but content of CMakeLists.txt in current directory has no affect (generally) to its upper directories. I'd also suggest to consult CMake documentation in confusing cases, it's quite detailed and straightforward.

@ygrabit ygrabit closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants