Compiling extension on Windows

I am trying to compile this on Windows: GitHub - cianoc/cian-plugins
I am familiar with the process on Linux, but am not sure how do it on Windows. The documentation I have found online for compiling C++ on Windows seems unclear and inconsistent to me. Can anyone please offer me some guidance?

You can either use MSVC or GCC/Clang. For the latter, I would recommend to use Msys2 (https://www.msys2.org/).

First you have to pick the appropriate CMake generator (Visual Studio <version> <year> for MSVC resp. Unix Makefiles for Msys2). If you use cmake-gui, it will open a dialog where you can select the desired generator when you configure the project for the first time.

Then you just run cmake .. <options> and cmake --build . --config Release --target install from within your build folder as usual. If you use a Visual Studio solution, you can also open it in Visual Studio and build it from there.

If you don’t have Msys2 installed already, Visual Studio might be the easier way.

1 Like

Thanks for the help, but I think I’m missing some details.

I open cmake-gui > add entry > enter SC_PATH for name > enter c:/users/owner/git/supercollider for value > configure > visual studio 16 2019 > finish > generate > open developer command prompt for VS 2019 > cd c:\users/owner/git/cian-plugins-master > mkdir build > cd build > cmake -DSC_PATH="c:/users/owner/git/supercollider" -DSUPERNOVA=ON .. > cmake --build . --config Release --target install

The error message I get is ‘Error: could not load cache’

If I do cmake --build . --config Release --target install as the last step, I get:
MSBUILD : error MSB1009: Project file does not exist.
Switch: install.vcxproj

I also tried with MSYS64, but I don’t even complete the first step.

In cmake-gui, are you sure that “Where to build the binaries” points to the “build” folder? My suspicion is that you accidentally created the project files in the top level source folder.

cmake -DSC_PATH="c:/users/owner/git/supercollider" -DSUPERNOVA=ON ..

This step is unnecessary if you have already configured/generated the project with cmake-gui. After all, the point of cmake-gui is that you don’t have to use the command line :slight_smile:

It doesn’t matter; I still get:
MSBUILD : error MSB1009: Project file does not exist.
Switch: install.vcxproj

Dunno. But you can just open the Visual Studio solution and build from there.

Ah well, the project doesn’t have an install target… Just run cmake --build . --config Release and install manually.

BTW, you don’t have to run CMake from the Developer Command Prompt, you can use the regular command line and CMake will automatically invoke the correct tools.

1 Like

Thanks! Got it working. Turned out to be much more simple than I thought.