cmake: Turn off deprecated warning for test_cmockery.c
[platform/upstream/cmocka.git] / INSTALL
1 # How to build from source
2
3 ## Requirements
4
5 ### Common requirements
6
7 In order to build cmocka, you need to install several components:
8
9 - A C compiler
10 - [CMake](http://www.cmake.org) >= 2.8.0.
11
12 Note that these version numbers are version we know works correctly. If you
13 build and run cmocka successfully with an older version, please let us know.
14
15 ## Building
16 First, you need to configure the compilation, using CMake. Go inside the
17 `build` dir. Create it if it doesn't exist.
18
19 GNU/Linux, MacOS X, MSYS/MinGW:
20
21     cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
22     make
23
24 On Windows you should choose a makefile gernerator with -G.
25
26 ### CMake standard options
27 Here is a list of the most interesting options provided out of the box by
28 CMake.
29
30 - CMAKE_BUILD_TYPE:     The type of build (can be Debug Release MinSizeRel
31                         RelWithDebInfo)
32 - CMAKE_INSTALL_PREFIX: The prefix to use when running make install (Default
33                         to /usr/local on GNU/Linux and MacOS X)
34 - CMAKE_C_COMPILER:     The path to the C compiler
35 - CMAKE_CXX_COMPILER:   The path to the C++ compiler
36
37 ### CMake options defined for cmocka
38
39 Options are defined in the following files:
40
41 - DefineOptions.cmake
42
43 They can be changed with the -D option:
44
45 `cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DUNIT_TESTING=ON ..`
46
47 ### Browsing/editing CMake options
48
49 In addition to passing options on the command line, you can browse and edit
50 CMake options using `cmakesetup` (Windows), `cmake-gui` or `ccmake` (GNU/Linux
51 and MacOS X).
52
53 - Go to the build dir
54 - On Windows: run `cmakesetup`
55 - On GNU/Linux and MacOS X: run `ccmake ..`
56
57 ## Installing
58
59 If you want to install cmocka after compilation run:
60
61     make install
62
63 ## Running
64
65 The cmocka library can be found in the `build/src` directory.
66 You can run the binaries in `build/examples/*` which is a
67 are exsample tests.
68
69 ## About this document
70
71 This document is written using [Markdown][] syntax, making it possible to
72 provide usable information in both plain text and HTML format. Whenever
73 modifying this document please use [Markdown][] syntax.
74
75 [markdown]: http://www.daringfireball.net/projects/markdown