Skip to content

Commit 032daa1

Browse files
committed
Run the decrufter on it all
1 parent b5aa239 commit 032daa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+553
-263
lines changed

BoostTestTargets.cmake

+55-33
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,18 @@ if(NOT Boost_FOUND)
4747
find_package(Boost 1.34.0 QUIET)
4848
endif()
4949
if("${Boost_VERSION}0" LESS "1034000")
50-
set(_shared_msg "NOTE: boost::test-based targets and tests cannot "
50+
set(_shared_msg
51+
"NOTE: boost::test-based targets and tests cannot "
5152
"be added: boost >= 1.34.0 required but not found. "
5253
"(found: '${Boost_VERSION}'; want >=103400) ")
5354
if(BUILD_TESTING)
54-
message(FATAL_ERROR ${_shared_msg}
55+
message(FATAL_ERROR
56+
${_shared_msg}
5557
"You may disable BUILD_TESTING to continue without the "
5658
"tests.")
5759
else()
58-
message(STATUS ${_shared_msg}
60+
message(STATUS
61+
${_shared_msg}
5962
"BUILD_TESTING disabled, so continuing anyway.")
6063
endif()
6164
endif()
@@ -79,7 +82,9 @@ if(Boost_FOUND AND NOT "${Boost_VERSION}0" LESS "1034000")
7982
set(_boostConfig "BoostTestTargetsIncluded.h")
8083
endif()
8184
get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH)
82-
configure_file("${_moddir}/${_boostConfig}" "${CMAKE_CURRENT_BINARY_DIR}/BoostTestTargetConfig.h" COPYONLY)
85+
configure_file("${_moddir}/${_boostConfig}"
86+
"${CMAKE_CURRENT_BINARY_DIR}/BoostTestTargetConfig.h"
87+
COPYONLY)
8388
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
8489
endif()
8590

@@ -89,8 +94,14 @@ function(add_boost_test _name)
8994
endif()
9095
if("${CMAKE_VERSION}" VERSION_LESS "2.8.0")
9196
if(NOT "${_boost_test_cmakever_pestered}x" EQUALS "${CMAKE_VERSION}x")
92-
message(STATUS "Not adding boost::test targets - CMake 2.8.0 or newer required, using ${CMAKE_VERSION}")
93-
set(_boost_test_cmakever_pestered "${CMAKE_VERSION}" CACHE INTERNAL "" FORCE)
97+
message(STATUS
98+
"Not adding boost::test targets - CMake 2.8.0 or newer required, using ${CMAKE_VERSION}")
99+
set(_boost_test_cmakever_pestered
100+
"${CMAKE_VERSION}"
101+
CACHE
102+
INTERNAL
103+
""
104+
FORCE)
94105
endif()
95106
return()
96107
endif()
@@ -128,7 +139,8 @@ function(add_boost_test _name)
128139
endif()
129140

130141
if(NOT SOURCES)
131-
message(FATAL_ERROR "Syntax error in use of add_boost_test: at least one source file required!")
142+
message(FATAL_ERROR
143+
"Syntax error in use of add_boost_test: at least one source file required!")
132144
endif()
133145

134146
if(Boost_FOUND AND NOT "${Boost_VERSION}0" LESS "1034000")
@@ -145,8 +157,11 @@ function(add_boost_test _name)
145157
elseif("${thefile}" MATCHES ".*boost/test/included/unit_test.hpp.*")
146158
set(includeType INCLUDED)
147159
set(includeFileLoc ${src})
148-
set(_boosttesttargets_libs) # clear this out - linking would be a bad idea
149-
if(NOT "${thefile}" MATCHES ".*OVERRIDE_BOOST_TEST_INCLUDED_WARNING.*")
160+
set(_boosttesttargets_libs) # clear this out - linking would be a bad idea
161+
if(NOT
162+
"${thefile}"
163+
MATCHES
164+
".*OVERRIDE_BOOST_TEST_INCLUDED_WARNING.*")
150165
message("Please replace the include line in ${src} with this alternate include line instead:")
151166
message(" \#include <BoostTestTargetConfig.h>")
152167
message("Once you've saved your changes, re-run CMake. (See BoostTestTargets.cmake for more info)")
@@ -157,7 +172,8 @@ function(add_boost_test _name)
157172

158173
if(NOT _boostTestTargetsNagged${_name} STREQUAL "${includeType}")
159174
if("includeType" STREQUAL "CONFIGURED")
160-
message(STATUS "Test '${_name}' uses the CMake-configurable form of the boost test framework - congrats! (Including File: ${includeFileLoc})")
175+
message(STATUS
176+
"Test '${_name}' uses the CMake-configurable form of the boost test framework - congrats! (Including File: ${includeFileLoc})")
161177
elseif("${includeType}" STREQUAL "INCLUDED")
162178
message("In test '${_name}': ${includeFileLoc} uses the 'included' form of the boost unit test framework.")
163179
else()
@@ -167,7 +183,12 @@ function(add_boost_test _name)
167183
message("Once you've saved your changes, re-run CMake. (See BoostTestTargets.cmake for more info)")
168184
endif()
169185
endif()
170-
set(_boostTestTargetsNagged${_name} "${includeType}" CACHE INTERNAL "" FORCE)
186+
set(_boostTestTargetsNagged${_name}
187+
"${includeType}"
188+
CACHE
189+
INTERNAL
190+
""
191+
FORCE)
171192

172193

173194
if(RESOURCES)
@@ -177,7 +198,10 @@ function(add_boost_test _name)
177198
# Generate a unique target name, using the relative binary dir
178199
# and provided name. (transform all / into _ and remove all other
179200
# non-alphabet characters)
180-
file(RELATIVE_PATH targetpath "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
201+
file(RELATIVE_PATH
202+
targetpath
203+
"${CMAKE_BINARY_DIR}"
204+
"${CMAKE_CURRENT_BINARY_DIR}")
181205
string(REGEX REPLACE "[^A-Za-z/_]" "" targetpath "${targetpath}")
182206
string(REPLACE "/" "_" targetpath "${targetpath}")
183207

@@ -194,11 +218,7 @@ function(add_boost_test _name)
194218
endif()
195219

196220
if(RESOURCES)
197-
set_property(TARGET
198-
${_target_name}
199-
PROPERTY
200-
RESOURCE
201-
${RESOURCES})
221+
set_property(TARGET ${_target_name} PROPERTY RESOURCE ${RESOURCES})
202222
copy_resources_to_build_tree(${_target_name})
203223
endif()
204224

@@ -215,30 +235,32 @@ function(add_boost_test _name)
215235
set(_test_command ${_target_name})
216236
endif()
217237

218-
if(TESTS AND ("${Boost_VERSION}" VERSION_GREATER "103799"))
238+
if(TESTS AND ( "${Boost_VERSION}" VERSION_GREATER "103799" ))
219239
foreach(_test ${TESTS})
220-
add_test(NAME ${_name}-${_test}
240+
add_test(NAME
241+
${_name}-${_test}
221242
COMMAND
222-
${_test_command}
223-
--run_test=${_test}
224-
${Boost_TEST_FLAGS})
243+
${_test_command}
244+
--run_test=${_test}
245+
${Boost_TEST_FLAGS})
225246
if(FAIL_REGULAR_EXPRESSION)
226-
set_tests_properties(${_name}-${_test}
227-
PROPERTIES
228-
FAIL_REGULAR_EXPRESSION
229-
"${FAIL_REGULAR_EXPRESSION}")
247+
set_tests_properties(${_name}-${_test}
248+
PROPERTIES
249+
FAIL_REGULAR_EXPRESSION
250+
"${FAIL_REGULAR_EXPRESSION}")
230251
endif()
231252
endforeach()
232253
else()
233-
add_test(NAME ${_name}-boost_test
254+
add_test(NAME
255+
${_name}-boost_test
234256
COMMAND
235-
${_test_command}
236-
${Boost_TEST_FLAGS})
257+
${_test_command}
258+
${Boost_TEST_FLAGS})
237259
if(FAIL_REGULAR_EXPRESSION)
238-
set_tests_properties(${_name}-${_test}
239-
PROPERTIES
240-
FAIL_REGULAR_EXPRESSION
241-
"${FAIL_REGULAR_EXPRESSION}")
260+
set_tests_properties(${_name}-${_test}
261+
PROPERTIES
262+
FAIL_REGULAR_EXPRESSION
263+
"${FAIL_REGULAR_EXPRESSION}")
242264
endif()
243265
endif()
244266

BundleOSGPlugins.cmake

+13-5
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,18 @@ function(_osgbundle_split_debug_versions releasevar debugvar)
4242
endfunction()
4343

4444
function(_osgbundle_find_plugins varprefix filenameprefix)
45-
file(GLOB all "${OSG_RUNTIME_LIBRARY_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}/${filenameprefix}*${CMAKE_SHARED_LIBRARY_SUFFIX}")
46-
_osgbundle_split_debug_versions(${varprefix}_PLUGINS_RELEASE ${varprefix}_PLUGINS_DEBUG ${all})
47-
set(${varprefix}_PLUGINS_RELEASE "${${varprefix}_PLUGINS_RELEASE}" PARENT_SCOPE)
48-
set(${varprefix}_PLUGINS_DEBUG "${${varprefix}_PLUGINS_DEBUG}" PARENT_SCOPE)
45+
file(GLOB
46+
all
47+
"${OSG_RUNTIME_LIBRARY_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}/${filenameprefix}*${CMAKE_SHARED_LIBRARY_SUFFIX}")
48+
_osgbundle_split_debug_versions(${varprefix}_PLUGINS_RELEASE
49+
${varprefix}_PLUGINS_DEBUG
50+
${all})
51+
set(${varprefix}_PLUGINS_RELEASE
52+
"${${varprefix}_PLUGINS_RELEASE}"
53+
PARENT_SCOPE)
54+
set(${varprefix}_PLUGINS_DEBUG
55+
"${${varprefix}_PLUGINS_DEBUG}"
56+
PARENT_SCOPE)
4957
endfunction()
5058

5159
if(OPENSCENEGRAPH_FOUND)
@@ -72,4 +80,4 @@ function(install_osg_plugins var)
7280
list(APPEND INSTALLEDPLUGINS "${OSG_PATH_TO_PLUGINS}/${name}")
7381
endforeach()
7482
set(${var} ${INSTALLEDPLUGINS} PARENT_SCOPE)
75-
endfunction()
83+
endfunction()

BundleOSGRuntime.cmake

+13-9
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ function(_osgbundle_split_debug_versions releasevar debugvar)
3434
endfunction()
3535

3636
function(_osgbundle_find_plugins varprefix filenameprefix)
37-
file(GLOB all "${OSG_RUNTIME_LIBRARY_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}/${filenameprefix}*${CMAKE_SHARED_LIBRARY_SUFFIX}")
38-
_osgbundle_split_debug_versions(${varprefix}_PLUGINS_RELEASE ${varprefix}_PLUGINS_DEBUG ${all})
37+
file(GLOB
38+
all
39+
"${OSG_RUNTIME_LIBRARY_DIR}/osgPlugins-${OPENSCENEGRAPH_VERSION}/${filenameprefix}*${CMAKE_SHARED_LIBRARY_SUFFIX}")
40+
_osgbundle_split_debug_versions(${varprefix}_PLUGINS_RELEASE
41+
${varprefix}_PLUGINS_DEBUG
42+
${all})
3943
endfunction()
4044

4145
if(OPENSCENEGRAPH_FOUND)
@@ -61,9 +65,9 @@ if(OPENSCENEGRAPH_FOUND)
6165
set(OSG_RUNTIME_LIBRARY_DIR "${_osglibdir}")
6266
set(_osgbundle_platformOK on)
6367
endif()
64-
68+
6569
# Find the osgDB plugins
66-
70+
6771
_osgbundle_find_plugins(OSGDB osgdb)
6872
_osgbundle_find_plugins(OSGWRAPPER osgwrapper)
6973
endif()
@@ -94,7 +98,7 @@ if(OSGRUNTIME_BUNDLE AND OPENSCENEGRAPH_FOUND AND _osgbundle_caninstall)
9498
if(WIN32)
9599
set(DESTINATION bin)
96100
install(FILES "${OSGBUNDLE_zlib1dll}"
97-
DESTINATION ${DESTINATION})
101+
DESTINATION ${DESTINATION})
98102

99103
if(OSGBUNDLE_zlib1ddll)
100104
install(FILES "${OSGBUNDLE_zlib1ddll}"
@@ -106,9 +110,9 @@ if(OSGRUNTIME_BUNDLE AND OPENSCENEGRAPH_FOUND AND _osgbundle_caninstall)
106110
endif()
107111

108112
install(DIRECTORY "${_osgroot}/bin/" "${_osgroot}/lib/"
109-
DESTINATION ${DESTINATION}
110-
FILES_MATCHING
113+
DESTINATION ${DESTINATION}
114+
FILES_MATCHING
111115

112-
# Runtime files
113-
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")
116+
# Runtime files
117+
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")
114118
endif()

CopyResourcesToBuildTree.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function(copy_resources_to_build_tree _target)
2323
get_target_property(_resources ${_target} RESOURCE)
2424
if(NOT _resources)
2525
# Bail if no resources
26-
message(STATUS "Told to copy resources for target ${_target}, but "
26+
message(STATUS
27+
"Told to copy resources for target ${_target}, but "
2728
"no resources are set!")
2829
return()
2930
endif()

CppcheckTargets.cmake

+10-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function(add_cppcheck_sources _targetname)
6161

6262
list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
6363
if("${_fail_on_warn}" GREATER "-1")
64-
list(APPEND CPPCHECK_FAIL_REGULAR_EXPRESSION ${CPPCHECK_WARN_REGULAR_EXPRESSION})
64+
list(APPEND
65+
CPPCHECK_FAIL_REGULAR_EXPRESSION
66+
${CPPCHECK_WARN_REGULAR_EXPRESSION})
6567
list(REMOVE_AT _input ${_unused_func})
6668
endif()
6769

@@ -80,7 +82,8 @@ function(add_cppcheck_sources _targetname)
8082
if(EXISTS "${_cppcheck_loc}")
8183
list(APPEND _files "${_cppcheck_loc}")
8284
else()
83-
message(FATAL_ERROR "Adding CPPCHECK for file target ${_targetname}: "
85+
message(FATAL_ERROR
86+
"Adding CPPCHECK for file target ${_targetname}: "
8487
"File ${_source} does not exist or needs a corrected path location "
8588
"since we think its absolute path is ${_cppcheck_loc}")
8689
endif()
@@ -129,7 +132,8 @@ endfunction()
129132

130133
function(add_cppcheck _name)
131134
if(NOT TARGET ${_name})
132-
message(FATAL_ERROR "add_cppcheck given a target name that does not exist: '${_name}' !")
135+
message(FATAL_ERROR
136+
"add_cppcheck given a target name that does not exist: '${_name}' !")
133137
endif()
134138
if(CPPCHECK_FOUND)
135139
set(_cppcheck_args)
@@ -151,7 +155,9 @@ function(add_cppcheck _name)
151155

152156
list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
153157
if("${_fail_on_warn}" GREATER "-1")
154-
list(APPEND CPPCHECK_FAIL_REGULAR_EXPRESSION ${CPPCHECK_WARN_REGULAR_EXPRESSION})
158+
list(APPEND
159+
CPPCHECK_FAIL_REGULAR_EXPRESSION
160+
${CPPCHECK_WARN_REGULAR_EXPRESSION})
155161
list(REMOVE_AT _input ${_unused_func})
156162
endif()
157163

CreateDashboardScripts.cmake

+2-3
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ if(NOT IN_DASHBOARD_SCRIPT)
118118

119119
if(NOT "1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
120120
if(IS_DIRECTORY "${CMAKE_SOURCE_DIRECTORY}/.git")
121-
find_program(DASHBOARDSCRIPT_GIT_EXECUTABLE
122-
NAMES git)
121+
find_program(DASHBOARDSCRIPT_GIT_EXECUTABLE NAMES git)
123122
if(DASHBOARDSCRIPT_GIT_EXECUTABLE)
124123

125124
set(UPDATE_TYPE "git")
@@ -164,7 +163,7 @@ function(create_dashboard_scripts)
164163
else()
165164
message(STATUS "You can add these sample lines to your crontab:")
166165
endif()
167-
166+
168167
set(_msg)
169168

170169
foreach(DASHBOARDSCRIPT_DASH_TYPE Nightly Continuous Experimental)

0 commit comments

Comments
 (0)