Skip to content

Commit 9db3116

Browse files
kwrobotbradking
authored andcommitted
Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
1 parent 77543bd commit 9db3116

File tree

385 files changed

+4107
-4107
lines changed

Some content is hidden

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

385 files changed

+4107
-4107
lines changed

CMakeCPack.cmake

+13-13
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
2323
endif()
2424

2525
include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
26-
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
26+
endif()
2727

2828
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
2929
set(CPACK_PACKAGE_VENDOR "Kitware")
@@ -56,37 +56,37 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
5656
# cygwin is good for the system name
5757
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
5858
set(CPACK_SYSTEM_NAME Cygwin)
59-
else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
59+
else()
6060
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
61-
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
62-
endif(NOT DEFINED CPACK_SYSTEM_NAME)
61+
endif()
62+
endif()
6363
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
6464
if(CMAKE_CL_64)
6565
set(CPACK_SYSTEM_NAME win64-x64)
66-
else(CMAKE_CL_64)
66+
else()
6767
set(CPACK_SYSTEM_NAME win32-x86)
68-
endif(CMAKE_CL_64)
69-
endif(${CPACK_SYSTEM_NAME} MATCHES Windows)
68+
endif()
69+
endif()
7070

7171
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
7272
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
7373
# default to source package - system, on cygwin system is not
7474
# needed
7575
if(CYGWIN)
7676
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
77-
else(CYGWIN)
77+
else()
7878
set(CPACK_PACKAGE_FILE_NAME
7979
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
80-
endif(CYGWIN)
81-
endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
80+
endif()
81+
endif()
8282

8383
set(CPACK_PACKAGE_CONTACT "[email protected]")
8484

8585
if(UNIX)
8686
set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
8787
set(CPACK_SOURCE_STRIP_FILES "")
8888
set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
89-
endif(UNIX)
89+
endif()
9090

9191
# cygwin specific packaging stuff
9292
if(CYGWIN)
@@ -110,7 +110,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
110110
# configures some files and adds some install targets
111111
# this file uses some of the package file name variables
112112
include(Utilities/Release/Cygwin/CMakeLists.txt)
113-
endif(CYGWIN)
113+
endif()
114114

115115
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
116116
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
@@ -120,4 +120,4 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
120120

121121
# include CPack model once all variables are set
122122
include(CPack)
123-
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
123+
endif()

CMakeCPackOptions.cmake.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
3232
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
3333
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
3434
set(CPACK_NSIS_MODIFY_PATH ON)
35-
endif(CPACK_GENERATOR MATCHES "NSIS")
35+
endif()
3636

3737
# include the cpack options for qt dialog if they exisit
3838
# they might not if qt was not enabled for the build
@@ -42,12 +42,12 @@ if(CPACK_GENERATOR MATCHES "CygwinSource")
4242
# when packaging source make sure the .build directory is not included
4343
set(CPACK_SOURCE_IGNORE_FILES
4444
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
45-
endif(CPACK_GENERATOR MATCHES "CygwinSource")
45+
endif()
4646

4747
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
4848
if(CMAKE_PACKAGE_QTGUI)
4949
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
50-
else(CMAKE_PACKAGE_QTGUI)
50+
else()
5151
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
52-
endif(CMAKE_PACKAGE_QTGUI)
53-
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
52+
endif()
53+
endif()

CMakeLists.txt

+47-47
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
6767
else()
6868
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
6969
endif()
70-
endforeach(util)
70+
endforeach()
7171
if(CMAKE_BOOTSTRAP)
7272
unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
7373
endif()
@@ -87,23 +87,23 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
8787
foreach(util ${UTILITIES})
8888
if(CMAKE_USE_SYSTEM_${util})
8989
message(STATUS "Using system-installed ${util}")
90-
endif(CMAKE_USE_SYSTEM_${util})
91-
endforeach(util)
90+
endif()
91+
endforeach()
9292

9393
# Inform utility library header wrappers whether to use system versions.
9494
configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
9595
${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
9696
@ONLY)
9797

98-
endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
98+
endmacro()
9999

100100

101101

102102

103103
set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
104104
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
105105
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
106-
endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
106+
endif()
107107

108108

109109
#-----------------------------------------------------------------------
@@ -113,7 +113,7 @@ endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
113113
macro(CMAKE_SETUP_TESTING)
114114
if (NOT DART_ROOT)
115115
set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
116-
endif (NOT DART_ROOT)
116+
endif ()
117117

118118
if(BUILD_TESTING)
119119
set(CMAKE_TEST_GENERATOR "" CACHE STRING
@@ -123,28 +123,28 @@ macro(CMAKE_SETUP_TESTING)
123123
if(NOT CMAKE_TEST_GENERATOR)
124124
set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
125125
set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
126-
else(NOT CMAKE_TEST_GENERATOR)
126+
else()
127127
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
128-
endif(NOT CMAKE_TEST_GENERATOR)
128+
endif()
129129

130130
# Are we testing with the MSVC compiler?
131131
set(CMAKE_TEST_MSVC 0)
132132
if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
133133
set(CMAKE_TEST_MSVC 1)
134-
else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
134+
else()
135135
if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
136136
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
137137
set(CMAKE_TEST_MSVC 1)
138138
endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
139139
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
140-
endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
140+
endif()
141141

142142
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
143143
foreach(util CURL EXPAT XMLRPC ZLIB)
144144
if(CMAKE_USE_SYSTEM_${util})
145145
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
146-
endif(CMAKE_USE_SYSTEM_${util})
147-
endforeach(util)
146+
endif()
147+
endforeach()
148148

149149
# This variable is set by cmake, however to
150150
# test cmake we want to make sure that
@@ -154,7 +154,7 @@ macro(CMAKE_SETUP_TESTING)
154154
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
155155
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
156156
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
157-
endif(BUILD_TESTING)
157+
endif()
158158

159159
# configure some files for testing
160160
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
@@ -171,10 +171,10 @@ macro(CMAKE_SETUP_TESTING)
171171
if(BUILD_TESTING AND DART_ROOT)
172172
configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
173173
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
174-
endif(BUILD_TESTING AND DART_ROOT)
174+
endif()
175175
mark_as_advanced(DART_ROOT)
176176
mark_as_advanced(CURL_TESTING)
177-
endmacro(CMAKE_SETUP_TESTING)
177+
endmacro()
178178

179179

180180
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
@@ -205,7 +205,7 @@ macro(CMAKE_SET_TARGET_FOLDER tgt folder)
205205
else()
206206
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
207207
endif()
208-
endmacro(CMAKE_SET_TARGET_FOLDER)
208+
endmacro()
209209

210210

211211
#-----------------------------------------------------------------------
@@ -266,15 +266,15 @@ macro (CMAKE_BUILD_UTILITIES)
266266
if(NOT ZLIB_FOUND)
267267
message(FATAL_ERROR
268268
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
269-
endif(NOT ZLIB_FOUND)
269+
endif()
270270
set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
271271
set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
272-
else(CMAKE_USE_SYSTEM_ZLIB)
272+
else()
273273
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
274274
set(CMAKE_ZLIB_LIBRARIES cmzlib)
275275
add_subdirectory(Utilities/cmzlib)
276276
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
277-
endif(CMAKE_USE_SYSTEM_ZLIB)
277+
endif()
278278

279279
#---------------------------------------------------------------------
280280
# Build Curl library for CTest.
@@ -283,26 +283,26 @@ macro (CMAKE_BUILD_UTILITIES)
283283
if(NOT CURL_FOUND)
284284
message(FATAL_ERROR
285285
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
286-
endif(NOT CURL_FOUND)
286+
endif()
287287
set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
288288
set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
289-
else(CMAKE_USE_SYSTEM_CURL)
289+
else()
290290
set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
291291
set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
292292
set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
293293
option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
294294
if(NOT CMAKE_BUILD_CURL_SHARED)
295295
add_definitions(-DCURL_STATICLIB)
296-
endif(NOT CMAKE_BUILD_CURL_SHARED)
296+
endif()
297297
set(CMAKE_CURL_INCLUDES)
298298
set(CMAKE_CURL_LIBRARIES cmcurl)
299299
if(CMAKE_TESTS_CDASH_SERVER)
300300
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
301-
endif(CMAKE_TESTS_CDASH_SERVER)
301+
endif()
302302
add_subdirectory(Utilities/cmcurl)
303303
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
304304
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
305-
endif(CMAKE_USE_SYSTEM_CURL)
305+
endif()
306306

307307
#---------------------------------------------------------------------
308308
# Build Compress library for CTest.
@@ -334,7 +334,7 @@ macro (CMAKE_BUILD_UTILITIES)
334334
endif()
335335
set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
336336
set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
337-
else(CMAKE_USE_SYSTEM_LIBARCHIVE)
337+
else()
338338
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
339339
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
340340
add_definitions(-DLIBARCHIVE_STATIC)
@@ -346,7 +346,7 @@ macro (CMAKE_BUILD_UTILITIES)
346346
add_subdirectory(Utilities/cmlibarchive)
347347
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
348348
set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
349-
endif(CMAKE_USE_SYSTEM_LIBARCHIVE)
349+
endif()
350350

351351
#---------------------------------------------------------------------
352352
# Build expat library for CMake and CTest.
@@ -355,15 +355,15 @@ macro (CMAKE_BUILD_UTILITIES)
355355
if(NOT EXPAT_FOUND)
356356
message(FATAL_ERROR
357357
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
358-
endif(NOT EXPAT_FOUND)
358+
endif()
359359
set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
360360
set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
361-
else(CMAKE_USE_SYSTEM_EXPAT)
361+
else()
362362
set(CMAKE_EXPAT_INCLUDES)
363363
set(CMAKE_EXPAT_LIBRARIES cmexpat)
364364
add_subdirectory(Utilities/cmexpat)
365365
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
366-
endif(CMAKE_USE_SYSTEM_EXPAT)
366+
endif()
367367

368368
#---------------------------------------------------------------------
369369
# Build XMLRPC library for CMake and CTest.
@@ -372,10 +372,10 @@ macro (CMAKE_BUILD_UTILITIES)
372372
if(NOT XMLRPC_FOUND)
373373
message(FATAL_ERROR
374374
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
375-
endif(NOT XMLRPC_FOUND)
375+
endif()
376376
set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
377377
set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
378-
endif(CTEST_USE_XMLRPC)
378+
endif()
379379

380380
#---------------------------------------------------------------------
381381
# Use curses?
@@ -386,20 +386,20 @@ macro (CMAKE_BUILD_UTILITIES)
386386
find_package(Curses QUIET)
387387
if (CURSES_LIBRARY)
388388
option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
389-
else (CURSES_LIBRARY)
389+
else ()
390390
message("Curses libraries were not found. Curses GUI for CMake will not be built.")
391391
set(BUILD_CursesDialog 0)
392-
endif (CURSES_LIBRARY)
393-
else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
392+
endif ()
393+
else()
394394
set(BUILD_CursesDialog 0)
395-
endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
396-
else (UNIX)
395+
endif()
396+
else ()
397397
set(BUILD_CursesDialog 0)
398-
endif (UNIX)
398+
endif ()
399399
if(BUILD_CursesDialog)
400400
add_subdirectory(Source/CursesDialog/form)
401-
endif(BUILD_CursesDialog)
402-
endmacro (CMAKE_BUILD_UTILITIES)
401+
endif()
402+
endmacro ()
403403

404404
#-----------------------------------------------------------------------
405405
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
@@ -509,7 +509,7 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
509509
#
510510
if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
511511
set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
512-
endif("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
512+
endif()
513513

514514
# build the utilities (a macro defined in this file)
515515
CMAKE_BUILD_UTILITIES()
@@ -524,8 +524,8 @@ if(BUILD_CursesDialog)
524524
set(CURSES_NEED_RPATH FALSE)
525525
if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
526526
set(CURSES_NEED_RPATH TRUE)
527-
endif(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
528-
endif(BUILD_CursesDialog)
527+
endif()
528+
endif()
529529

530530
if(BUILD_QtDialog)
531531
if(APPLE)
@@ -538,16 +538,16 @@ if(BUILD_QtDialog)
538538
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
539539
if(NOT "${ENDCH}" STREQUAL "/")
540540
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
541-
endif(NOT "${ENDCH}" STREQUAL "/")
541+
endif()
542542
set(CMAKE_INSTALL_PREFIX
543543
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
544-
endif(APPLE)
544+
endif()
545545

546546
set(QT_NEED_RPATH FALSE)
547547
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
548548
set(QT_NEED_RPATH TRUE)
549-
endif(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
550-
endif(BUILD_QtDialog)
549+
endif()
550+
endif()
551551

552552

553553
# The same might be true on other systems for other libraries.
@@ -563,7 +563,7 @@ if (UNIX)
563563
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
564564
endif(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
565565
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
566-
endif (UNIX)
566+
endif ()
567567

568568

569569
# add the uninstall support

0 commit comments

Comments
 (0)