Remove CMake-language block-end command arguments
authorHans Johnson <hans-johnson@uiowa.edu>
Sun, 10 Jul 2016 19:38:44 +0000 (14:38 -0500)
committerHans Johnson <hans-johnson@uiowa.edu>
Sun, 10 Jul 2016 19:38:48 +0000 (14:38 -0500)
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:

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

13 files changed:
BLAS/CMakeLists.txt
BLAS/TESTING/CMakeLists.txt
CBLAS/CMakeLists.txt
CBLAS/src/CMakeLists.txt
CBLAS/testing/CMakeLists.txt
CMAKE/CheckTimeFunction.cmake
CMAKE/FortranMangling.cmake
CMakeLists.txt
LAPACKE/CMakeLists.txt
TESTING/CMakeLists.txt
TESTING/EIG/CMakeLists.txt
TESTING/LIN/CMakeLists.txt
lapack_build.cmake

index 45e68e9..9958f8b 100644 (file)
@@ -1,7 +1,7 @@
 add_subdirectory(SRC)
 if(BUILD_TESTING)
 add_subdirectory(TESTING)
-endif(BUILD_TESTING)
+endif()
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/blas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/blas.pc)
 install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/blas.pc
index 2b7a6a6..e0d9a05 100644 (file)
@@ -43,7 +43,7 @@ macro(add_blas_test name src)
         -DINTDIR=${CMAKE_CFG_INTDIR}
         -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
     endif()
-endmacro(add_blas_test)
+endmacro()
 
 if(BUILD_SINGLE)
   add_blas_test(xblat1s sblat1.f)
index 9f6f043..a4a9b8d 100644 (file)
@@ -34,11 +34,11 @@ install( FILES ${CBLAS_INCLUDE} ${LAPACK_BINARY_DIR}/include/cblas_mangling.h DE
 if(BUILD_TESTING)
    add_subdirectory(testing)
    add_subdirectory(examples)
-endif(BUILD_TESTING)
+endif()
 
 if(NOT BLAS_FOUND)
   set(ALL_TARGETS ${ALL_TARGETS} blas)
-endif(NOT BLAS_FOUND)
+endif()
 
 # Export cblas targets from the
 # install tree, if any.
index 41b74a2..90496b9 100644 (file)
@@ -146,22 +146,22 @@ set(ALLOBJ ${SCLEV1} ${SLEV1} ${SLEV2} ${SLEV3} ${ERRHAND}
 # Single real precision
 if(CBLAS_SINGLE)
  set(ALLOBJ ${SCLEV1} ${SLEV1} ${SLEV2} ${SLEV3} ${ERRHAND})
-endif(CBLAS_SINGLE)
+endif()
 
 # Double real precision
 if(CBLAS_DOUBLE)
  set(ALLOBJ  ${DLEV1} ${DLEV2} ${DLEV3} ${ERRHAND})
-endif(CBLAS_DOUBLE)
+endif()
 
 # Single complex precision
 if (CBLAS_COMPLEX)
  set(ALLOBJ  ${CLEV1} ${SCLEV1} ${CLEV2} ${CLEV3} ${ERRHAND})
-endif(CBLAS_COMPLEX)
+endif()
 
 # Double complex precision
 if (CBLAS_COMPLEX16)
  set(ALLOBJ  ${ZLEV1} ${ZLEV2} ${ZLEV3} ${ERRHAND})
-endif(CBLAS_COMPLEX16)
+endif()
 
 add_library(cblas ${ALLOBJ})
 target_link_libraries(cblas ${BLAS_LIBRARIES} )
index 2456d22..5648029 100644 (file)
@@ -22,7 +22,7 @@ macro(add_cblas_test output input target)
         -DINTDIR=${CMAKE_CFG_INTDIR}
         -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
     endif()
-endmacro(add_cblas_test)
+endmacro()
 
 
 # Object files for single real precision
index 350a591..b573948 100644 (file)
@@ -18,11 +18,11 @@ macro(CHECK_TIME_FUNCTION FUNCTION VARIABLE)
       message(STATUS "Looking for Fortran ${FUNCTION} - found")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Fortran ${FUNCTION} exists. ${OUTPUT} \n\n")
-    else(RES)
+    else()
       message(STATUS "Looking for Fortran ${FUNCTION} - not found")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Fortran ${FUNCTION} does not exist. \n ${OUTPUT} \n")
-    endif(RES)
-endmacro(CHECK_TIME_FUNCTION)
+    endif()
+endmacro()
 
 
index e0a9fd5..d772dc9 100644 (file)
@@ -23,7 +23,7 @@ message(STATUS "=========")
       "Fortran compiler option for setting object file name.")
     set(F77_OUTPUT_EXE "/Fe" CACHE INTERNAL
       "Fortran compiler option for setting executable file name.")
-  else(${F77} STREQUAL "ifort.exe")
+  else()
     # in other case, let user specify their fortran configrations.
     set(F77_OPTION_COMPILE "-c" CACHE STRING
       "Fortran compiler option for compiling without linking.")
@@ -35,7 +35,7 @@ message(STATUS "=========")
       "Library path for the fortran compiler")
     set(F77_INCLUDE_PATH "" CACHE PATH
       "Include path for the fortran compiler")
