--------------------------------------------------------------------------------
Building VICE with CMake
--------------------------------------------------------------------------------

It is now possible to build VICE using CMake. Makefiles generated by CMake are
capable of greater parallelism with make -j than the autotools ones. You can
shave a second or two off the build time using ninja as well.

Configure the VICE sources with --enable-cmake. Do this in-tree as it won't work
via an external build folder.

--------------------------------------------------------------------------------
Linux / macOS Makefiles
--------------------------------------------------------------------------------

$ cd vice
$ ./autogen.sh
$ ./configure --enable-cmake <whatever configure arguments>
$ mkdir ../build
$ cd ../build
$ cmake ../vice
$ make -j

--------------------------------------------------------------------------------
macOS Xcode
--------------------------------------------------------------------------------

First make sure that your active development directory points to Xcode. To do
this, open Xcode preferences, and on the Locations tab make sure that "Command
Line Tools" is set to Xcode x.y.

$ cd vice
$ ./autogen.sh
$ ./configure --enable-cmake <whatever configure arguments>
$ mkdir ../build
$ cd ../build
$ cmake -G Xcode ../vice
$ open VICE.xcodeproj

--------------------------------------------------------------------------------
Windows MSYS2
--------------------------------------------------------------------------------

When using cmake to build on MSYS2, you'll need to first make bindist using the
regular build system. Then you can copy the built executables into the bindist
folder for testing. For example:

$ cd vice
$ rm -rf GTK3VICE-*
$ ./autogen.sh
$ ./configure --enable-cmake <whatever configure arguments>
$ make -j
$ make bindist
$ make clean
$ mkdir ../build
$ cd ../build
$ cmake -G "MSYS Makefiles" -DCMAKE_PREFIX_PATH="$(gcc -print-search-dirs | grep ^libraries | sed 's/^.*=//')" ../vice
$ make -j
$ cp $(find src -type f -executable) $(find ../vice -name 'GTK3VICE-*')/bin/