CMake Problem - issue compiling plugins

I’m trying to ease myself into writing a few basic plugins, using the cookiecutter repo I downloaded the simplegain plugin, for some reason the command from the tutorial cmake -B "build" -S . -DSC_PATH="/home/jordan/supercollider/" \ -DCMAKE_INSTALL_PREFIX="/home/jordan/.local/share/SuperCollider/Extensions" gives me this error:

  Ignoring extra path from command line:

   " -DCMAKE_INSTALL_PREFIX=/home/jordan/.local/share/SuperCollider/Extensions"


-- Found SuperCollider: /home/jordan/supercollider
-- Building plugins for SuperCollider version: 3.14.0-dev
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at CMakeLists.txt:42 (message):
  No install prefix provided, defaulting to $BUILD_DIR/install


-- Install directory set to: /home/jordan/simplegain/build/install
-- Added server plugin target SimpleGain_scsynth
-- Added server plugin target SimpleGain_supernova
-- Generating plugin targets done
-- Configuring done (1.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/jordan/simplegain/build 

And then installing also doesn’t work. I’m not quite sure why the “extra path from command line” is being ignored. One idea I had is that it’s because I’m on arch and installed sc with pacman rather than compiling from source, I do however have a copy of the source code as seen in the CMake command.

Any thoughts what’s going on here or what I’m doing wrong?

Cheers!
Jordan

I’m not too sure about the install directory, it looks correct to me, but you should just be able to manually copy the files and directories from /home/jordan/simplegain/build/install to wherever you like.

Does building work? That error would be very useful!

That should be fine.

Theoretically I can build and install:

[jordan@arch simplegain]$ cmake --build build --config "Release" --target install
[ 25%] Building CXX object CMakeFiles/SimpleGain_scsynth.dir/plugins/SimpleGain/SimpleGain.cpp.o
[ 50%] Linking CXX shared module SimpleGain_scsynth.so
[ 50%] Built target SimpleGain_scsynth
[ 75%] Building CXX object CMakeFiles/SimpleGain_supernova.dir/plugins/SimpleGain/SimpleGain.cpp.o
[100%] Linking CXX shared module SimpleGain_supernova.so
[100%] Built target SimpleGain_supernova
Install the project...
-- Install configuration: ""
-- Installing: /home/jordan/simplegain/build/install/Simple Gain/SimpleGain_scsynth.so
-- Installing: /home/jordan/simplegain/build/install/Simple Gain/SimpleGain_supernova.so
-- Installing: /home/jordan/simplegain/build/install/Simple Gain/Classes/SimpleGain.sc
-- Installing: /home/jordan/simplegain/build/install/Simple Gain/HelpSource/Classes/SimpleGain.schelp

However, it doesn’t seem to actually work, I certainly don’t see any proof of its existence when I try and use it as a UGen even after recompiling.

Have you added /home/jordan/simplegain/build/install/(or maybe it would be /home/jordan/simplegain/build/install/Simple Gain/) to the interpreters include path?
In the IDE go to preferences → edit → include. Alternatively you could copy and past the Simple Gain folder to /home/jordan/.local/share/SuperCollider/Extensions, assuming that is also in your include path.

You will have to restart the IDE after adding this line, for some reason recompiling doesn’t update it.

1 Like

This has worked! Thanks. Any idea how to do this from the cli, or in scnvim? I don’t mind opening the IDE but in my perfect world I’d be able do this a bit less manually.