Building Alice is very straightforward for people who have used CMake before and know their way around C++, there are a few things that need to be patched in the 3rd party software though.
First of all, download the following dependencies:
Put boost, snappy and protobuf in the deps
directory. We only use a few boost headers so building boost is not
nessecary.
-
Open the file vsprojects/protobuf.sln with MSVC
-
It will ask you to convert/upgrade the project, you can ignore any errors that pop-up as long as the project opens
-
In the
libprotobuf
project, open the filezero_copy_stream_impl_light.cc
underSources
-
Put
#include <algorithm>
into line 35. It should look like this:// Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. #include <algorithm> // This is the new line #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/stl_util.h>
-
Switch from
Debug
toRelease
in the menu at the top of the screen -
Right click
libprotobuf
and chooseBuild
-
Do the same for
protoc
-
There should now be a folder called
Release
within thevsprojects
folder that contains the build library, just let it sit there, you don't need to move it
-
You don't need to build Snappy directly, it is build alongside Alice
-
Open the file
snappy.h
with any editor, and edit lines 42 - 48 so they look like this:#include <stddef.h> #include <string> #include <BaseTsd.h> // this is new typedef SSIZE_T ssize_t; // this is also new #include "snappy-stubs-public.h"
-
That's it, Snappy can now be build with Alice.
- Open
CMake
which you downloaded before Where is the source code
: Set this to the root folder of Alice, thedeps
folder should be in itWhere to build the binaries
: Set this to the same folder as above and appenedbuild/
- Press
Configure
at the bottom - Select
Visual Studio 2012
and press okay - If it can't find any dependencies it will let you know; check the earlier steps to see if you missed something
- If you want to build the example, click on
BUILD
and tickBUILD_EXAMPLE
- Last but not least, press
Generate
- After you generated the MSVC project files, open the file
ALL_BUILD
in thebuild
directory - Select
Release
from the menu on the top - Right-click
ALL_BUILD
in the project menu and selectBuild
- That's it, you should be able to run the example / work with the library now