-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL.txt
157 lines (123 loc) · 6.64 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
GUIDE TO BUILDING THE EITOOLKIT
========================================================================
The EIToolkit uses CMake as its build system on all supported platforms. This
guide will explain to you how to use CMake to build the EIToolkit from source.
1. What is CMake?
-------------------
CMake is a cross-platform build system - or perhaps more accurately a
build configurator. It is a program which, from a set of CMake scripts,
creates a native build system for your platform that allows you to
build the EIToolkit.
The build process is configurable via CMake. The EIToolkit provides several
options which you can use to customise your build.
2. Getting CMake
------------------
CMake is available from http://www.cmake.org (Resources -> Downloads).
You can get its sources, but there are precompiled binaries for all
platforms. Furthermore, if you are on a Linux system, chances are high
that your distributor offers a package for CMake. You need a CMake
version >= 2.8.6.
For Ubuntu type the following in a terminal to install CMake:
> sudo apt-get install cmake-qt-gui
3. Getting dependencies
-------------------------
The EIToolkit requires the boost library, but there are other dependencies for
the bindings and other encodings. You can get source or binary packages for
each from their respective websites listed below.
Linux distributions usually offer packages for each dependency. On Ubuntu
Precise, the following command will install the dependencies for the core library: (+)
> sudo apt-get install build-essential libboost-system-dev libboost-thread-dev
If you cannot obtain prebuilt binaries of a dependency for your platform,
please refer to the list below and get a source package from the website,
then build it according to its documentation.
Required dependencies:
* Boost: http://www.boost.org (++)
Optional dependencies:
* Doxygen (for the API documentation): http://www.stack.nl/~dimitri/doxygen/
* Swig (for the bindings): http://www.swig.org/
* A JDK (for the Java bindings): http://www.oracle.com/technetwork/java/javase/downloads/index.html (+++)
* A CSharp compiler: Mono or the C# Compiler from Visual Studio
(+) Warning: If you want to build the examples, you need boost-chrono, i.e. you
need the 1.48 version of all the boost libs:
libboost-system1.48-dev libboost-thread1.48-dev libboost-chrono1.48-dev
(++) Only the boost-system library is required, and the boost-chrono library
for the examples. If your compiler doesn't support the <thread> header,
you also need the boost-thread library.
For Visual C++ you can find binary installers at http://www.boostpro.com.
Install the "Multithreaded" and "Multithreaded debug" versions.
(+++) On Windows get the 32-bit Java SE Development Kit 6.
4. Preparing the build environment
------------------------------------
You should now create a build directory for the EIToolkit somewhere outside
the EIToolkit's sources. This is the directory where CMake will create the
build system for your chosen platform and compiler, and this is also
where the EIToolkit libraries will be compiled. This way, the EIToolkit source
directory stays clean, and you can have multiple build directories all
working from the same EIToolkit source.
5. Running CMake
------------------
Now start the program cmake-gui by either typing the name in a console
or selecting it from the start menu. In the field 'Where is the source
code' enter the path to the EIToolkit source directory (the directory which
contains this file). In the field 'Where to build the binaries' enter
the path to the build directory you created in step 4.
Hit 'Configure'. A dialog will appear asking you to select a generator.
Choose the appropriate one for your platform and compiler. On Unix, you
most likely want to use 'Unix Makefiles'; for Visual Studio select the
appropriate version and platform (Win32 | Win64); on Apple use Xcode.
Click 'Finish'. CMake will now gather some information about your
build environment and try to locate the dependencies (+).
Then you can select the options you want to enable.
Warning: Some options are only visible if other options are selected. You
must run CMake again for those to appear.
If everything worked correctly, you can now click 'Generate' to generate
the project files.
(+) If you receive errors about dependencies not being found even though
you have successfully installed or compiled them in step 3, you may
need to tell CMake where to look. On Unix platforms, CMake should usually
be able to pick up all the dependencies if they are installed in standard
locations. Once you are done, hit 'Configure' again.
6. Building the EIToolkit
---------------------------
Go to your chosen build directory. CMake has generated a build system for
you which you will now use to build the EIToolkit. If you are using Visual Studio,
you should find the file EIToolkit.sln there. Open it and compile the target
'BUILD_ALL'. Similarly you will find an Xcode project to build the EIToolkit
on MacOS. If you are using a Makefile generator, then instead open a
console and cd to your build directory, then call the appropriate make
program. E. g. on Linux type
> make
to start the build process.
If you have doxygen installed and CMake picked it up, then there will
be an additional build target called doc which you can optionally build.
This will freshly generate the API documentation for the EIToolkit's classes from
the header files. In Visual Studio just select and build the target
'DOC', on Linux type:
> make doc
7. Installing the EIToolkit
-----------------------------
Once the build is complete, you can optionally have the build system
copy the built libraries and headers to a clean location. We recommend
you do this step as it will make it easier to use the EIToolkit in your projects.
In Visual Studio just select and build the target 'INSTALL'.
For Makefile-based generators type:
> make install (or sudo make install, if root privileges are required)
On Linux the EIToolkit will by default be installed to /usr/local; on Windows
to the Program Files folder. You can change the install location by changing
the variable CMAKE_INSTALL_PREFIX in CMake.
8. Using the EIToolkit
------------------------
You don't need to install the EIToolkit to use it in your own projects.
CMake will automatically pick up the version from the build directory.
You just need to use the following CMakeLists.txt file. It will create
a project named Example with a binary named example from the example.cpp
source file.
cmake_minimum_required(VERSION 2.6)
project(Example)
find_package(EIToolkit REQUIRED)
include_directories(${EIToolkit_INCLUDE_DIR})
add_executable(example example.cpp)
target_link_libraries(example EIToolkit)
9. Credits
------------
Shamelessly copied from Ogre3D.