1 How to build freeglut with CMake on Windows (MS Visual Studio)
\r
2 --------------------------------------------------------------
\r
3 1. Download CMake (http://www.cmake.org/cmake/resources/software.html).
\r
4 Get one of the releases from the binary distribution section.
\r
5 2. Run the CMake installer, install wherever you like.
\r
6 3. Launch CMake via Start > Program Files > CMake 2.8 > CMake (GUI)
\r
7 (note that the shortcut put by the installer on your desktop does NOT
\r
8 point to the CMake GUI program!)
\r
9 4. In the "Where is the source code" box, type or browse to the root
\r
10 directory of your freeglut source (so that's /freeglut, not
\r
12 5. In the "Where to build the binaries" box, type or browse to any
\r
13 folder you like - this will be where the Visual Studio solution will be
\r
14 generated. This folder does not have to exist yet.
\r
15 6. Hit the Configure button near the bottom of the window.
\r
16 7. Pick your target compiler, make sure that its installed on your
\r
18 8. Answer Ok when asked if you want to create the build directory.
\r
19 9. Wait for the configure process to finish.
\r
20 10. The screen will now have some configuration options on it, for
\r
21 instance specifying whether you want to build static and/or shared
\r
22 libraries (see below for a complete list). When you've selected your
\r
23 options, click the Configure button again.
\r
24 11. The Generate button at the bottom will now be enabled. Click Generate.
\r
25 12. The build files will now be generated in the location you picked.
\r
27 You can now navigate to the build directory you specified in step 5.
\r
28 Open the freeglut.sln file that was generated in your build directory,
\r
29 and compile as usual
\r
32 How to build freeglut on UNIX
\r
33 -----------------------------
\r
34 - Make sure you have cmake installed. Examples:
\r
35 - Debian/Ubuntu: apt-get install cmake
\r
36 - Fedora: yum install cmake
\r
37 - FreeBSD: cd /usr/ports/devel/cmake && make install
\r
38 Or directly from their website:
\r
39 http://www.cmake.org/cmake/resources/software.html
\r
40 - Make sure you have the basics for compiling code, such as C compiler
\r
41 (e.g., GCC) and the make package.
\r
42 - Also make sure you have packages installed that provide the relevant
\r
43 header files for x11 (including xrandr) and opengl (e.g.,
\r
44 libgl1-mesa-dev, libx11-dev and libxrandr-dev on Debian/Ubuntu).
\r
45 - Install XInput: libxi-dev / libXi-devel
\r
46 - Run 'cmake .' in the freeglut directory to generate the makefile.
\r
47 - Run 'make' to build, and 'make install' to install freeglut.
\r
48 - If you wish to change any build options run 'ccmake .'
\r
51 Breakdown of CMake configuration options
\r
52 ----------------------------------------
\r
53 BUILD_SHARED_LIBS [ON, OFF] Build freeglut as a shared library
\r
54 BUILD_STATIC_LIBS [ON, OFF] Build freeglut as a static library
\r
55 CMAKE_BUILD_TYPE [Empty, Debug, Release] Can be overriden by passing it
\r
56 as a make variable during build.
\r
57 CMAKE_INSTALL_PREFIX Installation prefix (e.g. /usr/local on UNIX)
\r
58 FREEGLUT_BUILD_DEMOS [ON, OFF] Controls whether the demos are built or not.
\r
59 FREEGLUT_GLES1 [ON, OFF] TODO
\r
60 FREEGLUT_GLES2 [ON, OFF] TODO
\r