OSDN Git Service

binding with libharu.
[putex/putex.git] / src / texsourc / lib / libhpdf / README_cmake
1 Instruction for the CMake Build System
2 ======================================
3
4 CMake is a family of tools designed to build, test and
5 package software and it is cross-platform and open
6 source. CMake and can obtained from http://www.cmake.org.
7
8 0 Setup CMake
9 -------------
10 CMake is available in most of Linux repositories and can 
11 be therefore easily installed. In Cygwin just use the 
12 usual method with setup.exe to get the latest version of CMake.
13 For Windows and Mac OS X go to http://www.cmake.org and 
14 download the appropriate binary packge. Make sure that the
15 bin directory of the extracted CMake package is in the 
16 PATH environment variable. Check in the CLI with
17
18 cmake --version
19
20 that CMake can be found. There is also a graphical interface
21 to CMake available which can be run with ccmake (Linux, Mac OS X)
22 or cmake-gui (Windows, Linux, Mac OS X). In the next section
23 the command line tool cmake is used, but the graphical interface
24 works similar. Note, that CMake should always operate in a 
25 out-of-source directory. If you need to run CMake again it's best
26 to remove the whole folder and start with the directory creation
27 in order to prevent problems with stale CMake cache files.
28
29 X Specific instructions for Linux and Mac OS X
30 ==============================================
31 Create a directory at the same level as the libharu source directory,
32 e.g. "mkdir libharu_build". Cd into this directory.
33 Than run cmake with the command
34
35 cmake ../libharu
36
37 CMake will configure the build and create the appropriate makefiles.
38 Run "make" to create the library and the examples. There are some
39 options available which are described below.
40
41 X Specific instructions for Windows
42 ===================================
43 Create a directory at the same level as the libharu source directory,
44 e.g. "mkdir libharu_build". Cd into this directory.
45 Since there are more compiler toolsets available for Windows than
46 the standard gcc compiler, you need to tell cmake which makefile
47 generator to use
48
49 cmake -G "Makefile Generator" ..\libharu
50
51 where Make Generator is one of the following (most important listed)
52
53   Borland Makefiles           = Generates Borland makefiles.
54   MSYS Makefiles              = Generates MSYS makefiles.
55   MinGW Makefiles             = Generates a make file for use with
56                                 mingw32-make.
57   NMake Makefiles             = Generates NMake makefiles.
58   Visual Studio 6             = Generates Visual Studio 6 project files.
59   Visual Studio 9 2008        = Generates Visual Studio 9 2008 project files.
60
61 You get a complete list of all available generators for your platfrom
62 with "cmake --help". I'll go into details for one specific compiler toolset.
63 The other generators work similar.
64
65 Using CMake to produce Visual C++ 2008 Makfiles
66 -----------------------------------------------
67 First you need to have the command line interface setup correctly. Start
68 cmd.exe and run "%VS90COMNTOOLS%vsvars32.bat". This will set up the
69 command line tools of Visual C++ 2008. Cd into the created build
70 directory and run
71
72 cmake -G "NMake Makefiles" ..\libharu
73
74 After the configuration and creation of the makefile run "nmake" to create
75 the libraries and demonstrations. By default a shared library will be 
76 created therefore you need to copy the haru.dll from the src directory
77 in the demo directory in order for the demonstrations to run correctly.
78
79 X Useful CMake options
80 ======================
81 There are some options available where you can influence the configuration
82 stage. These options must be given at the command line with the -D flag, e.g.
83
84 cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug ..\libharu
85
86   CMAKE_BUILD_TYPE=Debug|Release - debug or release build
87   BUILD_SHARED_LIBS=ON|OFF - shared or static build
88   CMAKE_COLOR_MAKEFILE=ON|OFF - color output
89   CMAKE_VERBOSE_MAKEFILE=ON|OFF - verbose makefile output
90   
91 More options can be found here: http://www.cmake.org/Wiki/CMake_Useful_Variables
92
93 X How does CMake find libraries
94 ===============================
95 CMake searches usually in the standard locations to find libraries, which
96 works well on Linux und Mac OS X. This is not the case for Windows (where
97 there are simply no standard locations for libraries) or if you want to
98 use a library at a non-standard location. You can help CMake to find
99 libraries via two environment variables, e.g. for Windows:
100
101 set CMAKE_INCLUDE_PATH=path_to_zlib_headers
102 set CMAKE_LIBRARY_PATH=path_to_zlib
103
104 and then CMake will be able to find zlib.
105   
106