Skip to content

Commit 5f45ea3

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 45fdd97 + 07f8fd6 commit 5f45ea3

File tree

7 files changed

+175
-175
lines changed

7 files changed

+175
-175
lines changed

CMakeLists.txt

+20-20
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,45 @@ include(environment.cmake)
4040
# ---------------------------------------------------------------------------
4141
include(dependencies.cmake)
4242

43-
if (TCMALLOC)
43+
if(TCMALLOC)
4444
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ltcmalloc")
45-
else (TCMALLOC)
45+
else()
4646
message(STATUS "Using default allocator. Use -DTCMALLOC=1 to use tcmalloc")
47-
endif (TCMALLOC)
47+
endif()
4848

4949

50-
if (NOT NO_THREADS)
50+
if(NOT NO_THREADS)
5151
add_definitions(-DCLEVER_THREADS)
5252
message(STATUS "Use -DNO_THREADS to disable threads")
53-
endif (NOT NO_THREADS)
53+
endif()
5454

55-
if (THREADS_DEBUG)
55+
if(THREADS_DEBUG)
5656
add_definitions(-DCLEVER_THREADS_BEBUG)
57-
else (THREADS_DEBUG)
57+
else()
5858
message(STATUS "Use -DTHREADS_DEBUG to enable thread debug messages")
59-
endif (THREADS_DEBUG)
59+
endif()
6060

6161
# Parser and Scanner
6262
# ---------------------------------------------------------------------------
63-
if (GEN_PARSER)
63+
if(GEN_PARSER)
6464
set(re2c_opts)
6565
list(APPEND re2c_opts "-b")
6666
list(APPEND re2c_opts "-i")
6767
list(APPEND re2c_opts "--no-generation-date")
6868

69-
if (NOT ${BISON_VERSION} VERSION_LESS "2.7.0")
69+
if(NOT ${BISON_VERSION} VERSION_LESS "2.7.0")
7070
message(FATAL_ERROR "Clever parsers cannot be generated with Bison 2.7 yet.")
71-
endif (NOT ${BISON_VERSION} VERSION_LESS "2.7.0")
71+
endif()
7272

7373
message(STATUS "Clever parsers will be generated again.")
7474

75-
if (${RE2C_VERSION} VERSION_GREATER "0.13.0")
75+
if(${RE2C_VERSION} VERSION_GREATER "0.13.0")
7676
list(APPEND re2c_opts "-c")
77-
endif (${RE2C_VERSION} VERSION_GREATER "0.13.0")
77+
endif()
7878

79-
if (${RE2C_VERSION} VERSION_GREATER "0.13.2")
79+
if(${RE2C_VERSION} VERSION_GREATER "0.13.2")
8080
list(APPEND re2c_opts "--case-inverted")
81-
endif (${RE2C_VERSION} VERSION_GREATER "0.13.2")
81+
endif()
8282

8383
set(core_dir ${CMAKE_CURRENT_SOURCE_DIR}/core)
8484

@@ -98,7 +98,7 @@ if (GEN_PARSER)
9898

9999
set(core_dir)
100100

101-
endif (GEN_PARSER)
101+
endif()
102102

103103
# Module options
104104
# ---------------------------------------------------------------------------
@@ -112,9 +112,9 @@ include(modules.cmake)
112112
# http://www.gentoo.org/proj/en/qa/asneeded.xml
113113
# https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition
114114
# http://wiki.debian.org/ToolChain/DSOLinking
115-
if (UNIX AND NOT APPLE)
115+
if(UNIX AND NOT APPLE)
116116
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed")
117-
endif (UNIX AND NOT APPLE)
117+
endif()
118118

119119
# Main executable
120120
# ---------------------------------------------------------------------------
@@ -215,9 +215,9 @@ if(PCRECPP_FOUND)
215215
)
216216
target_link_libraries(testrunner ${PCRECPP_LIBRARIES})
217217
add_dependencies(testrunner clever)
218-
else(PCRECPP_FOUND)
218+
else()
219219
message(WARNING "testrunner will not be compiled. reason: libpcrecpp missing")
220-
endif(PCRECPP_FOUND)
220+
endif()
221221

