Browse Source

doc: building documentation updates.

* Using portable `cmake --build` instead of `make`.
 * Mentioning all crosscompiling Arch PKGBUILDs.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
20ee86be86
  1. 105
      doc/building.dox

105
doc/building.dox

@ -69,7 +69,7 @@ assuming you have at least basic knowledge of CMake.
On Unix-based OSs, the library (for example with support for GLUT applications) On Unix-based OSs, the library (for example with support for GLUT applications)
can be built and installed using these four commands: can be built and installed using these four commands:
mkdir -p build && cd build mkdir build && cd build
cmake .. \ cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_GLUTAPPLICATION=ON -DWITH_GLUTAPPLICATION=ON
@ -102,8 +102,7 @@ The most straightforward way to build and install the library is again via the
command-line. The bonus point is that you don't even need to wait for Visual command-line. The bonus point is that you don't even need to wait for Visual
Studio to load: Studio to load:
mkdir build mkdir build && cd build
cd build
cmake -DCMAKE_INSTALL_PREFIX="C:/Sys" .. cmake -DCMAKE_INSTALL_PREFIX="C:/Sys" ..
cmake --build . cmake --build .
cmake --build . --target install cmake --build . --target install
@ -317,8 +316,9 @@ contents in `toolchains/` subdirectory.
@subsection building-cross-win Crosscompiling for Windows using MinGW @subsection building-cross-win Crosscompiling for Windows using MinGW
@note This guide is tailored mainly for crosscompiling from ArchLinux. For @note This guide is tailored mainly for crosscompiling from ArchLinux. For
this system there is also prepared `mingw32-magnum` development package in this system there is also prepared `mingw32-magnum` development package in
root, named `PKGBUILD-mingw32`. `package/archlinux`, named `PKGBUILD-mingw32`. See
@ref building-packages-arch "above" for more information.
You will need MinGW32 versions of the compiler and all dependent libraries You will need MinGW32 versions of the compiler and all dependent libraries
(Corrade), i.e. these ArchLinux packages: (Corrade), i.e. these ArchLinux packages:
@ -327,19 +327,18 @@ You will need MinGW32 versions of the compiler and all dependent libraries
- `mingw32-runtime` - `mingw32-runtime`
- `mingw32-corrade` - `mingw32-corrade`
Then create build directory and run cmake and make. You may need to modify the Then create build directory and run cmake and build command in it. You may need
`basic-mingw32.cmake` file and `CMAKE_INSTALL_PREFIX` to suit your distribution to modify the `basic-mingw32.cmake` file and `CMAKE_INSTALL_PREFIX` to suit
filesystem hierarchy. your distribution filesystem hierarchy.
mkdir build-win mkdir build-win && cd build-win
cd build-win
cmake .. \ cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \ -DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \
-DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32 -DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32
make cmake --build .
Then you can install the package using `make install` to make it available for Then you can install the package using `cmake --build . --target install` to
depending projects. make it available for depending projects.
@subsection building-cross-nacl Crosscompiling for Google Chrome Native Client @subsection building-cross-nacl Crosscompiling for Google Chrome Native Client
@ -354,14 +353,13 @@ adapt `NACL_PREFIX` variable in `generic/NaCl-*-x86-32.cmake` and
to find the compiler. NaCl currently supports only OpenGL ES 2, thus to find the compiler. NaCl currently supports only OpenGL ES 2, thus
`TARGET_GLES` and `TARGET_GLES2` is always enabled. `TARGET_GLES` and `TARGET_GLES2` is always enabled.
Then create build directories for x86-32 and x86-64 and run cmake and make in Then create build directories for x86-32 and x86-64 and run cmake and build
them. The toolchains need access to the platform file, so be sure to properly command in them. The toolchains need access to the platform file, so be sure to
set **absolute** path to `modules/` directory containing `Platform/NaCl.cmake`. properly set **absolute** path to `modules/` directory containing
Also adapt `CMAKE_INSTALL_PREFIX` to the same value as in `NACL_PREFIX` in `Platform/NaCl.cmake`. Also adapt `CMAKE_INSTALL_PREFIX` to the same value as
toolchain file. in `NACL_PREFIX` in toolchain file.
mkdir -p build-nacl-x86-32 mkdir build-nacl-x86-32 && cd build-nacl-x86-32
cd build-nacl-x86-32
cmake .. \ cmake .. \
-DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-32.cmake" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-32.cmake" \
@ -369,23 +367,24 @@ toolchain file.
-DCMAKE_INSTALL_PREFIX=/usr/nacl \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \
-DWITH_NACLAPPLICATION=ON \ -DWITH_NACLAPPLICATION=ON \
-DLIB_SUFFIX=/32 -DLIB_SUFFIX=/32
make cmake --build .
mkdir -p build-nacl-x86-64 mkdir build-nacl-x86-64 && cd build-nacl-x86-64
cd build-nacl-x86-64
cmake .. \ cmake .. \
-DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-64.cmake" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/NaCl-newlib-x86-64.cmake" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/nacl \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \
-DWITH_NACLAPPLICATION=ON -DWITH_NACLAPPLICATION=ON
make cmake --build .
Then you can install both versions using `make install` to make them available Then you can install both versions using `cmake --build . --target install` to
for depending projects. The headers are shared by both versions. make them available for depending projects. The headers are shared by both
versions.
For ArchLinux there are also prepared package files in root, named For ArchLinux there are also prepared package files in `package/archlinux`,
`PKGBUILD-nacl-glibc` and `PKGBUILD-nacl-newlib`. named `PKGBUILD-nacl-glibc` and `PKGBUILD-nacl-newlib`, see
@ref building-packages-arch "above" for more information.
@subsection building-cross-emscripten Crosscompiling for Emscripten @subsection building-cross-emscripten Crosscompiling for Emscripten
@ -397,28 +396,30 @@ to path where Emscripten is installed. Default is `/usr/emscripten`. Emscripten
supports dynamic libraries only to simplify porting and they are generally supports dynamic libraries only to simplify porting and they are generally
slower, thus `BUILD_STATIC` is implicitly enabled. slower, thus `BUILD_STATIC` is implicitly enabled.
Then create build directory and run cmake and make in it. The toolchain needs Then create build directory and run cmake and build command in it. The
access to its platform file, so be sure to properly set **absolute** path to toolchain needs access to its platform file, so be sure to properly set
`modules/` directory containing `Platform/Emscripten.cmake`. Also set **absolute** path to `modules/` directory containing `Platform/Emscripten.cmake`.
`CMAKE_INSTALL_PREFIX` to value which is contained in `CMAKE_FIND_ROOT_PATH` in Also set `CMAKE_INSTALL_PREFIX` to path contained in `EMSCRIPTEN_TOOLCHAIN_PATH`.
toolchain file.
mkdir -p build-emscripten mkdir build-emscripten && cd build-emscripten
cd build-emscripten
cmake .. \ cmake .. \
-DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/emscripten/system \ -DCMAKE_INSTALL_PREFIX=/usr/emscripten/system \
-DWITH_SDL2APPLICATION=ON -DWITH_SDL2APPLICATION=ON
make cmake --build .
Then you can install the library using `make install` to make it available for Then you can install the library using `cmake --build . --target install` to
depending projects. make it available for depending projects.
If you have Node.js installed, you can also build and run unit tests using If you have Node.js installed, you can also build and run unit tests using
`ctest`. See `BUILD_TESTS` above. `ctest`. See `BUILD_TESTS` above.
For ArchLinux there is also prepared package file in `package/archlinux`,
named `PKGBUILD-emscripten`, see @ref building-packages-arch "above" for more
information.
@subsection building-cross-android Crosscompiling for Android ARM and x86 @subsection building-cross-android Crosscompiling for Android ARM and x86
You will need [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) You will need [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html)
@ -429,9 +430,9 @@ where NDK is installed. Default is `/opt/android-ndk`. Adapt also
`ANDROID_SYSROOT` to your preferred API level. You might also need to update `ANDROID_SYSROOT` to your preferred API level. You might also need to update
`ANDROID_TOOLCHAIN_PREFIX` and `ANDROID_TOOLCHAIN_ROOT` to fit your system. `ANDROID_TOOLCHAIN_PREFIX` and `ANDROID_TOOLCHAIN_ROOT` to fit your system.
Then create build directory and run cmake and make in it. The toolchain needs Then create build directory and run cmake and build command in it. The
access to its platform file, so be sure to properly set **absolute** path to toolchain needs access to its platform file, so be sure to properly set **absolute**
`modules/` directory containing `Platform/Android.cmake`. Also set path to `modules/` directory containing `Platform/Android.cmake`. Also set
`CMAKE_INSTALL_PREFIX` to `/usr` subdirectory of `ANDROID_SYSROOT`. `CMAKE_INSTALL_PREFIX` to `/usr` subdirectory of `ANDROID_SYSROOT`.
Note that `BUILD_STATIC` is implicitly enabled, because manually loading all Note that `BUILD_STATIC` is implicitly enabled, because manually loading all
@ -439,35 +440,37 @@ depending shared libraries using JNI would be too inconvenient. Decision
between OpenGL ES 2.0 and ES 3.0 is left up to the user (i.e. you need to set between OpenGL ES 2.0 and ES 3.0 is left up to the user (i.e. you need to set
`TARGET_GLES2` to `ON` or `OFF`). `TARGET_GLES2` to `ON` or `OFF`).
mkdir -p build-android-arm mkdir build-android-arm && cd build-android-arm
cd build-android-arm
cmake .. \ cmake .. \
-DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-ARM.cmake" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/android-ndk/platforms/android-19/arch-arm/usr \ -DCMAKE_INSTALL_PREFIX=/opt/android-ndk/platforms/android-19/arch-arm/usr \
-DTARGET_GLES=ON -DTARGET_GLES2=ON -DTARGET_GLES=ON -DTARGET_GLES2=ON
make cmake --build .
mkdir -p build-android-x86 mkdir build-android-x86 && cd build-android-x86
cd build-android-x86
cmake .. \ cmake .. \
-DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \ -DCMAKE_MODULE_PATH="/absolute/path/to/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" \ -DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Android-x86.cmake" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/android-ndk/platforms/android-19/arch-x86/usr \ -DCMAKE_INSTALL_PREFIX=/opt/android-ndk/platforms/android-19/arch-x86/usr \
-DTARGET_GLES=ON -DTARGET_GLES2=ON -DTARGET_GLES=ON -DTARGET_GLES2=ON
make cmake --build .
Then you can install the library using `cmake --build . --target install` to
make it available for depending projects.
Then you can install the library using `make install` to make it available for For ArchLinux there are also prepared package files in `package/archlinux`,
depending projects. named `PKGBUILD-android-arm` and `PKGBUILD-android-x86`, see
@ref building-packages-arch "above" for more information.
@section building-ci-jenkins Jenkins Continuous Integration @section building-ci-jenkins Jenkins Continuous Integration
In `package/ci/` there are `jenkins.xml` and `jenkins-gltests.xml` files In `package/ci/` there are `jenkins.xml` and `jenkins-gltests.xml` files
containing job configuration, one for build and non-GL tests and the other for containing job configuration, one for build and non-GL tests and the other for
GL tests only. Setup your Jenkins server, enable the **Git** and GL tests only. Setup your Jenkins server, enable the **Git** and **Text-finder**
**Text-finder** plugin and download the CLI application from here: plugin and download the CLI application from here:
http://your-jenkins-server/cli http://your-jenkins-server/cli

Loading…
Cancel
Save