Building the FreeGLUT libraries is really trivial with the relatively recent support of CMake, so I’m posting it here only for my own reference to be honest. If you are looking for the pre-built binaries of FreeGLUT see binaries page.


Preparation

Of course you need CMake and Visual Studio, as well as the FreeGLUT source code. I use the SVN trunk:

svn co https://freeglut.svn.sourceforge.net/svnroot/freeglut/trunk/freeglut/freeglut glut-src

FreeGLUT 32-bit

In a VS2010 32-bit command prompt do the following:

cd glut-src
mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=./glut ^
      -DCMAKE_BUILD_TYPE=Debug -DFREEGLUT_BUILD_DEMOS=OFF ../
nmake
nmake install
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=./glut ^
      -DCMAKE_BUILD_TYPE=Release -DFREEGLUT_BUILD_DEMOS=OFF ../
nmake
nmake install

The 32-bit version of FreeGLUT will end up in glut-src\build\glut.

In a VS2010 64-bit command prompt do the following:

mkdir build64
cd build64
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=./glut64 ^
      -DCMAKE_BUILD_TYPE=Debug -DFREEGLUT_BUILD_DEMOS=OFF ../
nmake
nmake install
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=./glut64 ^
      -DCMAKE_BUILD_TYPE=Release -DFREEGLUT_BUILD_DEMOS=OFF ../
nmake
nmake install

The 64-bit version of FreeGLUT will end up in glut-src\build64\glut64.

0