222222
# Test runner
223223
# ---------------------------------------------------------------------------

cmake/FindCLEVER.cmake

+75-75
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# clever_module_msg(<name> <msg>)
22
macro(clever_module_msg Name Msg)
33
message(STATUS "Module ${Name}: ${Msg}")
4-
endmacro(clever_module_msg)
4+
endmacro()
55

66
# clever_module_var(<name> <output var>)
77
#
@@ -11,12 +11,12 @@ endmacro(clever_module_msg)
1111
macro(clever_module_var Name Var)
1212
string(REPLACE "." "_" _sanitized "${Name}")
1313
string(TOUPPER "${_sanitized}" ${Var})
14-
endmacro(clever_module_var)
14+
endmacro()
1515

1616
macro(clever_module_set_prop Name Property Value)
1717
clever_module_var(${Name} _mod_var)
1818
set(${_mod_var}_${Property} ${Value})
19-
endmacro(clever_module_set_prop)
19+
endmacro()
2020

2121
# clever_module_path(<name> <output var>
2222
# [PATH <path>])
@@ -33,17 +33,17 @@ macro(clever_module_path Name Var)
3333

3434
set(_mod_path "${_mod_var}_PATH")
3535

36-
if (args_PATH)
36+
if(args_PATH)
3737
clever_module_set_prop(${Name} PATH "${args_PATH}")
38-
else (args_PATH)
38+
else()
3939
string(REPLACE "." "/" ${_mod_path} "${Name}")
4040
clever_module_set_prop(${Name}
4141
PATH "${CMAKE_CURRENT_SOURCE_DIR}/module/${${_mod_path}}")
42-
endif (args_PATH)
42+
endif()
4343

4444
set(${Var} "${_mod_var}_PATH")
4545

46-
endmacro(clever_module_path)
46+
endmacro()
4747

4848
# clever_new_module(<name> <enabled>
4949
# [[DOC <doc string>]
@@ -86,23 +86,23 @@ macro(clever_new_module Name Enabled)
8686

8787
list(APPEND CLEVER_AVAILABLE_MODULES ${Name})
8888

89-
endmacro(clever_new_module)
89+
endmacro()
9090

9191
macro(clever_enable_module Name)
9292
clever_module_var(${Name} _mod_var)
9393
set(${_mod_var} ON)
9494
clever_module_msg(${Name} "enabled")
95-
endmacro(clever_enable_module)
95+
endmacro()
9696

9797
macro(clever_disable_module Name)
9898
clever_module_var(${Name} _mod_var)
9999
set(${_mod_var} OFF)
100-
if (ARG2)
100+
if(ARG2)
101101
clever_module_msg(${Name} "disabled (${ARG2})")
102-
else (ARG2)
102+
else()
103103
clever_module_msg(${Name} "disabled")
104-
endif (ARG2)
105-
endmacro(clever_disable_module)
104+
endif()
105+
endmacro()
106106

107107
# clever_module_check(<name>)
108108
#
@@ -114,54 +114,54 @@ macro(clever_module_check Name)
114114
set(_mod_checked "${_mod_var}_CHECKED")
115115

116116
# check only once
117-
if (NOT ${_mod_checked})
117+
if(NOT ${_mod_checked})
118118

119-
if (NOT ${_mod_var})
119+
if(NOT ${_mod_var})
120120
clever_disable_module(${Name})
121-
endif (NOT ${_mod_var})
121+
endif()
122122

123123
# check libs
124124
set(_mod_libs "${_mod_var}_LIB_DEPENDS")
125-
if (${_mod_var} AND ${_mod_libs})
126-
foreach (_name ${${_mod_libs}})
127-
if (NOT ${_name}_FOUND)
125+
if(${_mod_var} AND ${_mod_libs})
126+
foreach(_name ${${_mod_libs}})
127+
if(NOT ${_name}_FOUND)
128128
clever_disable_module(${Name} "${_name} not found")
129129
break()
130-
endif (NOT ${_name}_FOUND)
131-
endforeach (_name ${${_mod_libs}})
132-
endif (${_mod_var} AND ${_mod_libs})
130+
endif()
131+
endforeach()
132+
endif()
133133