-  endif(${F77} STREQUAL "ifort.exe")
+  endif()
 
 
 message(STATUS "Testing FORTRAN_MANGLING")
@@ -102,4 +102,4 @@ message(STATUS "Running ./xintface...")
           message(FATAL_ERROR "FORTRAN_MANGLING:ERROR ${xintface_ERR}")
       endif()
 
-endmacro(FORTRAN_MANGLING)
+endmacro()
index b32976f..21cc547 100644 (file)
@@ -157,17 +157,17 @@ if(BLAS_LIBRARIES)
   unset( CMAKE_REQUIRED_LIBRARIES )
   if(BLAS_FOUND)
     message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.")
-  else(BLAS_FOUND)
+  else()
     message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS_LIBRARIES}.")
     message(ERROR "-->     Will use REFERENCE BLAS (by default)")
     message(ERROR "-->     Or Correct your BLAS_LIBRARIES entry ")
     message(ERROR "-->     Or Consider checking USE_OPTIMIZED_BLAS")
-  endif(BLAS_FOUND)
+  endif()
 
 # User did not provide a BLAS Library but specified to search for one
 elseif( USE_OPTIMIZED_BLAS )
   find_package( BLAS )
-endif (BLAS_LIBRARIES)
+endif ()
 
 # Neither user specified or optimized BLAS libraries can be used
 if(NOT BLAS_FOUND)
@@ -184,7 +184,7 @@ else()
   set( CMAKE_SHARED_LINKER_FLAGS
     "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
     CACHE STRING "Linker flags for shared libs" FORCE)
-endif( NOT BLAS_FOUND )
+endif()
 
 
 # --------------------------------------------------
@@ -193,7 +193,7 @@ option(CBLAS "Build CBLAS" OFF)
 
 if(CBLAS)
   add_subdirectory(CBLAS)
-endif(CBLAS)
+endif()
 
 # --------------------------------------------------
 # XBLAS
@@ -201,7 +201,7 @@ endif(CBLAS)
 option(USE_XBLAS "Build extended precision (needs XBLAS)" OFF)
 if (USE_XBLAS)
   find_library(XBLAS_LIBRARY NAMES xblas)
-endif(USE_XBLAS)
+endif()
 
 option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
 
@@ -210,7 +210,7 @@ option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library i
 # User did not provide a LAPACK Library but specified to search for one
 if( USE_OPTIMIZED_LAPACK )
   find_package( LAPACK )
-endif (USE_OPTIMIZED_LAPACK)
+endif ()
 
 # Check the usage of the user provided or automatically found LAPACK libraries
 if(LAPACK_LIBRARIES)
@@ -221,13 +221,13 @@ if(LAPACK_LIBRARIES)
   unset( CMAKE_REQUIRED_LIBRARIES )
   if(LATESTLAPACK_FOUND)
     message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
