1 |
capela |
3570 |
What is CMake? |
2 |
|
|
============== |
3 |
|
|
|
4 |
|
|
CMake is a cross platform build system, that can be used to replace the old |
5 |
|
|
auto-tools, providing a nice building environment and advanced features. |
6 |
|
|
|
7 |
|
|
Some of these features are: |
8 |
|
|
* Out of sources build: CMake allows you to build your software into a directory |
9 |
|
|
different to the source tree. You can safely delete the build directory and |
10 |
|
|
all its contents once you are done. |
11 |
|
|
* Multiple generators: classic makefiles can be generated for Unix and MinGW, |
12 |
|
|
but also Visual Studio, XCode and Eclipse CDT projects among other types. |
13 |
|
|
* Graphic front-ends for configuration and build options. |
14 |
|
|
|
15 |
|
|
More information and documentation is available at the CMake project site: |
16 |
|
|
http://www.cmake.org |
17 |
|
|
|
18 |
|
|
CMake is free software. You can get the sources and pre-compiled packages for |
19 |
|
|
Linux and other systems at: |
20 |
|
|
http://www.cmake.org/cmake/resources/software.html |
21 |
|
|
|
22 |
|
|
How to use it? |
23 |
|
|
============== |
24 |
|
|
|
25 |
|
|
1. You need CMake 3.1 or newer to build Qsampler |
26 |
|
|
|
27 |
|
|
2. Unpack the Qsampler sources somewhere, or checkout the repository, |
28 |
|
|
and create a build directory. For instance, using a command line shell: |
29 |
|
|
|
30 |
|
|
$ tar -xvzf Downloads/qsampler-x.y.z.tar.gz |
31 |
|
|
$ cd qsampler-x.y.z |
32 |
|
|
$ mkdir build |
33 |
|
|
|
34 |
|
|
2. Execute CMake from the build directory, providing the source directory |
35 |
|
|
location and optionally, the build options. There are several ways. |
36 |
|
|
|
37 |
|
|
* From a command line shell: |
38 |
|
|
|
39 |
|
|
$ pwd |
40 |
|
|
qsampler-x.y.z |
41 |
|
|
$ cd build |
42 |
|
|
$ cmake -DCMAKE_BUILD_TYPE=debug .. |
43 |
|
|
|
44 |
|
|
3. Execute the build command. If you used the Makefiles generator (the default |
45 |
|
|
in Linux and other Unix systems) then execute make, gmake, or mingw32-make. |
46 |
|
|
If you generated a project file, use your IDE to build it. |
47 |
|
|
|
48 |
|
|
Compiling with make |
49 |
|
|
=================== |
50 |
|
|
|
51 |
|
|
There are many targets available. To see a complete list of them, type: |
52 |
|
|
|
53 |
|
|
$ make help |
54 |
|
|
|
55 |
|
|
The build process usually hides the compiler command lines, to show them: |
56 |
|
|
|
57 |
|
|
$ make VERBOSE=1 |
58 |
|
|
|
59 |
|
|
There is a "clean" target, but not a "distclean" one. You should use a build |
60 |
|
|
directory different to the source tree. In this case, the "distclean" target |
61 |
|
|
would be equivalent to simply removing the build directory. |
62 |
|
|
|
63 |
|
|
If something fails |
64 |
|
|
================== |
65 |
|
|
|
66 |
|
|
If there is an error message while executing CMake, this probably means that a |
67 |
|
|
required package is missing in your system. You should install the missing |
68 |
|
|
component and run CMake again. |
69 |
|
|
|
70 |
|
|
If there is an error executing the build process, after running a flawless CMake |
71 |
|
|
configuration process, this means that there may be an error in the source code, |
72 |
|
|
or in the build system, or something incompatible in 3rd party libraries. |
73 |
|
|
|
74 |
|
|
The CMake build system for Qsampler is experimental. It will take a while |
75 |
|
|
until it becomes stable and fully tested. You can help providing feedback, |
76 |
|
|
please send a report containing your problems to the Qsampler development |
77 |
|
|
mailing list, https://lists.sourceforge.net/mailman/listinfo/qsampler-devel |