Skip to content

Commit

Permalink
STYLE: Remove CMake-language block-end arguments
Browse files Browse the repository at this point in the history
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.

NOTE: MUST USE GNU compliant version of sed
Run the following shell code (Adopted from Brad King scripts for CMake):

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' \
  | xargs -0 gsed -i -f convert.sed \
&& rm convert.sed
  • Loading branch information
hjmjohnson committed Dec 13, 2017
1 parent ee09b9b commit a8c550e
Show file tree
Hide file tree
Showing 30 changed files with 67 additions and 67 deletions.
4 changes: 2 additions & 2 deletions CMake/ExamplesTesting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ foreach(SOURCE_FILE ${ALL_FILES})
list(FIND NEEDS_ARGS ${EXAMPLE} SKIP_ADD)
if(SKIP_ADD EQUAL -1)
add_test(${KIT}-${EXAMPLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests Test${EXAMPLE})
endif(SKIP_ADD EQUAL -1)
endif()
set_property(TEST ${KIT}-${EXAMPLE} PROPERTY LABELS WikiExamples)
endforeach(SOURCE_FILE)
endforeach()

if(${VTK_MAJOR_VERSION} GREATER 4 )
## Version is OK if greater than 5.5
Expand Down
4 changes: 2 additions & 2 deletions CMake/SampleBuildTest.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(DASHBOARD Experimental)

if(${DASHBOARD} STREQUAL Nightly)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
endif(${DASHBOARD} STREQUAL Nightly)
endif()

file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "VTK_DIR:PATH=@VTK_DIR@")

Expand All @@ -35,7 +35,7 @@ set(ENV{DISPLAY} ":0")
ctest_start(${DASHBOARD})
if(${DASHBOARD} STREQUAL Nightly)
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}")
endif(${DASHBOARD} STREQUAL Nightly)
endif()
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
Expand Down
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ configure_file(
if(MSVC_VERSION EQUAL 1400 OR MSVC_VERSION GREATER 1400)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
endif(MSVC_VERSION EQUAL 1400 OR MSVC_VERSION GREATER 1400)
endif()

#-----------------------------------------------------------------------------
# Output directories.
if(NOT Fetch_WikiExamples AND NOT Module_WikiExamples)
if(NOT LIBRARY_OUTPUT_PATH)
set (LIBRARY_OUTPUT_PATH ${ITKWikiExamples_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
endif(NOT LIBRARY_OUTPUT_PATH)
endif()
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITKWikiExamples_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
endif(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
endif()
mark_as_advanced(LIBRARY_OUTPUT_PATH CMAKE_RUNTIME_OUTPUT_DIRECTORY)
else()
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/bin)
Expand All @@ -100,16 +100,16 @@ if(WIN32)
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
"-shared -Wl,--export-all-symbols -Wl,--enable-auto-import")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
endif(MINGW)
else(CMAKE_COMPILER_IS_GNUCXX)
endif()
else()
if(BUILD_SHARED_LIBS)
set(ITK_LIBRARY_BUILD_TYPE "SHARED")
else(BUILD_SHARED_LIBS)
else()
set(ITK_LIBRARY_BUILD_TYPE "STATIC")
endif(BUILD_SHARED_LIBS)
endif()
set(BUILD_SHARED_LIBS OFF)
endif(CMAKE_COMPILER_IS_GNUCXX)
endif(WIN32)
endif()
endif()

if (ITK_VERSION_MAJOR STRLESS 4)
if(NOT ITK_USE_REVIEW)
Expand Down Expand Up @@ -156,4 +156,4 @@ if( RUN_ADMIN_TESTS )
add_test(CheckPagesForImages ${ITKWikiExamples_SOURCE_DIR}/Admin/CheckPagesForImages)
set_tests_properties(CheckPagesForImages PROPERTIES TIMEOUT 2000)
mark_as_advanced( RUN_ADMIN_TESTS )
endif( RUN_ADMIN_TESTS )
endif()
4 changes: 2 additions & 2 deletions Curves/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions DICOM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -17,7 +17,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions EdgesAndGradients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Functions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions IO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -20,7 +20,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions ImageProcessing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)
include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresModule.cmake)
Expand Down Expand Up @@ -33,7 +33,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions ImageSegmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)
include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresModule.cmake)
Expand All @@ -19,7 +19,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Images/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Inspection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Iterators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)

Expand All @@ -20,7 +20,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
2 changes: 1 addition & 1 deletion ItkVtkGlue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ItkVtkGlue_BINARY_DIR})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()
include(GenerateItkVtkGlueConfig.cmake)

#-----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions Math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Meshes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)

Expand All @@ -21,7 +21,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Metrics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
6 changes: 3 additions & 3 deletions Morphology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ if(NOT ITKWikiExamples_BINARY_DIR)
find_package(VTK REQUIRED)
if(NOT VTK_USE_RENDERING)
message(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
endif(NOT VTK_USE_RENDERING)
endif()
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)

Expand All @@ -19,7 +19,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -18,7 +18,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions PointSet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

#
# Build all .cxx files in the directory
Expand All @@ -15,7 +15,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
4 changes: 2 additions & 2 deletions Registration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif(NOT ITKWikiExamples_BINARY_DIR)
endif()

include(${ITKWikiExamples_SOURCE_DIR}/CMake/RequiresVersion.cmake)

Expand All @@ -20,7 +20,7 @@ foreach(SOURCE_FILE ${ALL_FILES})
string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" EXAMPLE ${TMP})
add_executable(${WIKI}${EXAMPLE} MACOSX_BUNDLE ${EXAMPLE}.cxx)
target_link_libraries(${WIKI}${EXAMPLE} ${ItkVtkGlue} ${ITK_LIBRARIES})
endforeach(SOURCE_FILE)
endforeach()

if(BUILD_TESTING)
# Testing
Expand Down
Loading

0 comments on commit a8c550e

Please sign in to comment.