-  else(LAPACK_FOUND)
+  else()
     message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0,   CANNOT USE ${LAPACK_LIBRARIES}.")
     message(ERROR "-->     Will use REFERENCE LAPACK (by default)")
     message(ERROR "-->     Or Correct your LAPACK_LIBRARIES entry ")
     message(ERROR "-->     Or Consider checking USE_OPTIMIZED_LAPACK")
-  endif(LATESTLAPACK_FOUND)
-endif (LAPACK_LIBRARIES)
+  endif()
+endif ()
 
 # Neither user specified or optimized LAPACK libraries can be used
 if(NOT LATESTLAPACK_FOUND)
@@ -248,12 +248,12 @@ else()
   set( CMAKE_SHARED_LINKER_FLAGS
     "${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
     CACHE STRING "Linker flags for shared libs" FORCE)
-endif( NOT LATESTLAPACK_FOUND )
+endif()
 
 message(STATUS "BUILD TESTING : ${BUILD_TESTING}" )
 if(BUILD_TESTING)
   add_subdirectory(TESTING)
-endif(BUILD_TESTING)
+endif()
 
 # deprecated LAPACK routines
 option(BUILD_DEPRECATED "Build deprecated routines" OFF)
@@ -269,12 +269,12 @@ if (LAPACKE_WITH_TMG)
   set(LAPACKE ON)
   if(NOT BUILD_TESTING)
      add_subdirectory(TESTING/MATGEN)
-   endif(NOT BUILD_TESTING)
-endif(LAPACKE_WITH_TMG)
+   endif()
+endif()
 
 if(LAPACKE)
   add_subdirectory(LAPACKE)
-endif(LAPACKE)
+endif()
 
 # --------------------------------------------------
 # CPACK Packaging
@@ -296,12 +296,12 @@ if(WIN32 AND NOT UNIX)
   set(CPACK_NSIS_MODIFY_PATH ON)
   set(CPACK_NSIS_DISPLAY_NAME "LAPACK-${LAPACK_VERSION}")
   set(CPACK_PACKAGE_RELOCATABLE "true")
-else(WIN32 AND NOT UNIX)
+else()
   set(CPACK_GENERATOR "TGZ")
   set(CPACK_SOURCE_GENERATOR TGZ)
   set(CPACK_SOURCE_PACKAGE_FILE_NAME "lapack-${LAPACK_VERSION}" )
   set(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES} )
-endif(WIN32 AND NOT UNIX)
+endif()
 include(CPack)
 
 
@@ -313,15 +313,15 @@ option(BUILD_STATIC_LIBS "Build static libraries" ON )
 
 if(NOT BLAS_FOUND)
   set(ALL_TARGETS ${ALL_TARGETS} blas)
-endif(NOT BLAS_FOUND)
+endif()
 
 if(NOT LATESTLAPACK_FOUND)
   set(ALL_TARGETS ${ALL_TARGETS} lapack)
-endif(NOT LATESTLAPACK_FOUND)
+endif()
 
 if(BUILD_TESTING OR LAPACKE_WITH_TMG)
   set(ALL_TARGETS ${ALL_TARGETS} tmglib)
-endif(BUILD_TESTING OR LAPACKE_WITH_TMG)
+endif()
 
 # Export lapack targets, not including lapacke, from the
 # install tree, if any.
@@ -338,12 +338,12 @@ endif()
 # Include cblas in targets exported from the build tree.
 if(CBLAS)
   set(ALL_TARGETS ${ALL_TARGETS} cblas)
-endif(CBLAS)
+endif()
 
 # Include lapacke in targets exported from the build tree.
 if(LAPACKE)
   set(ALL_TARGETS ${ALL_TARGETS} lapacke)
-endif(LAPACKE)
+endif()
 
 # Export lapack and lapacke targets from the build tree, if any.
 set(_lapack_config_build_guard_target "")
index 737700f..164ae15 100644 (file)
@@ -19,7 +19,7 @@ endif ()
 if (WIN32 AND NOT UNIX)
  add_definitions(-DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE)
  message (STATUS "Windows BUILD")
-endif (WIN32 AND NOT UNIX)
+endif ()
 
 get_directory_property( DirDefs COMPILE_DEFINITIONS )
 
