Blame docs/README.CMAKE

Packit ed3af9
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Packit ed3af9
Packit ed3af9
To build GD using CMake, all you need is (add the cmake options if you need any
Packit ed3af9
or if the default libs and include paths are not the default) :
Packit ed3af9
Packit ed3af9
In a sub directory of the top level:
Packit ed3af9
$ mkdir bld
Packit ed3af9
$ cd bld
Packit ed3af9
$ cmake -DBUILD_TEST=1 <options> ..
Packit ed3af9
$ make
Packit ed3af9
Packit ed3af9
The available options are:
Packit ed3af9
ENABLE_PNG=1
Packit ed3af9
ENABLE_JPEG=1
Packit ed3af9
ENABLE_TIFF=1
Packit ed3af9
ENABLE_FREETYPE=1
Packit ed3af9
ENABLE_FONTCONFIG=1
Packit ed3af9
ENABLE_XPM=1
Packit ed3af9
ENABLE_WEBP=1
Packit ed3af9
Packit ed3af9
You can optionally run our tests suite using:
Packit ed3af9
$ ctest .
Packit ed3af9
Packit ed3af9
Or if you like to build in the source tree:
Packit ed3af9
$ cmake -DBUILD_TEST=1 .
Packit ed3af9
$ make
Packit ed3af9
$ ctest .
Packit ed3af9
Packit ed3af9
Add "-DCMAKE_BUILD_TYPE=DEBUG" if you like to have a debug version.
Packit ed3af9
Packit ed3af9
To install, just run:
Packit ed3af9
$ make install
Packit ed3af9
Or to to install to a different path:
Packit ed3af9
$ make install DESTDIR=/some/other/place
Packit ed3af9
Packit ed3af9
Typical usage with only PNG enabled:
Packit ed3af9
Packit ed3af9
This command generates VS7 project files and add some custom libraries and
Packit ed3af9
includes directories (libpng in this case):
Packit ed3af9
Packit ed3af9
cmake  -DCMAKE_GENERATOR="Visual Studio 7 .NET 2003"  -DENABLE_PNG=1 -DCMAKE_LIBRARY_PATH=c:\gd_build\gd_deps\lib -DCMAKE_INCLUDE_PATH=c:\gd_build\gd_deps\include c:\libgd_src
Packit ed3af9
Packit ed3af9
A typical CMake call to build using the MinGW tools:
Packit ed3af9
Packit ed3af9
cmake -G"MinGW Makefiles" -DCMAKE_LIBRARY_PATH=c:\mingw\lib -DCMAKE_INCLUDE_PATH=c:\MinGW\include -DENABLE_JPEG=On -DBUILD_TEST=On -DCMAKE_RELEASE_TYPE=DEBUG ..\libgd_head
Packit ed3af9
Packit ed3af9
Given that your MinGW install is under c:\mingw and that you install all libraries using the /usr prefix