]>
Commit | Line | Data |
---|---|---|
b3695c67 FM |
1 | WHY SWITCH TO CMAKE |
2 | ||
3cb25232 FM |
3 | I (Frederic Marchal) could not make the autotools work with msys+mingw. The |
4 | choices reduced to: fight some more time with the autotools; wait until the msys | |
5 | port evolved or switch to cmake. Despite not being familiar with cmake, I | |
6 | decided to give it a chance and was surprised to come up within a few hours | |
7 | with something capable of compiling sarg. | |
b3695c67 | 8 | |
3cb25232 FM |
9 | Now, that doesn't mean that the autotools are to be discarded on the spot. The |
10 | two systems may coexist for some times especially since it is my first project | |
11 | with cmake and I'm sure it is done in an definitely autotoolistic way. | |
b3695c67 | 12 | |
9632855c FM |
13 | Any comment about the usage of cmake is welcome. |
14 | ||
b3695c67 FM |
15 | |
16 | CONFIGURING SARG | |
17 | ||
3cb25232 FM |
18 | It is recommended to build sarg out of the source directory. It makes it easier |
19 | to delete the build directory completely and restart the configuration from | |
b008f87f FM |
20 | scratch if the first attempt doesn't produce the expected result. |
21 | ||
22 | If you intent to use both cmake and the autotools, then you MUST build sarg out | |
23 | of the source directory as it will overwrite the original stub config.h in the | |
24 | source directory and you won't be able to use the autotools afterward. | |
25 | ||
26 | To build sarg out of source, create a directory at the same level as the sources | |
27 | of sarg and cd into that directory. | |
b3695c67 FM |
28 | |
29 | Configure sarg with the command | |
30 | ||
31 | ccmake ../sarg | |
32 | ||
3cb25232 FM |
33 | On the first run, it will report that the cache is empty. Press 'c' to configure |
34 | the cache. Then ccmake will display an interface to select some configuration | |
35 | options. You should set the CMAKE_INSTALL_PREFIX to the root of the directory to | |
36 | install sarg, for instance: /usr. You may also need to change SYSCONFDIR to | |
37 | /etc/sarg to install the configuration files at that location. | |
b3695c67 | 38 | |
3cb25232 FM |
39 | Then press 'c' again to reconfigure sarg. Four more configuration variables |
40 | appear. They are build from the paths you provided for the installation | |
41 | directories of the components. These are the absolute paths sarg will use to | |
42 | find the corresponding files. You then have the opportunity to adjust them if | |
43 | the final location of the files it not what is resolved with the installed | |
44 | configuration. | |
b3695c67 FM |
45 | |
46 | Finally, press 'g' to generate the final configuration. | |
47 | ||
48 | Compile with | |
49 | ||
50 | make | |
51 | ||
52 | Install with | |
53 | ||
54 | make install | |
55 | ||
56 | ||
57 | CONFIGURATION VARIABLES | |
58 | ||
59 | These configuration variables are available on the first configuration run. | |
60 | ||
61 | CMAKE_INSTALL_PREFIX - The root of the installation. | |
9632855c | 62 | default: /usr/local |
b3695c67 | 63 | |
3cb25232 FM |
64 | SYSCONFDIR - The directory with the configuration files relative to the |
65 | installation prefix. | |
b3695c67 FM |
66 | default: etc/sarg |
67 | ||
68 | BINDIR - The directory to copy sarg executable to. | |
69 | default: bin | |
70 | ||
71 | MANDIR - The directory to install the man page. | |
72 | default: share/man | |
73 | ||
74 | LANGDIR - The directory to copy the languages files to. | |
75 | default: share/sarg/languages | |
76 | ||
77 | FONTDIR - The directory where the fonts for the reports are located. | |
78 | default: share/sarg/fonts | |
79 | ||
80 | IMAGEDIR - The directory containing the images to use in the reports. | |
81 | default: share/sarg/images | |
82 | ||
3cb25232 FM |
83 | These variables are initialized with the values of the above variables and are |
84 | available on the second run. | |
b3695c67 | 85 | |
3cb25232 FM |
86 | SYSCONFDIR_SOURCE - The full path to the configuration files to compile in |
87 | sarg. | |
b3695c67 FM |
88 | default: CMAKE_INSTALL_PREFIX/SYSCONFDIR |
89 | ||
90 | LANGDIR_SOURCE - The full path to the languages files to compile in sarg. | |
91 | default: CMAKE_INSTALL_PREFIX/LANGDIR | |
92 | ||
93 | FONTDIR_SOURCE - The full path to the fonts to compile in sarg. | |
94 | default: CMAKE_INSTALL_PREFIX/FONTDIR | |
95 | ||
96 | IMAGEDIR_SOURCE - The full path to the images to compile in sarg. | |
97 | default: CMAKE_INSTALL_PREFIX/IMAGEDIR | |
98 | ||
3cb25232 FM |
99 | They are other configuration variables whose documentation is visible during the |
100 | configuration with ccmake. | |
b3695c67 | 101 |