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 opengl (e.g., libgl1-mesa-dev on Debian/Ubuntu) and
\r
44 the chosen backend :
\r
45 - X11: x11 (e.g., libx11-dev, libxrandr-devel on Debian/Ubuntu) and
\r
46 XInput (libxi-dev / libXi-devel)
\r
47 - Wayland: wayland (e.g., libwayland-dev and libegl1-mesa-dev on
\r
48 Debian/Ubuntu) and xkbcommon (libxkbcommon-dev /libxkbcommon-devel)
\r
49 - Run 'cmake .' (or 'cmake . -DFREEGLUT_WAYLAND=ON' for Wayland) in the
\r
50 freeglut directory to generate the makefile.
\r
51 - Run 'make' to build, and 'make install' to install freeglut.
\r
52 - If you wish to change any build options run 'ccmake .'
\r
55 Breakdown of CMake configuration options
\r
56 ----------------------------------------
\r
57 CMAKE_BUILD_TYPE [Empty, Debug, Release] Can be overriden by
\r
58 passing it as a make variable during build.
\r
59 CMAKE_INSTALL_PREFIX Installation prefix (e.g. /usr/local on UNIX)
\r
60 FREEGLUT_BUILD_DEMOS [ON, OFF] Controls whether the demos are
\r
62 FREEGLUT_BUILD_SHARED_LIBS [ON, OFF] Build freeglut as a shared library
\r
63 FREEGLUT_BUILD_STATIC_LIBS [ON, OFF] Build freeglut as a static library
\r
64 FREEGLUT_GLES [ON, OFF] Link with GLEs libraries instead
\r
66 FREEGLUT_WAYLAND [ON, OFF] Link with Wayland libraries instead
\r
68 FREEGLUT_PRINT_ERRORS [ON, OFF] Controls whether errors are
\r
69 default handled or not when user does not
\r
70 provide an error callback
\r
71 FREEGLUT_PRINT_WARNINGS [ON, OFF] Controls whether warnings are
\r
72 default handled or not when user does not
\r
73 provide an warning callback
\r
74 FREEGLUT_REPLACE_GLUT [ON, OFF] For non-Windows platforms,
\r
75 freeglut is by default built as -lglut. if
\r
76 off, built as -lfreeglut. On Windows,
\r
77 libraries are always built as freeglut.
\r
78 INSTALL_PDB [ON, OFF] MSVC only: controls whether debug
\r
79 information files are included with the
\r