1How to build freeglut with CMake on Windows (MS Visual Studio) 2-------------------------------------------------------------- 31. Download CMake (http://www.cmake.org/cmake/resources/software.html). 4 Get one of the releases from the binary distribution section. 52. Run the CMake installer, install wherever you like. 63. Launch CMake via Start > Program Files > CMake 2.8 > CMake (GUI) 7 (note that the shortcut put by the installer on your desktop does NOT 8 point to the CMake GUI program!) 94. In the "Where is the source code" box, type or browse to the root 10 directory of your freeglut source (so that's /freeglut, not 11 /freeglut/src). 125. In the "Where to build the binaries" box, type or browse to any 13 folder you like - this will be where the Visual Studio solution will be 14 generated. This folder does not have to exist yet. 156. Hit the Configure button near the bottom of the window. 167. Pick your target compiler, make sure that its installed on your 17 system of course! 188. Answer Ok when asked if you want to create the build directory. 199. Wait for the configure process to finish. 2010. The screen will now have some configuration options on it, for 21 instance specifying whether you want to build static and/or shared 22 libraries (see below for a complete list). When you've selected your 23 options, click the Configure button again. 2411. The Generate button at the bottom will now be enabled. Click Generate. 2512. The build files will now be generated in the location you picked. 26 27You can now navigate to the build directory you specified in step 5. 28Open the freeglut.sln file that was generated in your build directory, 29and compile as usual 30 31 32How to build freeglut on UNIX 33----------------------------- 34- Make sure you have cmake installed. Examples: 35 - Debian/Ubuntu: apt-get install cmake 36 - Fedora: yum install cmake 37 - FreeBSD: cd /usr/ports/devel/cmake && make install 38 Or directly from their website: 39 http://www.cmake.org/cmake/resources/software.html 40- Make sure you have the basics for compiling code, such as C compiler 41 (e.g., GCC) and the make package. 42- Also make sure you have packages installed that provide the relevant 43 header files for opengl (e.g., libgl1-mesa-dev on Debian/Ubuntu) and 44 the chosen backend : 45 - X11: x11 (e.g., libx11-dev, libxrandr-devel on Debian/Ubuntu) and 46 XInput (libxi-dev / libXi-devel) 47 - Wayland: wayland (e.g., libwayland-dev and libegl1-mesa-dev on 48 Debian/Ubuntu) and xkbcommon (libxkbcommon-dev /libxkbcommon-devel) 49- Run 'cmake .' (or 'cmake . -DFREEGLUT_WAYLAND=ON' for Wayland) in the 50 freeglut directory to generate the makefile. 51- Run 'make' to build, and 'make install' to install freeglut. 52- If you wish to change any build options run 'ccmake .' 53 54 55Breakdown of CMake configuration options 56---------------------------------------- 57CMAKE_BUILD_TYPE [Empty, Debug, Release] Can be overriden by 58 passing it as a make variable during build. 59CMAKE_INSTALL_PREFIX Installation prefix (e.g. /usr/local on UNIX) 60FREEGLUT_BUILD_DEMOS [ON, OFF] Controls whether the demos are 61 built or not. 62FREEGLUT_BUILD_SHARED_LIBS [ON, OFF] Build freeglut as a shared library 63FREEGLUT_BUILD_STATIC_LIBS [ON, OFF] Build freeglut as a static library 64FREEGLUT_GLES [ON, OFF] Link with GLEs libraries instead 65 of OpenGL 66FREEGLUT_WAYLAND [ON, OFF] Link with Wayland libraries instead 67 of X11 68FREEGLUT_PRINT_ERRORS [ON, OFF] Controls whether errors are 69 default handled or not when user does not 70 provide an error callback 71FREEGLUT_PRINT_WARNINGS [ON, OFF] Controls whether warnings are 72 default handled or not when user does not 73 provide an warning callback 74FREEGLUT_REPLACE_GLUT [ON, OFF] For non-Windows platforms, 75 freeglut is by default built as -lglut. if 76 off, built as -lfreeglut. On Windows, 77 libraries are always built as freeglut. 78INSTALL_PDB [ON, OFF] MSVC only: controls whether debug 79 information files are included with the 80 install or not 81