134134
# check modules
135135
set(_mod_mods "${_mod_var}_MOD_DEPENDS")
136-
if (${_mod_var} AND ${_mod_mods})
137-
foreach (_name ${${_mod_mods}})
136+
if(${_mod_var} AND ${_mod_mods})
137+
foreach(_name ${${_mod_mods}})
138138
clever_module_var(${_name} _depname)
139139

140-
if (NOT ${_depname}_CHECKED)
140+
if(NOT ${_depname}_CHECKED)
141141
clever_module_check(${${_depname}_NAME})
142-
endif (NOT ${_depname}_CHECKED)
142+
endif()
143143

144-
if (NOT ${_depname})
144+
if(NOT ${_depname})
145145
clever_disable_module(${Name} "${${_depname}_NAME} not found")
146146
break()
147-
endif (NOT ${_depname})
148-
endforeach (_name ${${_mod_mods}})
149-
endif (${_mod_var} AND ${_mod_mods})
147+
endif()
148+
endforeach()
149+
endif()
150150

151-
if (${_mod_var})
151+
if(${_mod_var})
152152
# use the libs
153-
foreach (_name ${${_mod_libs}})
153+
foreach(_name ${${_mod_libs}})
154154
clever_use_lib(${_name})
155-
endforeach (_name ${${_mod_libs}})
155+
endforeach()
156156

157157
add_definitions(-DHAVE_MOD_${_mod_var})
158158

159159
clever_enable_module(${Name})
160-
endif (${_mod_var})
160+
endif()
161161

162162
set(${_mod_checked} ON)
163-
endif (NOT ${_mod_checked})
164-
endmacro(clever_module_check)
163+
endif()
164+
endmacro()
165165

166166
# clever_add_lib(<var_name>
167167
# [PKGS pkg1 [pkg2 ...]]
@@ -190,87 +190,87 @@ macro(clever_add_lib VarName)
190190

191191
set(msg_level STATUS)
192192

193-
if (args_REQUIRED)
193+
if(args_REQUIRED)
194194
set(msg_level FATAL_ERROR)
195-
endif (args_REQUIRED)
195+
endif()
196196

197197
# automated checking with pkg-config
198-
if (NOT ${_dir})
199-
if (PKG_CONFIG_FOUND AND args_PKGS)
198+
if(NOT ${_dir})
199+
if(PKG_CONFIG_FOUND AND args_PKGS)
200200
pkg_check_modules(${VarName} ${args_PKGS})
201-
endif (PKG_CONFIG_FOUND AND args_PKGS)
202-
endif (NOT ${_dir})
201+
endif()
202+
endif()
203203

204204
# fallback to manual checking
205-
if (NOT ${_found})
205+
if(NOT ${_found})
206206
set(_found_incs 1)
207207
set(_found_libs 1)
208208

209209
# check includes
210-
if (args_INCS)
211-
foreach (_name ${args_INCS})
210+
if(args_INCS)
211+
foreach(_name ${args_INCS})
212212
set(_opts NAMES "${_name}")
213213
set(_ipath${VarName})
214214

215-
if (${_dir})
215+
if(${_dir})
216216
set(_opts ${_opts} PATHS "${${_dir}}/include" NO_DEFAULT_PATH)
217-
endif (${_dir})
217+
endif()
218218

219219
find_path(_ipath${VarName} ${_opts})
220220

221-
if (_ipath${VarName})
221+
if(_ipath${VarName})
222222
list(APPEND ${VarName}_INCLUDE_DIRS "${_ipath${VarName}}")
223-
else (_ipath${VarName})
223+
else()
224224
message(${msg_level} "Failed to find include file(s) `${_name}`.")
225225
set(_found_incs 0)
226-
endif (_ipath${VarName})
227-
endforeach (_name ${args_LIBS})
228-
endif (args_INCS)
226+
endif()
227+
endforeach()
228+
endif()
229229

