Adding custom-built .h & .cpp files to exported cmake files | CMake & AAX/AU/VST Exporting | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Adding custom-built .h & .cpp files to exported cmake files
September 5, 2021 - 1:23 pm
Member Since: June 2, 2014
Forum Posts: 46
sp_UserOfflineSmall Offline

Hi Will.

I wanted to make some changes to one of the classes in fxobjects.h (the EnvelopeFollower) in order to add some extra capability to configure more of the ZVAFilter's parameters from the plugin's GUI, but didn't wish to actually change the contents of fxobjects.h, so opted to create a custom implementation is a separate source file.

I added 3 files to the PluginObjects directory of the RackAFXProject, and added these to the Visual Studio solution. Building in RackAFX went fine, and I could load & run the plugin in RackAFX. On exporting the project to ASPiK (VST only) though, it seems that these newly added files weren't added to the \project_source\cmake\vst_cmake\CMakeLists.txt file in the ASPiK project.

On building the ASPiK sln file, I hit a linker issue "fatal error LNK1120: 1 unresolved externals"

I have found, that the newly added .h and .cpp files were copied across to the ASPiK project, and if I add these files to this generated CMakeLists.txt file, the linker stops complaining and will build the VST3 successfully. I'm experimenting with a lot of ideas with this plugin though, and am going through many iterations of exporting the ASPiK project. This works well actually (my git diff shows that it's quite easy to export a RackAFX project to ASPiK many times over, with only the pertinent changes, as well as the uniquely generated IDs in plugindescription.h, overwritten).

What I'd really like to know is, whether there is any way of informing RackAFX to include other source files than the standard ones to the CMakeLists.txt - I would have hoped that the list of files to compile would have been generated from the RackAFX Visual Studio project, but it appears to be more static than this. Clearly adding these files after exporting resolves the linker error, but having to do this repeatedly is far from ideal.


September 5, 2021 - 1:32 pm
Member Since: June 2, 2014
Forum Posts: 46
sp_UserOfflineSmall Offline

This might possibly have a root cause similar to the issue described here:

October 11, 2021 - 2:00 pm
Member Since: January 29, 2017
Forum Posts: 698
sp_UserOfflineSmall Offline

That is correct. On exporting, RackAFX will attempt to include files you added into Visual Studio. 

For more complex stuff, like adding 3rd party libraries, DLLs or LIBs, you will need to edit the CMake files yourself (it sucks, and the learning curve is not easy but there is no easy way around that). 


Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 2

Members: 786

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 853

Posts: 3385

Moderators: W Pirkle: 698