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
libprotobufproject, open the filezero_copy_stream_impl_light.ccunderSources -
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
DebugtoReleasein the menu at the top of the screen -
Right click
libprotobufand chooseBuild -
Do the same for
protoc -
There should now be a folder called
Releasewithin thevsprojectsfolder 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.hwith 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
CMakewhich you downloaded before Where is the source code: Set this to the root folder of Alice, thedepsfolder should be in itWhere to build the binaries: Set this to the same folder as above and appenedbuild/- Press
Configureat the bottom - Select
Visual Studio 2012and 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
BUILDand tickBUILD_EXAMPLE - Last but not least, press
Generate
- After you generated the MSVC project files, open the file
ALL_BUILDin thebuilddirectory - Select
Releasefrom the menu on the top - Right-click
ALL_BUILDin the project menu and selectBuild - That's it, you should be able to run the example / work with the library now