@@ -44,22 +44,22 @@ append_subdir_files(UTILS_OBJ "utils")
 if (USE_XBLAS)
    add_library(lapacke ${SRC_OBJ} ${SRCX_OBJ} ${UTILS_OBJ})
    target_link_libraries(lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${XBLAS_LIBRARY})
-else (USE_XBLAS)
+else ()
   if (LAPACKE_WITH_TMG)
    add_library(lapacke ${SRC_OBJ} ${MATGEN_OBJ} ${UTILS_OBJ})
    target_link_libraries(lapacke tmglib ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
-  else (LAPACKE_WITH_TMG)
+  else ()
    add_library(lapacke ${SRC_OBJ} ${UTILS_OBJ})
    target_link_libraries(lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
-  endif(LAPACKE_WITH_TMG)
-endif(USE_XBLAS)
+  endif()
+endif()
 
 lapack_install_library(lapacke)
 install( FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h DESTINATION include )
 
 if(BUILD_TESTING)
    add_subdirectory(example)
-endif(BUILD_TESTING)
+endif()
 
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapacke.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapacke.pc)
index b7e5db9..2d58737 100644 (file)
@@ -20,7 +20,7 @@ macro(add_lapack_test output input target)
       -DINTDIR=${CMAKE_CFG_INTDIR}
       -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
   endif()
-endmacro(add_lapack_test)
+endmacro()
 
 if (BUILD_SINGLE)
 add_lapack_test(stest.out stest.in xlintsts)
index 612bf1f..b6bc77d 100644 (file)
@@ -120,7 +120,7 @@ set(ZEIGTST  zchkee.f
 macro(add_eig_executable name )
   add_executable(${name} ${ARGN})
   target_link_libraries(${name} tmglib ${LAPACK_LIBRARIES})
-endmacro(add_eig_executable)
+endmacro()
 
 if (BUILD_SINGLE)
 add_eig_executable(xeigtsts ${SEIGTST} ${SCIGTST} ${AEIGTST}
index beb6ac6..a924b12 100644 (file)
@@ -194,7 +194,7 @@ set(ZLINTSTRFP  zchkrfp.f zdrvrfp.f zdrvrf1.f zdrvrf2.f zdrvrf3.f zdrvrf4.f zerr
 macro(add_lin_executable name )
   add_executable(${name} ${ARGN})
   target_link_libraries(${name} tmglib ${LAPACK_LIBRARIES})
-endmacro(add_lin_executable)
+endmacro()
 
 if(BUILD_SINGLE)
 add_lin_executable(xlintsts ${ALINTST} ${SCLNTST} ${SLINTST} ${SECOND_SRC} )
index 404ebd7..a9012b3 100644 (file)
@@ -5,14 +5,14 @@ cmake_minimum_required(VERSION 2.8.7)
 if(UNIX)
   if(NOT compiler)
     set(compiler gcc)
-  endif(NOT compiler)
+  endif()
   if(NOT c_compiler)
     set(c_compiler gcc)
-  endif(NOT c_compiler)
+  endif()
   if(NOT full_compiler)
     set(full_compiler g++)
-  endif(NOT full_compiler)
-endif(UNIX)
+  endif()
+endif()
 
 if(EXISTS "/proc/cpuinfo")
   set(parallel 1)
@@ -21,7 +21,7 @@ if(EXISTS "/proc/cpuinfo")
     if("${line}" MATCHES processor)
       math(EXPR parallel "${parallel} + 1")
     endif()
-  endforeach(line)
+  endforeach()
 endif()
 
 if(WIN32)
@@ -57,7 +57,7 @@ if(WIN32)
   set(CTEST_CMAKE_GENERATOR      "${GENERATOR}")
   message("${CTEST_CMAKE_GENERATOR} - found")
   set(compiler cl)
-endif(WIN32)
+endif()
 
 find_program(HOSTNAME NAMES hostname)
 find_program(UNAME NAMES uname)
@@ -70,7 +70,7 @@ message("HOSTNAME: ${hostname}")
 # default to parallel 1
 if(NOT DEFINED parallel)
   set(parallel 1)
-endif(NOT DEFINED parallel)
+endif()
 
 # find CVS
 find_program(SVN svn PATHS $ENV{HOME}/bin /vol/local/bin)
@@ -83,7 +83,7 @@ macro(getuname name flag)
   exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
   string(REGEX REPLACE "[/\\\\+<> #]" "-" "${name}" "${${name}}")
   string(REGEX REPLACE "^(......|.....|....|...|..|.).*" "\\1" "${name}" "${${name}}")
-endmacro(getuname)
+endmacro()
 
 getuname(osname -s)
 getuname(osver  -v)
@@ -97,12 +97,12 @@ if("${osname}" MATCHES Darwin)
   set(osrel "")
   if("${cpu}" MATCHES "Power")
     set(cpu "ppc")
-  endif("${cpu}" MATCHES "Power")
-endif("${osname}" MATCHES Darwin)
+  endif()
+endif()
 
 if(NOT compiler)
   message(FATAL_ERROR "compiler must be set")
-endif(NOT compiler)
+endif()
 
 
 set(BUILDNAME "${osname}${osver}${osrel}${cpu}-${compiler}")
@@ -116,9 +116,9 @@ set (CTEST_DIR_NAME "${CTEST_MODULE_NAME}SVN")
 message("NOSPACES = ${NOSPACES}")
 if(NOSPACES)
   set(CTEST_DASHBOARD_ROOT    "$ENV{HOME}/Dashboards/MyTests-${BUILDNAME}")
-else(NOSPACES)
+else()
   set(CTEST_DASHBOARD_ROOT    "$ENV{HOME}/Dashboards/My Tests-${BUILDNAME}")
-endif(NOSPACES)
+endif()
 set(CTEST_SITE              "${hostname}")
 set(CTEST_BUILD_NAME        "${BUILDNAME}")
 set(CTEST_TEST_TIMEOUT           "36000")
@@ -127,12 +127,12 @@ set(CTEST_TEST_TIMEOUT           "36000")
 if(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${CTEST_DIR_NAME}")
   set(CTEST_CHECKOUT_COMMAND
     "\"${CTEST_UPDATE_COMMAND}\" co https://icl.cs.utk.edu/svn/lapack-dev/lapack/trunk ${CTEST_DIR_NAME}")
-endif(NOT EXISTS "${CTEST_DASHBOARD_ROOT}/${CTEST_DIR_NAME}")
+endif()
 
 # Set the generator and build configuration
 if(NOT DEFINED CTEST_CMAKE_GENERATOR)
   set(CTEST_CMAKE_GENERATOR      "Unix Makefiles")
-endif(NOT DEFINED CTEST_CMAKE_GENERATOR)
+endif()
 set(CTEST_PROJECT_NAME         "LAPACK")
 set(CTEST_BUILD_CONFIGURATION  "Release")
 
@@ -142,7 +142,7 @@ if(CTEST_CMAKE_GENERATOR MATCHES Makefiles)
   set(ENV{CC}                  "${c_compiler}")
   set(ENV{FC}                  "${f_compiler}")
   set(ENV{CXX}                 "${full_compiler}")
-endif(CTEST_CMAKE_GENERATOR MATCHES Makefiles)
+endif()
 
 #----------------------------------------------------------------------------------
 # Should not need to edit under this line
@@ -164,12 +164,12 @@ set(CTEST_NOTES_FILES  "${CTEST_NOTES_FILES}"
 if(parallel GREATER 10)
   if(NOT CTEST_BUILD_COMMAND)
     set(CTEST_BUILD_COMMAND "make -j${parallel} -i")
-  endif(NOT CTEST_BUILD_COMMAND)
+  endif()
 
   message("Use parallel build")
   message("CTEST_BUILD_COMMAND: ${CTEST_BUILD_COMMAND}")
   message("CTEST_CONFIGURE_COMMAND: ${CTEST_CONFIGURE_COMMAND}")
-endif(parallel GREATER 10)
+endif()
 
 ###################################################################
 # Values for the cmake build