Skip to content

Commit

Permalink
Remove text between parentheses in "else()", "endif()" and "endforeac…
Browse files Browse the repository at this point in the history
…h()". See commontk#79

The following script allowed to automatize the work:

#!/bin/sh

for file in $(find . -type f -name '*\.cmake' -o -name '*\.txt' -o -name '*\.ctest')
do
  echo "Processing file [$file]"

  sed -i "s/endif(.*)/endif()/gI" $file
  sed -i "s/else(.*)/else()/gI" $file
  sed -i "s/endforeach(.*)/endforeach()/gI" $file
done
  • Loading branch information
jcfr committed Nov 17, 2011
1 parent a52e0f8 commit fad20d0
Show file tree
Hide file tree
Showing 53 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion Applications/Testing/Cpp/CMakeLists.txt
Expand Up @@ -50,7 +50,7 @@ if (CTK_APP_ctkDICOMQuery AND CTK_APP_ctkDICOMRetrieve)
if(WIN32)
set(CTK_APPLICATION_RUNTIME_DIRECTORY
${CTK_APPLICATION_RUNTIME_DIRECTORY}/${CMAKE_BUILD_TYPE})
endif(WIN32)
endif()

set(ctkDICOMQuery_EXECUTABLE ${CTK_APPLICATION_RUNTIME_DIRECTORY}/ctkDICOMQuery)
set(ctkDICOMQuery_DB_FILE ${CTK_BINARY_DIR}/Testing/Temporary/ctkDICOMApplicationTest1.db)
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkCLIPluginExplorer/CMakeLists.txt
Expand Up @@ -36,4 +36,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkDICOM/CMakeLists.txt
Expand Up @@ -37,4 +37,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkDICOM/Testing/Cpp/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ target_link_libraries(${KIT}CppTests ${KIT_target_libraries})
set( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
if(WIN32)
set(KIT_TESTS ${CPP_TEST_PATH}/${CMAKE_BUILD_TYPE}/${KIT}CppTests)
endif(WIN32)
endif()

macro( SIMPLE_TEST TESTNAME )
add_test( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkDICOMDemoSCU/CMakeLists.txt
Expand Up @@ -41,4 +41,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkDICOMDemoSCU/Testing/Cpp/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ target_link_libraries(${KIT}CppTests ${KIT_target_libraries})
set( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
if(WIN32)
set(KIT_TESTS ${CPP_TEST_PATH}/${CMAKE_BUILD_TYPE}/${KIT}CppTests)
endif(WIN32)
endif()

macro( SIMPLE_TEST TESTNAME )
add_test( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkDICOMIndexer/CMakeLists.txt
Expand Up @@ -37,4 +37,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkDICOMIndexer/Testing/Cpp/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ target_link_libraries(${KIT}CppTests ${KIT_target_libraries})
set( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
if(WIN32)
set(KIT_TESTS ${CPP_TEST_PATH}/${CMAKE_BUILD_TYPE}/${KIT}CppTests)
endif(WIN32)
endif()

macro( SIMPLE_TEST TESTNAME )
add_test( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkDICOMObjectViewer/CMakeLists.txt
Expand Up @@ -36,4 +36,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkDICOMQuery/CMakeLists.txt
Expand Up @@ -37,4 +37,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
#add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkDICOMQueryRetrieve/CMakeLists.txt
Expand Up @@ -37,4 +37,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
#add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
Expand Up @@ -14,7 +14,7 @@ target_link_libraries(${KIT}CppTests ${LIBRARY_NAME})
set( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
if(WIN32)
set(KIT_TESTS ${CPP_TEST_PATH}/${CMAKE_BUILD_TYPE}/${KIT}CppTests)
endif(WIN32)
endif()

macro( SIMPLE_TEST TESTNAME )
add_test( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkDICOMRetrieve/CMakeLists.txt
Expand Up @@ -37,4 +37,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
#add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkEventBusDemo/CMakeLists.txt
Expand Up @@ -51,4 +51,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkExampleHost/CMakeLists.txt
Expand Up @@ -41,4 +41,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkExampleHostedApp/CMakeLists.txt
Expand Up @@ -39,4 +39,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkPluginBrowser/CMakeLists.txt
Expand Up @@ -46,4 +46,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkPluginGenerator/CMakeLists.txt
Expand Up @@ -43,4 +43,4 @@ ctkMacroBuildApp(
# Testing
if(BUILD_TESTING)
# add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Applications/ctkSimplePythonShell/CMakeLists.txt
Expand Up @@ -130,4 +130,4 @@ add_subdirectory(Python)
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion CMake/ctkFunctionApplyPatches.cmake
Expand Up @@ -40,7 +40,7 @@ function(ctkFunctionApplyPatches PATCH_EXE SRC_DIR PATCH_FILES)
execute_process(COMMAND ${PATCH_EXE} -p0 -i "${patch_file}" -d "${SRC_DIR}" RESULT_VARIABLE result_var)
if(result_var)
message("ERROR: ${result_var}")
endif(result_var)
endif()
endforeach()

endfunction()
14 changes: 7 additions & 7 deletions CMake/ctkFunctionCMakeDoxygenFilterCompile.cmake
Expand Up @@ -27,11 +27,11 @@ function(ctkFunctionCMakeDoxygenFilterCompile)

foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
endforeach()

foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
endforeach()

set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
Expand All @@ -43,16 +43,16 @@ function(ctkFunctionCMakeDoxygenFilterCompile)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name "${arg}")
set(current_arg_list)
else(is_arg_name GREATER -1)
else()
set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option)
if(is_option GREATER -1)
set(${prefix}_${arg} TRUE)
else(is_option GREATER -1)
else()
set(current_arg_list ${current_arg_list} "${arg}")
endif(is_option GREATER -1)
endif(is_arg_name GREATER -1)
endforeach(arg ${ARGN})
endif()
endif()
endforeach()

set(${prefix}_${current_arg_name} ${current_arg_list})

Expand Down
2 changes: 1 addition & 1 deletion CMake/ctkMacroBuildLib.cmake
Expand Up @@ -152,7 +152,7 @@ macro(ctkMacroBuildLib)

if(MINGW)
list(APPEND my_libs ssp) # add stack smash protection lib
endif(MINGW)
endif()
target_link_libraries(${lib_name} ${my_libs})

# Update CTK_BASE_LIBRARIES
Expand Down
16 changes: 8 additions & 8 deletions CMake/ctkMacroListFilter.cmake
Expand Up @@ -23,14 +23,14 @@ macro(CtkMacroListFilter)
list(LENGTH LIST_FILTER_DEFAULT_ARGS LIST_FILTER_default_length)
if(${LIST_FILTER_default_length} EQUAL 0)
message(FATAL_ERROR "LIST_FILTER: missing list variable.")
endif(${LIST_FILTER_default_length} EQUAL 0)
endif()
if(${LIST_FILTER_default_length} EQUAL 1)
message(FATAL_ERROR "LIST_FILTER: missing regular expression variable.")
endif(${LIST_FILTER_default_length} EQUAL 1)
endif()
# Reset output variable
if(NOT LIST_FILTER_OUTPUT_VARIABLE)
set(LIST_FILTER_OUTPUT_VARIABLE "LIST_FILTER_internal_output")
endif(NOT LIST_FILTER_OUTPUT_VARIABLE)
endif()
set(${LIST_FILTER_OUTPUT_VARIABLE})
# Extract input list from arguments
list(GET LIST_FILTER_DEFAULT_ARGS 0 LIST_FILTER_input_list)
Expand All @@ -40,12 +40,12 @@ macro(CtkMacroListFilter)
foreach(LIST_FILTER_regexp ${${LIST_FILTER_regexp_var}})
if(${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
list(APPEND ${LIST_FILTER_OUTPUT_VARIABLE} ${LIST_FILTER_item})
endif(${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
endforeach(LIST_FILTER_regexp ${${LIST_FILTER_regexp_var}})
endforeach(LIST_FILTER_regexp_var)
endforeach(LIST_FILTER_item)
endif()
endforeach()
endforeach()
endforeach()
# If OUTPUT_VARIABLE is not specified, overwrite the input list.
if(${LIST_FILTER_OUTPUT_VARIABLE} STREQUAL "LIST_FILTER_internal_output")
set(${LIST_FILTER_input_list} ${${LIST_FILTER_OUTPUT_VARIABLE}})
endif(${LIST_FILTER_OUTPUT_VARIABLE} STREQUAL "LIST_FILTER_internal_output")
endif()
endmacro(CtkMacroListFilter)
6 changes: 3 additions & 3 deletions CMake/ctkMacroParseArguments.cmake
Expand Up @@ -7,10 +7,10 @@ macro(CtkMacroParseArguments prefix arg_names option_names)
set(DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
endforeach()
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
endforeach()

set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
Expand All @@ -30,6 +30,6 @@ macro(CtkMacroParseArguments prefix arg_names option_names)
set(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
endforeach(arg)
endforeach()
set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro()
4 changes: 2 additions & 2 deletions CMake/ctkMacroSetupQt.cmake
Expand Up @@ -48,8 +48,8 @@ macro(ctkMacroSetupQt)
get_filename_component(QT_INSTALLED_LIBRARY_DIR ${QT_QMAKE_EXECUTABLE} PATH)
endif()

else(QT4_FOUND)
else()
message(FATAL_ERROR "error: Qt4 was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable")
endif(QT4_FOUND)
endif()

endmacro()
2 changes: 1 addition & 1 deletion CMake/ctkMacroWrapPythonQt.cmake
Expand Up @@ -119,7 +119,7 @@ macro(ctkMacroWrapPythonQt WRAPPING_NAMESPACE TARGET SRCS_LIST_NAME SOURCES IS_W
set(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH}/../lib)
if(WIN32)
set(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH})
endif(WIN32)
endif()

# Clear log file
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ctkMacroWrapPythonQt_log.txt" "")
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -721,7 +721,7 @@ endforeach()

if(BUILD_TESTING)
add_subdirectory(Applications/Testing)
endif(BUILD_TESTING)
endif()


#-----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions Documentation/CMakeLists.txt
Expand Up @@ -61,9 +61,9 @@ if( DOXYGEN_FOUND )
)
set_target_properties(doc-dev PROPERTIES LABELS Documentation)

else( DOXYGEN_DOT_FOUND )
else()
message( WARNING
"Warning: Dot not found - Documentation will not be created"
)
endif( DOXYGEN_DOT_FOUND )
endif( DOXYGEN_FOUND )
endif()
endif()
2 changes: 1 addition & 1 deletion Libs/Core/CMakeLists.txt
Expand Up @@ -134,4 +134,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/DICOM/Core/CMakeLists.txt
Expand Up @@ -94,4 +94,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/DICOM/Widgets/CMakeLists.txt
Expand Up @@ -95,4 +95,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/ImageProcessing/ITK/Core/CMakeLists.txt
Expand Up @@ -61,4 +61,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/Messaging/Core/CMakeLists.txt
Expand Up @@ -64,4 +64,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/ModuleDescription/CMakeLists.txt
Expand Up @@ -77,4 +77,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/PluginFramework/CMakeLists.txt
Expand Up @@ -162,4 +162,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/Scripting/Python/Core/CMakeLists.txt
Expand Up @@ -76,4 +76,4 @@ add_subdirectory(Python)
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/Scripting/Python/Widgets/CMakeLists.txt
Expand Up @@ -64,4 +64,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/Visualization/VTK/Core/CMakeLists.txt
Expand Up @@ -100,4 +100,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
4 changes: 2 additions & 2 deletions Libs/Visualization/VTK/Widgets/CMakeLists.txt
Expand Up @@ -113,7 +113,7 @@ IF (${CTK_USE_CHARTS})
vtkCharts
${VTK_LIBRARIES})
add_definitions(-DCTK_USE_CHARTS)
endif(${CTK_USE_CHARTS})
endif()

# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
# The following macro will read the target libraries from the file 'target_libraries.cmake'
Expand Down Expand Up @@ -146,4 +146,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/Visualization/VTK/Widgets/Plugins/CMakeLists.txt
Expand Up @@ -62,7 +62,7 @@ if(CTK_USE_CHARTS)
ctkVTKScalarsToColorsWidgetPlugin.h
ctkVTKVolumePropertyWidgetPlugin.h
${PLUGIN_MOC_SRCS})
endif(CTK_USE_CHARTS)
endif()

# Resources
set(PLUGIN_resources
Expand Down
4 changes: 2 additions & 2 deletions Libs/Visualization/VTK/Widgets/Testing/Cpp/CMakeLists.txt
Expand Up @@ -37,7 +37,7 @@ if(CTK_USE_CHARTS)
ctkVTKScalarsToColorsWidgetTest2.cpp
ctkVTKScalarsToColorsWidgetTest3.cpp
${TEST_SOURCES})
endif(CTK_USE_CHARTS)
endif()

#
# Tests expecting CTKData to be set
Expand Down Expand Up @@ -111,7 +111,7 @@ IF (CTK_USE_CHARTS)
SIMPLE_TEST( ctkVTKScalarsToColorsWidgetTest1 )
SIMPLE_TEST( ctkVTKScalarsToColorsWidgetTest2 )
SIMPLE_TEST( ctkVTKScalarsToColorsWidgetTest3 )
endif(CTK_USE_CHARTS)
endif()
SIMPLE_TEST( ctkVTKRenderViewTest1 )
SIMPLE_TEST( ctkVTKSliceViewTest1 )
SIMPLE_TEST( ctkVTKSurfaceMaterialPropertyWidgetTest1 )
Expand Down
2 changes: 1 addition & 1 deletion Libs/Visualization/XIP/CMakeLists.txt
Expand Up @@ -57,4 +57,4 @@ endif()
# Testing
if(BUILD_TESTING)
#add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()
2 changes: 1 addition & 1 deletion Libs/Widgets/CMakeLists.txt
Expand Up @@ -297,4 +297,4 @@ endif()
# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif(BUILD_TESTING)
endif()

0 comments on commit fad20d0

Please sign in to comment.