You don't need to open Visual Studio or any IDE to compile the executables.
Download cmake and make sure Visual C compiler is installed.
Unzip the .zip file, open a command prompt where the readme
and CMakeLists.txt
reside
Then, as the readme states:
run these commands in the source directory:
cmake .
cmake --build .
In the Debug
directory, you'll find a lot of .exe
files.
Then, to install in the simplest way on Linux or Mac:
cmake --build . --target install
I didn't need that part. I suppose that it copies the executables & other files somewhere in the path.
Problem with creating a distro using Microsoft compiler is that the executables then require a lot of Microsoft runtime DLLs. For instance if you deploy the executables on other machines it may not work.
An alternative is to use gcc
and make
to build the executables.
First:
- install a recent gcc for windows
- install
make
Installing a recent MinGW distribution should do it. Personally I used another gcc distribution so I had to grab make
too.
Now, I followed Setting default compiler in CMake, the key part being to enable mingw makefiles: -G "MinGW Makefiles"
, else cmake ignores your compiler requirements and keeps on using Microsoft compiler.
cmake -DCMAKE_MAKE_PROGRAM=/path/to/make/make.exe -DCMAKE_C_COMPILER=/path/to/gcc/gcc.exe -G "MinGW Makefiles" .
Note that specifying full paths require that /
are used. Backslashes conflict with escaping in cmake/make files.
Then
cmake --build .