README.cmake 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. How to build freeglut with CMake on Windows (MS Visual Studio)
  2. --------------------------------------------------------------
  3. 1. Download CMake (http://www.cmake.org/cmake/resources/software.html).
  4. Get one of the releases from the binary distribution section.
  5. 2. Run the CMake installer, install wherever you like.
  6. 3. 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!)
  9. 4. 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).
  12. 5. 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.
  15. 6. Hit the Configure button near the bottom of the window.
  16. 7. Pick your target compiler, make sure that its installed on your
  17. system of course!
  18. 8. Answer Ok when asked if you want to create the build directory.
  19. 9. Wait for the configure process to finish.
  20. 10. 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.
  24. 11. The Generate button at the bottom will now be enabled. Click Generate.
  25. 12. The build files will now be generated in the location you picked.
  26. You can now navigate to the build directory you specified in step 5.
  27. Open the freeglut.sln file that was generated in your build directory,
  28. and compile as usual
  29. How to build freeglut on UNIX
  30. -----------------------------
  31. - Make sure you have cmake installed. Examples:
  32. - Debian/Ubuntu: apt-get install cmake
  33. - Fedora: yum install cmake
  34. - FreeBSD: cd /usr/ports/devel/cmake && make install
  35. Or directly from their website:
  36. http://www.cmake.org/cmake/resources/software.html
  37. - Make sure you have the basics for compiling code, such as C compiler
  38. (e.g., GCC) and the make package.
  39. - Also make sure you have packages installed that provide the relevant
  40. header files for x11 (including xrandr) and opengl (e.g.,
  41. libgl1-mesa-dev, libx11-dev and libxrandr-dev on Debian/Ubuntu).
  42. - Install XInput: libxi-dev / libXi-devel
  43. - Run 'cmake .' in the freeglut directory to generate the makefile.
  44. - Run 'make' to build, and 'make install' to install freeglut.
  45. - If you wish to change any build options run 'ccmake .'
  46. Breakdown of CMake configuration options
  47. ----------------------------------------
  48. CMAKE_BUILD_TYPE [Empty, Debug, Release] Can be overriden by
  49. passing it as a make variable during build.
  50. CMAKE_INSTALL_PREFIX Installation prefix (e.g. /usr/local on UNIX)
  51. FREEGLUT_BUILD_DEMOS [ON, OFF] Controls whether the demos are
  52. built or not.
  53. FREEGLUT_BUILD_SHARED_LIBS [ON, OFF] Build freeglut as a shared library
  54. FREEGLUT_BUILD_STATIC_LIBS [ON, OFF] Build freeglut as a static library
  55. FREEGLUT_GLES [ON, OFF] Link with GLEs libraries instead
  56. of OpenGL
  57. FREEGLUT_PRINT_ERRORS [ON, OFF] Controls whether errors are
  58. default handled or not when user does not
  59. provide an error callback
  60. FREEGLUT_PRINT_WARNINGS [ON, OFF] Controls whether warnings are
  61. default handled or not when user does not
  62. provide an warning callback
  63. FREEGLUT_REPLACE_GLUT [ON, OFF] For non-Windows platforms,
  64. freeglut is by default built as -lglut. if
  65. off, built as -lfreeglut. On Windows,
  66. libraries are always built as freeglut.
  67. INSTALL_PDB [ON, OFF] MSVC only: controls whether debug
  68. information files are included with the
  69. install or not