Mercurial > irccd
comparison cmake/IrccdOptions.cmake @ 510:6ec510722582
CMake: enable vera++ as code checking, closes #603
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 19 Oct 2017 13:01:39 +0200 |
parents | 0b156b82b8c1 |
children | 928a40398dec |
comparison
equal
deleted
inserted
replaced
509:c9a6d9df083f | 510:6ec510722582 |
---|---|
27 # WITH_DOXYGEN Enable internal irccd documentation (default: on) | 27 # WITH_DOXYGEN Enable internal irccd documentation (default: on) |
28 # WITH_HTML Enable HTML documentation | 28 # WITH_HTML Enable HTML documentation |
29 # WITH_MAN Install manpages (default: on, off for Windows) | 29 # WITH_MAN Install manpages (default: on, off for Windows) |
30 # WITH_PKGCONFIG Install pkg-config files (default: on, off for Windows (except MinGW)) | 30 # WITH_PKGCONFIG Install pkg-config files (default: on, off for Windows (except MinGW)) |
31 # WITH_PLUGIN_<NAME> Enable or disable the specified plugin (default: on) | 31 # WITH_PLUGIN_<NAME> Enable or disable the specified plugin (default: on) |
32 # WITH_VERA Enable style checking using vera (default: on) | |
32 # | 33 # |
33 # Note: the option() commands for WITH_PLUGIN_<name> variables are defined automatically from the IRCCD_PLUGINS | 34 # Note: the option() commands for WITH_PLUGIN_<name> variables are defined automatically from the IRCCD_PLUGINS |
34 # list. | 35 # list. |
35 # | 36 # |
36 | 37 |
77 option(WITH_DOCS "Enable building of all documentation" On) | 78 option(WITH_DOCS "Enable building of all documentation" On) |
78 option(WITH_HTML "Enable building of HTML documentation" On) | 79 option(WITH_HTML "Enable building of HTML documentation" On) |
79 option(WITH_DOXYGEN "Enable doxygen" Off) | 80 option(WITH_DOXYGEN "Enable doxygen" Off) |
80 option(WITH_MAN "Install man pages" ${DEFAULT_MAN}) | 81 option(WITH_MAN "Install man pages" ${DEFAULT_MAN}) |
81 option(WITH_PKGCONFIG "Enable pkg-config file" ${DEFAULT_PKGCONFIG}) | 82 option(WITH_PKGCONFIG "Enable pkg-config file" ${DEFAULT_PKGCONFIG}) |
83 option(WITH_VERA "Enable vera++" On) | |
82 | 84 |
83 # | 85 # |
84 # Installation paths. | 86 # Installation paths. |
85 # ------------------------------------------------------------------- | 87 # ------------------------------------------------------------------- |
86 # | 88 # |
162 else () | 164 else () |
163 set(WITH_HTML_MSG "No (disabled by user)") | 165 set(WITH_HTML_MSG "No (disabled by user)") |
164 set(WITH_HTML FALSE) | 166 set(WITH_HTML FALSE) |
165 endif () | 167 endif () |
166 | 168 |
169 find_program(VERA_EXECUTABLE vera++) | |
170 | |
171 if (VERA_EXECUTABLE) | |
172 if (WITH_VERA) | |
173 execute_process( | |
174 COMMAND ${VERA_EXECUTABLE} --version | |
175 OUTPUT_VARIABLE VERA_VERSION | |
176 ) | |
177 | |
178 if (${VERA_VERSION} VERSION_LESS "1.3.0") | |
179 set(WITH_VERA Off) | |
180 set(WITH_VERA_MSG "No (1.3.0 or greater required)") | |
181 else () | |
182 set(WITH_VERA_MSG "Yes") | |
183 endif () | |
184 else () | |
185 set(WITH_VERA Off) | |
186 set(WITH_VERA_MSG "No (disabled by user)") | |
187 endif () | |
188 else () | |
189 set(WITH_VERA Off) | |
190 set(WITH_VERA_MSG "No (vera++ not found)") | |
191 endif () | |
192 | |
167 # | 193 # |
168 # Determine if allowed to package. | 194 # Determine if allowed to package. |
169 # ------------------------------------------------------------------- | 195 # ------------------------------------------------------------------- |
170 # | 196 # |
171 # Do not move this section because irccd's CMake functions requires the IRCCD_PACKAGE value. | 197 # Do not move this section because irccd's CMake functions requires the IRCCD_PACKAGE value. |