doc: Convert INSTALL instructions to Markdown
[platform/upstream/gflags.git] / INSTALL.md
1 Installing a binary distribution package
2 ========================================
3
4 No official binary distribution packages are provided by the gflags developers.
5 There may, however, be binary packages available for your OS. Please consult
6 also the package repositories of your Linux distribution.
7
8 For example on Debian/Ubuntu Linux, gflags can be installed using the
9 following command:
10
11     sudo apt-get install gflags
12
13
14 Compiling the source code
15 =========================
16
17 The build system of gflags is since version 2.1 based on [CMake](http://cmake.org).
18 The common steps to build, test, and install software are therefore:
19
20 1. Extract source files.
21 2. Create build directory and change to it.
22 3. Run CMake to configure the build tree.
23 4. Build the software using selected build tool.
24 5. Test the built software.
25 6. Install the built files.
26
27 On Unix-like systems with GNU Make as build tool, these build steps can be
28 summarized by the following sequence of commands executed in a shell,
29 where ```$package``` and ```$version``` are shell variables which represent
30 the name of this package and the obtained version of the software.
31
32     $ tar xzf gflags-$version-source.tar.gz
33     $ cd gflags-$version
34     $ mkdir build && cd build
35     $ ccmake ..
36     
37       - Press 'c' to configure the build system and 'e' to ignore warnings.
38       - Set CMAKE_INSTALL_PREFIX and other CMake variables and options.
39       - Continue pressing 'c' until the option 'g' is available.
40       - Then press 'g' to generate the configuration files for GNU Make.
41     
42     $ make
43     $ make test    (optional)
44     $ make install (optional)
45
46 In the following, only gflags-specific CMake settings available to
47 configure the build and installation are documented.
48
49
50 CMake Option           | Description
51 ---------------------- | -------------------------------------------------------
52 CMAKE_INSTALL_PREFIX   | Installation directory, e.g., "/usr/local" on Unix and "C:\Program Files\gflags" on Windows.
53 GFLAGS_NAMESPACE       | Name of the C++ namespace to be used by the gflags library. Note that the public source header files are installed in a subdirectory named after this namespace. To maintain backwards compatibility with the Google Commandline Flags, set this variable to "google". The default is "gflags".
54 GFLAGS_INCLUDE_DIR     | Name of include subdirectory where headers are installed into.