230230
# check libraries
231-
if (_found_incs AND args_LIBS)
232-
foreach (_name ${args_LIBS})
231+
if(_found_incs AND args_LIBS)
232+
foreach(_name ${args_LIBS})
233233
set(_opts NAMES "${_name}")
234234
set(_lib${VarName})
235235

236-
if (${_dir})
236+
if(${_dir})
237237
set(_opts ${_opts} PATHS "${${_dir}}/lib" NO_DEFAULT_PATH)
238-
endif (${_dir})
238+
endif()
239239

240240
find_library(_lib${VarName} ${_opts})
241241

242-
if (_lib${VarName})
242+
if(_lib${VarName})
243243
#list(APPEND ${VarName}_LIBRARIES ${_lib})
244244
list(APPEND ${VarName}_LIBRARIES "${_name}")
245245
get_filename_component(_path "${_lib${VarName}}" PATH)
246246
list(APPEND ${VarName}_LINK_DIRECTORIES "${_path}")
247-
else (_lib${VarName})
247+
else()
248248
message(${msg_level} "Failed to find required library `${_name}`.")
249249
set(_found_libs 0)
250-
endif (_lib${VarName})
251-
endforeach (_name ${args_LIBS})
252-
endif (_found_incs AND args_LIBS)
250+
endif()
251+
endforeach()
252+
endif()
253253

254-
if (_found_incs AND _found_libs)
254+
if(_found_incs AND _found_libs)
255255
set(${_found} 1)
256-
endif (_found_incs AND _found_libs)
257-
endif (NOT ${_found})
256+
endif()
257+
endif()
258258

259-
if (${_found})
260-
if (${VarName}_INCLUDE_DIR AND NOT ${VarName}_INCLUDE_DIRS)
259+
if(${_found})
260+
if(${VarName}_INCLUDE_DIR AND NOT ${VarName}_INCLUDE_DIRS)
261261
set(${VarName}_INCLUDE_DIRS ${${VarName}_INCLUDE_DIR})
262-
endif (${VarName}_INCLUDE_DIR AND NOT ${VarName}_INCLUDE_DIRS)
262+
endif()
263263

264-
if (NOT ${VarName}_INCLUDE_DIRS)
264+
if(NOT ${VarName}_INCLUDE_DIRS)
265265
set(${VarName}_INCLUDE_DIRS)
266-
endif (NOT ${VarName}_INCLUDE_DIRS)
266+
endif()
267267

268-
if (NOT ${VarName}_LINK_DIRECTORIES)
268+
if(NOT ${VarName}_LINK_DIRECTORIES)
269269
set(${VarName}_LINK_DIRECTORIES)
270-
else (NOT ${VarName}_LINK_DIRECTORIES)
271-
endif (NOT ${VarName}_LINK_DIRECTORIES)
270+
else()
271+
endif()
272272

273-
endif (${_found})
273+
endif()
274274

275275
unset(args_INCS)
276276
unset(args_LIBS)
@@ -285,7 +285,7 @@ macro(clever_add_lib VarName)
285285
unset(_opts)
286286
unset(_path)
287287

288-
endmacro(clever_add_lib)
288+
endmacro()
289289

290290
# clever_use_lib(Prefix)
291291
#
@@ -294,5 +294,5 @@ macro(clever_use_lib Prefix)
294294
list(APPEND CLEVER_INCLUDE_DIRS ${${Prefix}_INCLUDE_DIRS})
295295
list(APPEND CLEVER_LIBRARIES ${${Prefix}_LIBRARIES})
296296
list(APPEND CLEVER_LINK_DIRECTORIES ${${Prefix}_LINK_DIRECTORIES})
297-
endmacro(clever_use_lib)
297+
endmacro()
298298

0 commit comments

Comments
 (0)