From faf168cbee0a7fa7ce5ec8f71300feb0c9e15087 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Nov 2010 12:35:45 +0000 Subject: Document CMake build instructions. --- index.html | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 93 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 2682711a..4e395b13 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,8 @@ Mesa Demos Distribution +

Introduction

@@ -36,12 +39,12 @@ site.

The Mesa demos git repository can be obtained with:

-  git clone git://anongit.freedesktop.org/git/mesa/demos
+git clone git://anongit.freedesktop.org/git/mesa/demos
 
Or, if you're a developer:
-  git clone git+ssh://USERNAME@git.freedesktop.org/git/mesa/demos
+git clone git+ssh://USERNAME@git.freedesktop.org/git/mesa/demos
 

@@ -50,7 +53,7 @@ Or, if you're a developer:

Building

-The Mesa demos can be built with autoconf or +The Mesa demos can be built with autoconf, CMake, or SCons.

@@ -59,15 +62,22 @@ The Mesa demos can be built with autoconf or

You'll need glew version 1.5.4 -or later and glut or freeglut (runtime libraries and header files). +or later and glut or freeglut (runtime libraries and header files).

If you're using an RPM-based Linux distro you can install these items with:

-  yum install glew glew-devel
-  yum install freeglut freeglut-devel
+yum install glew glew-devel
+yum install freeglut freeglut-devel
+
+ +

+And if you're using a Debian based Linux distro you can install these items with: +

+
+apt-get install libglew-dev freeglut3-dev
 
@@ -85,10 +95,86 @@ Otherwise, just run ./configure ; make to build the demos. +

CMake

+ +

+See the CMake documentation for more information about CMake. +

+ +

Unix

+ +

+Run: +

+
+cmake .
+make
+
+ +

MSVC

+ + + +

MinGW cross-compilation

+ +

+Create a Toolchain.cmake file containing: +

+
+# the name of the target operating system
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# which compilers to use for C and C++
+SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+
+# here is the target environment located
+SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+ +

+Create a Cache.cmake file containing: +

+
+set(GLEW_INCLUDE_DIR "/path/to/glew/include" CACHE PATH "" FORCE)
+set(GLEW_glew_LIBRARY "/path/to/glew/lib/libglew32.a" CACHE FILEPATH "" FORCE)
+
+set(GLUT_INCLUDE_DIR "/path/to/glut/include" CACHE PATH "" FORCE)
+set(GLUT_glut_LIBRARY "/path/to/glut/lib/libglut32.a" CACHE FILEPATH "" FORCE)
+
+ +

+Then do: +

+
+cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain.cmake -C /path/to/Cache.cmake
+make
+make install
+
+ +

+Read this for more information about CMake and MinGW cross compilation. +

+

SCons

-Just run cons to build with SCons. +Just run scons to build with SCons.

XXX more info? -- cgit v1.2.3