STYLE: 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.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76e0833..4ecd815 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,13 +54,13 @@
 if(EIGEN_BRANCH_OUTPUT MATCHES "default")
 string(REGEX MATCH "^changeset: *[0-9]*:([0-9;a-f]+).*" EIGEN_HG_CHANGESET_MATCH "${EIGEN_HGTIP_OUTPUT}")
 set(EIGEN_HG_CHANGESET "${CMAKE_MATCH_1}")
-endif(EIGEN_BRANCH_OUTPUT MATCHES "default")
+endif()
 #...and show it next to the version number
 if(EIGEN_HG_CHANGESET)
   set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER} (mercurial changeset ${EIGEN_HG_CHANGESET})")
-else(EIGEN_HG_CHANGESET)
+else()
   set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER}")
-endif(EIGEN_HG_CHANGESET)
+endif()
 
 
 include(CheckCXXCompilerFlag)
@@ -79,7 +79,7 @@
   if(COMPILER_SUPPORT_${SFLAG})
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}")
   endif()
-endmacro(ei_add_cxx_compiler_flag)
+endmacro()
 
 check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
 
@@ -319,7 +319,7 @@
     endif()
   endif()
 
-else(NOT MSVC)
+else()
 
   # C4127 - conditional expression is constant
   # C4714 - marked as __forceinline not inlined (I failed to deactivate it selectively)
@@ -347,9 +347,9 @@
     if(NOT CMAKE_CL_64)
       # arch is not supported on 64 bit systems, SSE is enabled automatically.
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
-    endif(NOT CMAKE_CL_64)
+    endif()
     message(STATUS "Enabling SSE2 in tests/examples")
-  endif(EIGEN_TEST_SSE2)
+  endif()
 
   option(EIGEN_TEST_AVX "Enable/Disable AVX in tests/examples" OFF)
   if(EIGEN_TEST_AVX)
@@ -363,7 +363,7 @@
     message(STATUS "Enabling FMA/AVX2 in tests/examples")
   endif()
 
-endif(NOT MSVC)
+endif()
 
 option(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION "Disable explicit vectorization in tests/examples" OFF)
 option(EIGEN_TEST_X87 "Force using X87 instructions. Implies no vectorization." OFF)
@@ -440,9 +440,9 @@
   # if the property wasn't previously set, ${previous} is now "previous-NOTFOUND" which cmake allows catching with plain if()
   if(NOT previous)
     set(previous "")
-  endif(NOT previous)
+  endif()
   set_target_properties(${target} PROPERTIES ${prop} "${previous} ${value}")
-endmacro(ei_add_target_property)
+endmacro()
 
 install(FILES
   signature_of_eigen3_matrix_library
@@ -489,11 +489,11 @@
   if(EIGEN_SYCL_TRISYCL)
     message(STATUS "Using triSYCL")
     include(FindTriSYCL)
-  else(EIGEN_SYCL_TRISYCL)
+  else()
     message(STATUS "Using ComputeCPP SYCL")
     include(FindComputeCpp)
-  endif(EIGEN_SYCL_TRISYCL)
-endif(EIGEN_TEST_SYCL)
+  endif()
+endif()
 
 add_subdirectory(unsupported)
 
@@ -505,11 +505,11 @@
 # TODO: consider also replacing EIGEN_BUILD_BTL by a custom target "make btl"?
 if(EIGEN_BUILD_BTL)
   add_subdirectory(bench/btl EXCLUDE_FROM_ALL)
-endif(EIGEN_BUILD_BTL)
+endif()
 
 if(NOT WIN32)
   add_subdirectory(bench/spbench EXCLUDE_FROM_ALL)
-endif(NOT WIN32)
+endif()
 
 configure_file(scripts/cdashtesting.cmake.in cdashtesting.cmake @ONLY)
 
@@ -605,7 +605,7 @@
 
   install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
 
-else (NOT CMAKE_VERSION VERSION_LESS 3.0)
+else ()
   # Fallback to legacy Eigen3Config.cmake without the imported target
 
   # If CMakePackageConfigHelpers module is available (CMake >= 2.8.8)
@@ -635,7 +635,7 @@
                                     VERSION ${EIGEN_VERSION_NUMBER}
                                     COMPATIBILITY SameMajorVersion )
 
-endif (NOT CMAKE_VERSION VERSION_LESS 3.0)
+endif ()
 
 install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
                 ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
diff --git a/Eigen/CMakeLists.txt b/Eigen/CMakeLists.txt
index 9eb502b..8236684 100644
--- a/Eigen/CMakeLists.txt
+++ b/Eigen/CMakeLists.txt
@@ -9,7 +9,7 @@
   if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src")
     list(APPEND Eigen_directory_files_to_install ${f})
   endif()
-endforeach(f ${Eigen_directory_files})
+endforeach()
 
 install(FILES
   ${Eigen_directory_files_to_install}
diff --git a/bench/btl/CMakeLists.txt b/bench/btl/CMakeLists.txt
index 38ff9f4..f3a10d6 100644
--- a/bench/btl/CMakeLists.txt
+++ b/bench/btl/CMakeLists.txt
@@ -29,7 +29,7 @@
 if(IS_ICPC)
   set(CMAKE_CXX_FLAGS "-fast ${CMAKE_CXX_FLAGS}")
   set(CMAKE_Fortran_FLAGS "-fast ${CMAKE_Fortran_FLAGS}")
-endif(IS_ICPC)
+endif()
 
 include_directories(
   ${PROJECT_SOURCE_DIR}/actions
@@ -41,7 +41,7 @@
 # if (MKL_FOUND)
 #   add_definitions(-DHAVE_MKL)
 #   set(DEFAULT_LIBRARIES ${MKL_LIBRARIES})
-# endif (MKL_FOUND)
+# endif ()
 
 find_library(EIGEN_BTL_RT_LIBRARY rt)
 # if we cannot find it easily, then we don't need it!
@@ -53,7 +53,7 @@
 
   foreach(_current_var ${ARGN})
     set(_last_var ${_current_var})
-  endforeach(_current_var)
+  endforeach()
 
   set(_sources ${ARGN})
   list(LENGTH _sources _argn_length)
@@ -64,7 +64,7 @@
 
   if (${_argn_length} EQUAL ${_src_length})
     set(_last_var ON)
-  endif (${_argn_length} EQUAL ${_src_length})
+  endif ()
 
   OPTION(BUILD_${targetname} "Build benchmark ${targetname}" ${_last_var})
 
@@ -86,7 +86,7 @@
     set_target_properties(${target} PROPERTIES ${prop} "${previous} ${value}")
   endif()
 
-endmacro(btl_add_target_property)
+endmacro()
 
 ENABLE_TESTING()
 
diff --git a/bench/btl/cmake/FindACML.cmake b/bench/btl/cmake/FindACML.cmake
index 4989fa2..daeeb53 100644
--- a/bench/btl/cmake/FindACML.cmake
+++ b/bench/btl/cmake/FindACML.cmake
@@ -1,7 +1,7 @@
 
 if (ACML_LIBRARIES)
   set(ACML_FIND_QUIETLY TRUE)
-endif (ACML_LIBRARIES)
+endif ()
 
 find_library(ACML_LIBRARIES
   NAMES
diff --git a/bench/btl/cmake/FindATLAS.cmake b/bench/btl/cmake/FindATLAS.cmake
index 4136a98..572a4c0 100644
--- a/bench/btl/cmake/FindATLAS.cmake
+++ b/bench/btl/cmake/FindATLAS.cmake
@@ -1,7 +1,7 @@
 
 if (ATLAS_LIBRARIES)
   set(ATLAS_FIND_QUIETLY TRUE)
-endif (ATLAS_LIBRARIES)
+endif ()
 
 find_file(ATLAS_LIB libatlas.so.3 PATHS /usr/lib /usr/lib/atlas /usr/lib64 /usr/lib64/atlas $ENV{ATLASDIR} ${LIB_INSTALL_DIR})
 find_library(ATLAS_LIB satlas PATHS $ENV{ATLASDIR} ${LIB_INSTALL_DIR})
@@ -23,7 +23,7 @@
 #     set(ATLAS_LIBRARIES ${ATLAS_LIBRARIES} ${ATLAS_REFERENCE_LAPACK})
 #   endif()
   
-endif(ATLAS_LIB AND ATLAS_CBLAS AND ATLAS_LAPACK AND ATLAS_F77BLAS)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ATLAS DEFAULT_MSG ATLAS_LIBRARIES)
diff --git a/bench/btl/cmake/FindBLAZE.cmake b/bench/btl/cmake/FindBLAZE.cmake
index dba4c89..18a878f 100644
--- a/bench/btl/cmake/FindBLAZE.cmake
+++ b/bench/btl/cmake/FindBLAZE.cmake
@@ -15,7 +15,7 @@
   # in cache already
   set(BLAZE_FOUND TRUE)
 
-else (BLAZE_INCLUDE_DIR)
+else ()
 
 find_path(BLAZE_INCLUDE_DIR NAMES blaze/Blaze.h
      PATHS
@@ -27,5 +27,5 @@
 
 mark_as_advanced(BLAZE_INCLUDE_DIR)
 
-endif(BLAZE_INCLUDE_DIR)
+endif()
 
diff --git a/bench/btl/cmake/FindBlitz.cmake b/bench/btl/cmake/FindBlitz.cmake
index 92880bb..7ab375f 100644
--- a/bench/btl/cmake/FindBlitz.cmake
+++ b/bench/btl/cmake/FindBlitz.cmake
@@ -15,7 +15,7 @@
 
 if (BLITZ_INCLUDES AND BLITZ_LIBRARIES)
   set(Blitz_FIND_QUIETLY TRUE)
-endif (BLITZ_INCLUDES AND BLITZ_LIBRARIES)
+endif ()
 
 find_path(BLITZ_INCLUDES
   NAMES
diff --git a/bench/btl/cmake/FindCBLAS.cmake b/bench/btl/cmake/FindCBLAS.cmake
index ce0f2f2..43a90f7 100644
--- a/bench/btl/cmake/FindCBLAS.cmake
+++ b/bench/btl/cmake/FindCBLAS.cmake
@@ -2,7 +2,7 @@
 
 if (CBLAS_INCLUDES AND CBLAS_LIBRARIES)
   set(CBLAS_FIND_QUIETLY TRUE)
-endif (CBLAS_INCLUDES AND CBLAS_LIBRARIES)
+endif ()
 
 find_path(CBLAS_INCLUDES
   NAMES
diff --git a/bench/btl/cmake/FindGMM.cmake b/bench/btl/cmake/FindGMM.cmake
index 5049c64..ff45e6a 100644
--- a/bench/btl/cmake/FindGMM.cmake
+++ b/bench/btl/cmake/FindGMM.cmake
@@ -1,7 +1,7 @@
 if (GMM_INCLUDE_DIR)
   # in cache already
   set(GMM_FOUND TRUE)
-else (GMM_INCLUDE_DIR)
+else ()
 
 find_path(GMM_INCLUDE_DIR NAMES gmm/gmm.h
      PATHS
@@ -14,4 +14,4 @@
 
 mark_as_advanced(GMM_INCLUDE_DIR)
 
-endif(GMM_INCLUDE_DIR)
+endif()
diff --git a/bench/btl/cmake/FindMKL.cmake b/bench/btl/cmake/FindMKL.cmake
index f4d7c6e..23e7727 100644
--- a/bench/btl/cmake/FindMKL.cmake
+++ b/bench/btl/cmake/FindMKL.cmake
@@ -1,7 +1,7 @@
 
 if (MKL_LIBRARIES)
   set(MKL_FIND_QUIETLY TRUE)
-endif (MKL_LIBRARIES)
+endif ()
 
 if(CMAKE_MINOR_VERSION GREATER 4)
 
@@ -30,7 +30,7 @@
   set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel_lp64 mkl_sequential ${MKL_GUIDE} pthread)
 endif()
 
-else(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+else()
 
 find_library(MKL_LIBRARIES
   mkl_core
@@ -55,9 +55,9 @@
   set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel mkl_sequential ${MKL_GUIDE} pthread)
 endif()
 
-endif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+endif()
 
-endif(CMAKE_MINOR_VERSION GREATER 4)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(MKL DEFAULT_MSG MKL_LIBRARIES)
diff --git a/bench/btl/cmake/FindMTL4.cmake b/bench/btl/cmake/FindMTL4.cmake
index 3de4909..1bafc93 100644
--- a/bench/btl/cmake/FindMTL4.cmake
+++ b/bench/btl/cmake/FindMTL4.cmake
@@ -15,7 +15,7 @@
   # in cache already
   set(MTL4_FOUND TRUE)
 
-else (MTL4_INCLUDE_DIR)
+else ()
 
 find_path(MTL4_INCLUDE_DIR NAMES boost/numeric/mtl/mtl.hpp
      PATHS
@@ -27,5 +27,5 @@
 
 mark_as_advanced(MTL4_INCLUDE_DIR)
 
-endif(MTL4_INCLUDE_DIR)
+endif()
 
diff --git a/bench/btl/cmake/FindOPENBLAS.cmake b/bench/btl/cmake/FindOPENBLAS.cmake
index 2a09194..5c07623 100644
--- a/bench/btl/cmake/FindOPENBLAS.cmake
+++ b/bench/btl/cmake/FindOPENBLAS.cmake
@@ -1,7 +1,7 @@
 
 if (OPENBLAS_LIBRARIES)
   set(OPENBLAS_FIND_QUIETLY TRUE)
-endif (OPENBLAS_LIBRARIES)
+endif ()
 
 find_file(OPENBLAS_LIBRARIES NAMES libopenblas.so libopenblas.so.0 PATHS /usr/lib /usr/lib64 $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})
 find_library(OPENBLAS_LIBRARIES openblas PATHS $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})
diff --git a/bench/btl/cmake/FindTvmet.cmake b/bench/btl/cmake/FindTvmet.cmake
index 26a29d9..8ccae27 100644
--- a/bench/btl/cmake/FindTvmet.cmake
+++ b/bench/btl/cmake/FindTvmet.cmake
@@ -15,7 +15,7 @@
   # in cache already
   set(TVMET_FOUND TRUE)
 
-else (TVMET_INCLUDE_DIR)
+else ()
 
 find_path(TVMET_INCLUDE_DIR NAMES tvmet/tvmet.h
      PATHS
@@ -28,5 +28,5 @@
 
 mark_as_advanced(TVMET_INCLUDE_DIR)
 
-endif(TVMET_INCLUDE_DIR)
+endif()
 
diff --git a/bench/btl/libs/BLAS/CMakeLists.txt b/bench/btl/libs/BLAS/CMakeLists.txt
index 0272cca..f2738f1 100644
--- a/bench/btl/libs/BLAS/CMakeLists.txt
+++ b/bench/btl/libs/BLAS/CMakeLists.txt
@@ -5,8 +5,8 @@
   if(BUILD_btl_atlas)
     target_link_libraries(btl_atlas ${ATLAS_LIBRARIES})
     set_target_properties(btl_atlas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ATLAS -DHAS_LAPACK=1")
-  endif(BUILD_btl_atlas)
-endif (ATLAS_FOUND)
+  endif()
+endif ()
 
 find_package(MKL)
 if (MKL_FOUND)
@@ -14,8 +14,8 @@
   if(BUILD_btl_mkl)
     target_link_libraries(btl_mkl ${MKL_LIBRARIES})
     set_target_properties(btl_mkl PROPERTIES COMPILE_FLAGS "-DCBLASNAME=INTEL_MKL -DHAS_LAPACK=1")
-  endif(BUILD_btl_mkl)
-endif (MKL_FOUND)
+  endif()
+endif ()
 
 
 find_package(OPENBLAS)
@@ -24,8 +24,8 @@
   if(BUILD_btl_openblas)
     target_link_libraries(btl_openblas ${OPENBLAS_LIBRARIES} )
     set_target_properties(btl_openblas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=OPENBLAS")
-  endif(BUILD_btl_openblas)
-endif (OPENBLAS_FOUND)
+  endif()
+endif ()
 
 find_package(ACML)
 if (ACML_FOUND)
@@ -33,8 +33,8 @@
   if(BUILD_btl_acml)
     target_link_libraries(btl_acml ${ACML_LIBRARIES} )
     set_target_properties(btl_acml PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ACML -DHAS_LAPACK=1")
-  endif(BUILD_btl_acml)
-endif (ACML_FOUND)
+  endif()
+endif ()
 
 if(Eigen_SOURCE_DIR AND CMAKE_Fortran_COMPILER_WORKS)
   # we are inside Eigen and blas/lapack interface is compilable
diff --git a/bench/btl/libs/blitz/CMakeLists.txt b/bench/btl/libs/blitz/CMakeLists.txt
index 880ab73..e203c81 100644
--- a/bench/btl/libs/blitz/CMakeLists.txt
+++ b/bench/btl/libs/blitz/CMakeLists.txt
@@ -7,11 +7,11 @@
   btl_add_bench(btl_blitz btl_blitz.cpp)
   if (BUILD_btl_blitz)
     target_link_libraries(btl_blitz ${BLITZ_LIBRARIES})
-  endif (BUILD_btl_blitz)
+  endif ()
 
   btl_add_bench(btl_tiny_blitz btl_tiny_blitz.cpp OFF)
   if (BUILD_btl_tiny_blitz)
     target_link_libraries(btl_tiny_blitz ${BLITZ_LIBRARIES})
-  endif (BUILD_btl_tiny_blitz)
+  endif ()
 
-endif (BLITZ_FOUND)
+endif ()
diff --git a/bench/btl/libs/eigen3/CMakeLists.txt b/bench/btl/libs/eigen3/CMakeLists.txt
index 00cae23..06a72b4 100644
--- a/bench/btl/libs/eigen3/CMakeLists.txt
+++ b/bench/btl/libs/eigen3/CMakeLists.txt
@@ -47,9 +47,9 @@
 
 #     if(BUILD_btl_eigen3_adv)
 #       target_link_libraries(btl_eigen3_adv ${MKL_LIBRARIES})
-#     endif(BUILD_btl_eigen3_adv)
+#     endif()
 
-  endif(NOT BTL_NOVEC)
+  endif()
 
   btl_add_bench(btl_tiny_eigen3 btl_tiny_eigen3.cpp OFF)
 
@@ -59,7 +59,7 @@
 
     if(BUILD_btl_tiny_eigen3_novec)
       btl_add_target_property(btl_tiny_eigen3_novec    COMPILE_FLAGS "-DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_tiny_novec")
-    endif(BUILD_btl_tiny_eigen3_novec)
-  endif(NOT BTL_NOVEC)
+    endif()
+  endif()
 
-endif (EIGEN3_FOUND)
+endif ()
diff --git a/bench/btl/libs/gmm/CMakeLists.txt b/bench/btl/libs/gmm/CMakeLists.txt
index bc25862..0bcb046 100644
--- a/bench/btl/libs/gmm/CMakeLists.txt
+++ b/bench/btl/libs/gmm/CMakeLists.txt
@@ -3,4 +3,4 @@
 if (GMM_FOUND)
   include_directories(${GMM_INCLUDES})
   btl_add_bench(btl_gmm main.cpp)
-endif (GMM_FOUND)
+endif ()
diff --git a/bench/btl/libs/mtl4/CMakeLists.txt b/bench/btl/libs/mtl4/CMakeLists.txt
index 14b47a8..132a501 100644
--- a/bench/btl/libs/mtl4/CMakeLists.txt
+++ b/bench/btl/libs/mtl4/CMakeLists.txt
@@ -3,4 +3,4 @@
 if (MTL4_FOUND)
   include_directories(${MTL4_INCLUDE_DIR})
   btl_add_bench(btl_mtl4 main.cpp)
-endif (MTL4_FOUND)
+endif ()
diff --git a/bench/btl/libs/tensors/CMakeLists.txt b/bench/btl/libs/tensors/CMakeLists.txt
index 09d6d8e..e10a736 100644
--- a/bench/btl/libs/tensors/CMakeLists.txt
+++ b/bench/btl/libs/tensors/CMakeLists.txt
@@ -39,6 +39,6 @@
     btl_add_target_property(btl_tensor_novec_vecmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec")
     btl_add_target_property(btl_tensor_novec_matmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec")
 
-  endif(NOT BTL_NOVEC)
+  endif()
 
-endif (TENSOR_FOUND)
+endif ()
diff --git a/bench/btl/libs/tvmet/CMakeLists.txt b/bench/btl/libs/tvmet/CMakeLists.txt
index 25b565b..e737697 100644
--- a/bench/btl/libs/tvmet/CMakeLists.txt
+++ b/bench/btl/libs/tvmet/CMakeLists.txt
@@ -3,4 +3,4 @@
 if (TVMET_FOUND)
   include_directories(${TVMET_INCLUDE_DIR})
   btl_add_bench(btl_tvmet main.cpp OFF)
-endif (TVMET_FOUND)
+endif ()
diff --git a/bench/btl/libs/ublas/CMakeLists.txt b/bench/btl/libs/ublas/CMakeLists.txt
index bdb58be..5accf5b 100644
--- a/bench/btl/libs/ublas/CMakeLists.txt
+++ b/bench/btl/libs/ublas/CMakeLists.txt
@@ -4,4 +4,4 @@
   include_directories(${Boost_INCLUDE_DIRS})
   include_directories(${Boost_INCLUDES})
   btl_add_bench(btl_ublas main.cpp)
-endif (Boost_FOUND)
+endif ()
diff --git a/bench/spbench/CMakeLists.txt b/bench/spbench/CMakeLists.txt
index 029ba6d..1fc5778 100644
--- a/bench/spbench/CMakeLists.txt
+++ b/bench/spbench/CMakeLists.txt
@@ -11,7 +11,7 @@
 # if(PARDISO_LIBRARIES)
 #   add_definitions("-DEIGEN_PARDISO_SUPPORT")
 #   set(SPARSE_LIBS ${SPARSE_LIBS} ${PARDISO_LIBRARIES})
-# endif(PARDISO_LIBRARIES)
+# endif()
 
 find_package(Cholmod)
 if(CHOLMOD_FOUND AND BLAS_FOUND AND LAPACK_FOUND)
@@ -57,7 +57,7 @@
   elseif(METIS_FOUND)
     include_directories(${METIS_INCLUDE_DIRS})
     set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES})  
-  endif(SCOTCH_FOUND)
+  endif()
   set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES})
   set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP})
 endif()
@@ -66,12 +66,12 @@
   include_directories(${METIS_INCLUDE_DIRS})
   set (SPARSE_LIBS ${SPARSE_LIBS} ${METIS_LIBRARIES})
   add_definitions("-DEIGEN_METIS_SUPPORT")
-endif(METIS_FOUND)
+endif()
 
 find_library(RT_LIBRARY rt)
 if(RT_LIBRARY)
   set(SPARSE_LIBS ${SPARSE_LIBS} ${RT_LIBRARY})
-endif(RT_LIBRARY)
+endif()
 
 add_executable(spbenchsolver spbenchsolver.cpp)
 target_link_libraries (spbenchsolver ${SPARSE_LIBS})
diff --git a/blas/testing/CMakeLists.txt b/blas/testing/CMakeLists.txt
index 3ab8026..52c23ac 100644
--- a/blas/testing/CMakeLists.txt
+++ b/blas/testing/CMakeLists.txt
@@ -17,7 +17,7 @@
   add_test(${testname} "${Eigen_SOURCE_DIR}/blas/testing/runblastest.sh" "${testname}" "${Eigen_SOURCE_DIR}/blas/testing/${testname}.dat")
   add_dependencies(buildtests ${targetname})
   
-endmacro(ei_add_blas_test)
+endmacro()
 
 ei_add_blas_test(sblat1)
 ei_add_blas_test(sblat2)
diff --git a/cmake/EigenConfigureTesting.cmake b/cmake/EigenConfigureTesting.cmake
index 1e72d92..9cb3bb2 100644
--- a/cmake/EigenConfigureTesting.cmake
+++ b/cmake/EigenConfigureTesting.cmake
@@ -49,10 +49,10 @@
     set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage")
     set(CTEST_CUSTOM_COVERAGE_EXCLUDE "/test/")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS}")
-  endif(EIGEN_COVERAGE_TESTING)
+  endif()
   
 elseif(MSVC)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
-endif(CMAKE_COMPILER_IS_GNUCXX)
+endif()
 
 
diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake
index 8cb2d54..b810a1b 100644
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -6,7 +6,7 @@
   else()
     set_property(GLOBAL PROPERTY ${prop} "${previous} ${value}")
   endif()
-endmacro(ei_add_property)
+endmacro()
 
 #internal. See documentation of ei_add_test for details.
 macro(ei_add_test_internal testname testname_with_suffix)
@@ -60,11 +60,11 @@
 
   if(EIGEN_NO_ASSERTION_CHECKING)
     ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
-  else(EIGEN_NO_ASSERTION_CHECKING)
+  else()
     if(EIGEN_DEBUG_ASSERTS)
       ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_DEBUG_ASSERTS=1")
-    endif(EIGEN_DEBUG_ASSERTS)
-  endif(EIGEN_NO_ASSERTION_CHECKING)
+    endif()
+  endif()
 
   ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE}")
 
@@ -75,7 +75,7 @@
   # let the user pass flags.
   if(${ARGC} GREATER 2)
     ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
-  endif(${ARGC} GREATER 2)
+  endif()
 
   if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
     ei_add_target_property(${targetname} COMPILE_FLAGS "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
@@ -114,7 +114,7 @@
     set_property(TEST ${testname_with_suffix} PROPERTY LABELS "${current_subproject}")
   endif()
 
-endmacro(ei_add_test_internal)
+endmacro()
 
 # SYCL
 macro(ei_add_test_internal_sycl testname testname_with_suffix)
@@ -160,11 +160,11 @@
 
   if(EIGEN_NO_ASSERTION_CHECKING)
     ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
-  else(EIGEN_NO_ASSERTION_CHECKING)
+  else()
     if(EIGEN_DEBUG_ASSERTS)
       ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_DEBUG_ASSERTS=1")
-    endif(EIGEN_DEBUG_ASSERTS)
-  endif(EIGEN_NO_ASSERTION_CHECKING)
+    endif()
+  endif()
 
   ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_MAX_SIZE=${EIGEN_TEST_MAX_SIZE}")
 
@@ -175,7 +175,7 @@
   # let the user pass flags.
   if(${ARGC} GREATER 2)
     ei_add_target_property(${targetname} COMPILE_FLAGS "${ARGV2}")
-  endif(${ARGC} GREATER 2)
+  endif()
 
   if(EIGEN_TEST_CUSTOM_CXX_FLAGS)
     ei_add_target_property(${targetname} COMPILE_FLAGS "${EIGEN_TEST_CUSTOM_CXX_FLAGS}")
@@ -215,7 +215,7 @@
   endif()
 
 
-endmacro(ei_add_test_internal_sycl)
+endmacro()
 
 
 # Macro to add a test
@@ -290,11 +290,11 @@
       ei_add_test_internal(${testname} ${testname}_${suffix}
         "${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
       add_dependencies(${testname} ${testname}_${suffix})
-    endforeach(suffix)
+    endforeach()
   else()
     ei_add_test_internal(${testname} ${testname} "${ARGV1} -DEIGEN_TEST_PART_ALL=1" "${ARGV2}")
   endif()
-endmacro(ei_add_test)
+endmacro()
 
 macro(ei_add_test_sycl testname)
   get_property(EIGEN_TESTS_LIST GLOBAL PROPERTY EIGEN_TESTS_LIST)
@@ -319,16 +319,16 @@
       ei_add_test_internal_sycl(${testname} ${testname}_${suffix}
         "${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}")
       add_dependencies(${testname} ${testname}_${suffix})
-    endforeach(suffix)
-  else(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
+    endforeach()
+  else()
     set(symbols_to_enable_all_parts "")
     foreach(suffix ${suffixes})
       set(symbols_to_enable_all_parts
         "${symbols_to_enable_all_parts} -DEIGEN_TEST_PART_${suffix}=1")
-    endforeach(suffix)
+    endforeach()
     ei_add_test_internal_sycl(${testname} ${testname} "${ARGV1} ${symbols_to_enable_all_parts}" "${ARGV2}")
-  endif(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
-endmacro(ei_add_test_sycl)
+  endif()
+endmacro()
 
 # adds a failtest, i.e. a test that succeed if the program fails to compile
 # note that the test runner for these is CMake itself, when passed -DEIGEN_FAILTEST=ON
@@ -360,7 +360,7 @@
 
   # Expect the second test to fail
   set_tests_properties(${test_target_ko} PROPERTIES WILL_FAIL TRUE)
-endmacro(ei_add_failtest)
+endmacro()
 
 # print a summary of the different options
 macro(ei_testing_print_summary)
@@ -510,7 +510,7 @@
   message(STATUS "\n${EIGEN_TESTING_SUMMARY}")
 
   message(STATUS "************************************************************")
-endmacro(ei_testing_print_summary)
+endmacro()
 
 macro(ei_init_testing)
   define_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT BRIEF_DOCS " " FULL_DOCS " ")
@@ -532,7 +532,7 @@
 
   # uncomment anytime you change the ei_get_compilerver_from_cxx_version_string macro
   # ei_test_get_compilerver_from_cxx_version_string()
-endmacro(ei_init_testing)
+endmacro()
 
 macro(ei_set_sitename)
   # if the sitename is not yet set, try to set it
@@ -549,7 +549,7 @@
   if(SITE)
     string(TOLOWER ${SITE} SITE)
   endif()
-endmacro(ei_set_sitename)
+endmacro()
 
 macro(ei_get_compilerver VAR)
     if(MSVC)
@@ -582,7 +582,7 @@
     set(${VAR} "${CNAME}-${CVER}")
 
   endif()
-endmacro(ei_get_compilerver)
+endmacro()
 
 # Extract compiler name and version from a raw version string
 # WARNING: if you edit thid macro, then please test it by  uncommenting
@@ -631,7 +631,7 @@
 
   string(REGEX REPLACE ".(.*)" "\\1" ${CVER} ${eicver})
 
-endmacro(ei_get_compilerver_from_cxx_version_string)
+endmacro()
 
 macro(ei_get_cxxflags VAR)
   set(${VAR} "")
@@ -679,7 +679,7 @@
       set(${VAR} ${${VAR}}-ROWMAJ)
     endif()
   endif()
-endmacro(ei_get_cxxflags)
+endmacro()
 
 macro(ei_set_build_string)
   ei_get_compilerver(LOCAL_COMPILER_VERSION)
@@ -714,7 +714,7 @@
   endif()
 
   string(TOLOWER ${TMP_BUILD_STRING} BUILDNAME)
-endmacro(ei_set_build_string)
+endmacro()
 
 macro(ei_is_64bit_env VAR)
   if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -724,7 +724,7 @@
   else()
     message(WARNING "Unsupported pointer size. Please contact the authors.")
   endif()
-endmacro(ei_is_64bit_env)
+endmacro()
 
 
 # helper macro for testing ei_get_compilerver_from_cxx_version_string
@@ -737,7 +737,7 @@
     message("STATUS ei_get_compilerver_from_cxx_version_string error:")
     message("Expected \"${REFNAME}-${REFVER}\", got \"${CNAME}-${CVER}\"")
   endif()
-endmacro(ei_test1_get_compilerver_from_cxx_version_string)
+endmacro()
 
 # macro for testing ei_get_compilerver_from_cxx_version_string
 # feel free to add more version strings
@@ -752,4 +752,4 @@
   ei_test1_get_compilerver_from_cxx_version_string("i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)" "llvm-g++" "4.2.1")
   ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 4.4.6" "g++" "4.4.6")
   ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 2011" "g++" "4.4")
-endmacro(ei_test_get_compilerver_from_cxx_version_string)
+endmacro()
diff --git a/cmake/EigenUninstall.cmake b/cmake/EigenUninstall.cmake
index 4dae8c8..5e63c98 100644
--- a/cmake/EigenUninstall.cmake
+++ b/cmake/EigenUninstall.cmake
@@ -27,7 +27,7 @@
     else()
       message(STATUS "File '${file}' does not exist.")
     endif()
-  endforeach(file)
+  endforeach()
 
   message(STATUS "========== Finished Uninstalling Eigen  ==============")
 else()
diff --git a/cmake/FindAdolc.cmake b/cmake/FindAdolc.cmake
index 937e549..374af76 100644
--- a/cmake/FindAdolc.cmake
+++ b/cmake/FindAdolc.cmake
@@ -1,7 +1,7 @@
 
 if (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
   set(ADOLC_FIND_QUIETLY TRUE)
-endif (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
+endif ()
 
 find_path(ADOLC_INCLUDES
   NAMES
diff --git a/cmake/FindBLAS.cmake b/cmake/FindBLAS.cmake
index e3395bc..7d1f81b 100644
--- a/cmake/FindBLAS.cmake
+++ b/cmake/FindBLAS.cmake
@@ -270,8 +270,8 @@
       endif ()
       set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
       set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
-    endif(_libraries_work)
-  endforeach(_library ${_list})
+    endif()
+  endforeach()
 
   if(_libraries_work)
     # Test this combination of libraries.
@@ -310,11 +310,11 @@
 
   if(_libraries_work)
     set(${LIBRARIES} ${${LIBRARIES}} ${_thread})
-  else(_libraries_work)
+  else()
     set(${LIBRARIES} FALSE)
-  endif(_libraries_work)
+  endif()
 
-endmacro(Check_Fortran_Libraries)
+endmacro()
 
 
 set(BLAS_LINKER_FLAGS)
@@ -438,7 +438,7 @@
       if (OMP_gomp_LIBRARY)
 	set(OMP_LIB "${OMP_gomp_LIBRARY}")
       endif()
-    else(CMAKE_C_COMPILER_ID STREQUAL "Intel")
+    else()
       if (OMP_iomp5_LIBRARY)
 	set(OMP_LIB "${OMP_iomp5_LIBRARY}")
       endif()
@@ -560,7 +560,7 @@
 		"${MAIN} ${THREAD} mkl_core${BLAS_mkl_DLL_SUFFIX}")
 	    endforeach()
 	  endforeach()
-	else (WIN32)
+	else ()
 	  if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
 	    list(APPEND BLAS_SEARCH_LIBS
 	      "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
@@ -586,9 +586,9 @@
 	      set(OMP_LIB "")
 	    endif()
 	  endif ()
-	endif (WIN32)
+	endif ()
 
-      else (BLA_F95)
+      else ()
 
 	set(BLAS_mkl_SEARCH_SYMBOL sgemm)
 	set(_LIBRARIES BLAS_LIBRARIES)
@@ -632,7 +632,7 @@
 		"${MAIN} ${THREAD} mkl_core${BLAS_mkl_DLL_SUFFIX}")
 	    endforeach()
 	  endforeach()
-	else (WIN32)
+	else ()
 	  if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
 	    list(APPEND BLAS_SEARCH_LIBS
 	      "mkl_intel mkl_intel_thread mkl_core guide")
@@ -667,9 +667,9 @@
 	    list(APPEND BLAS_SEARCH_LIBS
 	      "mkl_em64t")
 	  endif ()
-	endif (WIN32)
+	endif ()
 
-      endif (BLA_F95)
+      endif ()
 
       foreach (IT ${BLAS_SEARCH_LIBS})
 	string(REPLACE " " ";" SEARCH_LIBS ${IT})
@@ -698,9 +698,9 @@
       if (${_LIBRARIES} AND NOT BLAS_VENDOR_FOUND)
           set (BLAS_VENDOR_FOUND "Intel MKL")
       endif()
-    endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
-  endif(NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES "Intel*")
-endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
+    endif ()
+  endif()
+endif ()
 
 
 if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
@@ -727,7 +727,7 @@
       set (BLAS_VENDOR_FOUND "Goto")
   endif()
 
-endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # OpenBlas
@@ -755,7 +755,7 @@
       set (BLAS_VENDOR_FOUND "Openblas")
   endif()
 
-endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # EigenBlas
@@ -802,7 +802,7 @@
       set (BLAS_VENDOR_FOUND "Eigen")
   endif()
 
-endif (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
@@ -830,7 +830,7 @@
       set (BLAS_VENDOR_FOUND "Atlas")
   endif()
 
-endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
@@ -858,7 +858,7 @@
       set (BLAS_VENDOR_FOUND "PhiPACK")
   endif()
 
-endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # BLAS in Alpha CXML library?
@@ -886,7 +886,7 @@
       set (BLAS_VENDOR_FOUND "CXML")
   endif()
 
-endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # BLAS in Alpha DXML library? (now called CXML, see above)
@@ -914,7 +914,7 @@
       set (BLAS_VENDOR_FOUND "DXML")
   endif()
   
-endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # BLAS in Sun Performance library?
@@ -1124,7 +1124,7 @@
 	  "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
       endif()
 
-    endif(_ACML_ROOT)
+    endif()
 
   elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
 
@@ -1229,7 +1229,7 @@
       set (BLAS_VENDOR_FOUND "ACML")
   endif()
 
-endif (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") # ACML
+endif () # ACML
 
 
 # Apple BLAS library?
@@ -1257,7 +1257,7 @@
       set (BLAS_VENDOR_FOUND "Apple Accelerate")
   endif()
 
-endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
@@ -1284,7 +1284,7 @@
       set (BLAS_VENDOR_FOUND "NAS")
   endif()
 
-endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 # Generic BLAS library?
@@ -1316,7 +1316,7 @@
       set (BLAS_VENDOR_FOUND "Netlib or other Generic libblas")
   endif()
 
-endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
+endif ()
 
 
 if(BLA_F95)
@@ -1331,7 +1331,7 @@
     if(BLAS95_FOUND)
       message(STATUS "A library with BLAS95 API found.")
       message(STATUS "BLAS_LIBRARIES ${BLAS_LIBRARIES}")
-    else(BLAS95_FOUND)
+    else()
       message(WARNING "BLA_VENDOR has been set to ${BLA_VENDOR} but blas 95 libraries could not be found or check of symbols failed."
 	"\nPlease indicate where to find blas libraries. You have three options:\n"
 	"- Option 1: Provide the installation directory of BLAS library with cmake option: -DBLAS_DIR=your/path/to/blas\n"
@@ -1349,13 +1349,13 @@
 	message(STATUS
 	  "A library with BLAS95 API not found. Please specify library location.")
       endif()
-    endif(BLAS95_FOUND)
-  endif(NOT BLAS_FIND_QUIETLY)
+    endif()
+  endif()
 
   set(BLAS_FOUND TRUE)
   set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
 
-else(BLA_F95)
+else()
 
   if(BLAS_LIBRARIES)
     set(BLAS_FOUND TRUE)
@@ -1367,7 +1367,7 @@
     if(BLAS_FOUND)
       message(STATUS "A library with BLAS API found.")
       message(STATUS "BLAS_LIBRARIES ${BLAS_LIBRARIES}")
-    else(BLAS_FOUND)
+    else()
       message(WARNING "BLA_VENDOR has been set to ${BLA_VENDOR} but blas libraries could not be found or check of symbols failed."
 	"\nPlease indicate where to find blas libraries. You have three options:\n"
 	"- Option 1: Provide the installation directory of BLAS library with cmake option: -DBLAS_DIR=your/path/to/blas\n"
@@ -1385,10 +1385,10 @@
 	message(STATUS
 	  "A library with BLAS API not found. Please specify library location.")
       endif()
-    endif(BLAS_FOUND)
-  endif(NOT BLAS_FIND_QUIETLY)
+    endif()
+  endif()
 
-endif(BLA_F95)
+endif()
 
 set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
 
diff --git a/cmake/FindCholmod.cmake b/cmake/FindCholmod.cmake
index 23239c3..cea43ec 100644
--- a/cmake/FindCholmod.cmake
+++ b/cmake/FindCholmod.cmake
@@ -3,7 +3,7 @@
 
 if (CHOLMOD_INCLUDES AND CHOLMOD_LIBRARIES)
   set(CHOLMOD_FIND_QUIETLY TRUE)
-endif (CHOLMOD_INCLUDES AND CHOLMOD_LIBRARIES)
+endif ()
 
 find_path(CHOLMOD_INCLUDES
   NAMES
@@ -29,7 +29,7 @@
     set(CHOLMOD_LIBRARIES FALSE)
   endif ()
 
-endif(CHOLMOD_LIBRARIES)
+endif()
 
 if(CHOLMOD_LIBRARIES)
 
@@ -40,7 +40,7 @@
     set(CHOLMOD_LIBRARIES FALSE)
   endif ()
 
-endif(CHOLMOD_LIBRARIES)
+endif()
 
 if(CHOLMOD_LIBRARIES)
 
@@ -51,7 +51,7 @@
     set(CHOLMOD_LIBRARIES FALSE)
   endif ()
 
-endif(CHOLMOD_LIBRARIES)
+endif()
 
 if(CHOLMOD_LIBRARIES)
 
@@ -62,7 +62,7 @@
     set(CHOLMOD_LIBRARIES FALSE)
   endif ()
 
-endif(CHOLMOD_LIBRARIES)
+endif()
 
 if(CHOLMOD_LIBRARIES)
 
@@ -71,16 +71,16 @@
     set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CHOLMOD_METIS_LIBRARY})
   endif ()
 
-endif(CHOLMOD_LIBRARIES)
+endif()
 
 if(CHOLMOD_LIBRARIES)
 
   find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
   if (SUITESPARSE_LIBRARY)
     set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${SUITESPARSE_LIBRARY})
-  endif (SUITESPARSE_LIBRARY)
+  endif ()
   
-endif(CHOLMOD_LIBRARIES)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(CHOLMOD DEFAULT_MSG
diff --git a/cmake/FindComputeCpp.cmake b/cmake/FindComputeCpp.cmake
index 29f2a50..103e8a1 100644
--- a/cmake/FindComputeCpp.cmake
+++ b/cmake/FindComputeCpp.cmake
@@ -263,4 +263,4 @@
   target_link_libraries(${targetName} PUBLIC ${COMPUTECPP_RUNTIME_LIBRARY}
                         PUBLIC ${OpenCL_LIBRARIES})
 
-endfunction(add_sycl_to_target)
+endfunction()
diff --git a/cmake/FindEigen2.cmake b/cmake/FindEigen2.cmake
index a834b88..eb2709d 100644
--- a/cmake/FindEigen2.cmake
+++ b/cmake/FindEigen2.cmake
@@ -17,16 +17,16 @@
 if(NOT Eigen2_FIND_VERSION)
   if(NOT Eigen2_FIND_VERSION_MAJOR)
     set(Eigen2_FIND_VERSION_MAJOR 2)
-  endif(NOT Eigen2_FIND_VERSION_MAJOR)
+  endif()
   if(NOT Eigen2_FIND_VERSION_MINOR)
     set(Eigen2_FIND_VERSION_MINOR 0)
-  endif(NOT Eigen2_FIND_VERSION_MINOR)
+  endif()
   if(NOT Eigen2_FIND_VERSION_PATCH)
     set(Eigen2_FIND_VERSION_PATCH 0)
-  endif(NOT Eigen2_FIND_VERSION_PATCH)
+  endif()
 
   set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
-endif(NOT Eigen2_FIND_VERSION)
+endif()
 
 macro(_eigen2_check_version)
   file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header)
@@ -49,8 +49,8 @@
 
     message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in ${EIGEN2_INCLUDE_DIR}, "
                    "but at least version ${Eigen2_FIND_VERSION} is required")
-  endif(NOT EIGEN2_VERSION_OK)
-endmacro(_eigen2_check_version)
+  endif()
+endmacro()
 
 if (EIGEN2_INCLUDE_DIR)
 
@@ -58,7 +58,7 @@
   _eigen2_check_version()
   set(EIGEN2_FOUND ${EIGEN2_VERSION_OK})
 
-else (EIGEN2_INCLUDE_DIR)
+else ()
 
 find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
      PATHS
@@ -69,12 +69,12 @@
 
 if(EIGEN2_INCLUDE_DIR)
   _eigen2_check_version()
-endif(EIGEN2_INCLUDE_DIR)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR EIGEN2_VERSION_OK)
 
 mark_as_advanced(EIGEN2_INCLUDE_DIR)
 
-endif(EIGEN2_INCLUDE_DIR)
+endif()
 
diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake
index 4d9bc1a..0b36805 100644
--- a/cmake/FindEigen3.cmake
+++ b/cmake/FindEigen3.cmake
@@ -28,16 +28,16 @@
 if(NOT Eigen3_FIND_VERSION)
   if(NOT Eigen3_FIND_VERSION_MAJOR)
     set(Eigen3_FIND_VERSION_MAJOR 2)
-  endif(NOT Eigen3_FIND_VERSION_MAJOR)
+  endif()
   if(NOT Eigen3_FIND_VERSION_MINOR)
     set(Eigen3_FIND_VERSION_MINOR 91)
-  endif(NOT Eigen3_FIND_VERSION_MINOR)
+  endif()
   if(NOT Eigen3_FIND_VERSION_PATCH)
     set(Eigen3_FIND_VERSION_PATCH 0)
-  endif(NOT Eigen3_FIND_VERSION_PATCH)
+  endif()
 
   set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
-endif(NOT Eigen3_FIND_VERSION)
+endif()
 
 macro(_eigen3_check_version)
   file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
@@ -52,16 +52,16 @@
   set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
   if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
     set(EIGEN3_VERSION_OK FALSE)
-  else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+  else()
     set(EIGEN3_VERSION_OK TRUE)
-  endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+  endif()
 
   if(NOT EIGEN3_VERSION_OK)
 
     message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
                    "but at least version ${Eigen3_FIND_VERSION} is required")
-  endif(NOT EIGEN3_VERSION_OK)
-endmacro(_eigen3_check_version)
+  endif()
+endmacro()
 
 if (EIGEN3_INCLUDE_DIR)
 
@@ -70,7 +70,7 @@
   set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
   set(Eigen3_FOUND ${EIGEN3_VERSION_OK})
 
-else (EIGEN3_INCLUDE_DIR)
+else ()
   
   # search first if an Eigen3Config.cmake is available in the system,
   # if successful this would set EIGEN3_INCLUDE_DIR and the rest of
@@ -87,18 +87,18 @@
         ${KDE4_INCLUDE_DIR}
         PATH_SUFFIXES eigen3 eigen
       )
-  endif(NOT EIGEN3_INCLUDE_DIR)
+  endif()
 
   if(EIGEN3_INCLUDE_DIR)
     _eigen3_check_version()
-  endif(EIGEN3_INCLUDE_DIR)
+  endif()
 
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
 
   mark_as_advanced(EIGEN3_INCLUDE_DIR)
 
-endif(EIGEN3_INCLUDE_DIR)
+endif()
 
 if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
   add_library(Eigen3::Eigen INTERFACE IMPORTED)
diff --git a/cmake/FindFFTW.cmake b/cmake/FindFFTW.cmake
index 6c4dc9a..fad476d 100644
--- a/cmake/FindFFTW.cmake
+++ b/cmake/FindFFTW.cmake
@@ -101,7 +101,7 @@
     PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
   )
 
-endif( FFTW_ROOT )
+endif()
 
 set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
 
diff --git a/cmake/FindGMP.cmake b/cmake/FindGMP.cmake
index 1f02739..c41eedc 100644
--- a/cmake/FindGMP.cmake
+++ b/cmake/FindGMP.cmake
@@ -3,7 +3,7 @@
 
 if (GMP_INCLUDES AND GMP_LIBRARIES)
   set(GMP_FIND_QUIETLY TRUE)
-endif (GMP_INCLUDES AND GMP_LIBRARIES)
+endif ()
 
 find_path(GMP_INCLUDES
   NAMES
diff --git a/cmake/FindGSL.cmake b/cmake/FindGSL.cmake
index bf411a7..10dc953 100644
--- a/cmake/FindGSL.cmake
+++ b/cmake/FindGSL.cmake
@@ -54,7 +54,7 @@
 		PATHS  ${GSL_POSSIBLE_ROOT_DIRS}
 		PATH_SUFFIXES lib
 		DOC "GSL library")
-  endif(NOT GSL_GSL_LIBRARY)
+  endif()
   
   FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY
     NAMES libgslcblas.dll.a gslcblas libgslcblas
@@ -68,7 +68,7 @@
 		PATHS  ${GSL_POSSIBLE_ROOT_DIRS}
 		PATH_SUFFIXES lib
 		DOC "GSL library")
-  endif(NOT GSL_GSLCBLAS_LIBRARY)
+  endif()
   
   SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY})
 
diff --git a/cmake/FindGoogleHash.cmake b/cmake/FindGoogleHash.cmake
index f6a81a0..f46ea9c 100644
--- a/cmake/FindGoogleHash.cmake
+++ b/cmake/FindGoogleHash.cmake
@@ -1,7 +1,7 @@
 
 if (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
   set(GOOGLEHASH_FIND_QUIETLY TRUE)
-endif (GOOGLEHASH_INCLUDES AND GOOGLEHASH_LIBRARIES)
+endif ()
 
 find_path(GOOGLEHASH_INCLUDES
   NAMES
@@ -15,7 +15,7 @@
   file(WRITE ${CMAKE_BINARY_DIR}/googlehash_test.cpp
   "#include <google/sparse_hash_map>\n#include <google/dense_hash_map>\nint main(int argc, char** argv) { google::dense_hash_map<int,float> a; google::sparse_hash_map<int,float> b; return 0;}\n")
   try_compile(GOOGLEHASH_COMPILE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/googlehash_test.cpp OUTPUT_VARIABLE GOOGLEHASH_COMPILE_RESULT)
-endif(GOOGLEHASH_INCLUDES)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(GOOGLEHASH DEFAULT_MSG GOOGLEHASH_INCLUDES GOOGLEHASH_COMPILE)
diff --git a/cmake/FindHWLOC.cmake b/cmake/FindHWLOC.cmake
index a831b5c..4832915 100644
--- a/cmake/FindHWLOC.cmake
+++ b/cmake/FindHWLOC.cmake
@@ -85,7 +85,7 @@
     endif()
   endif()
 
-endif( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER )
+endif()
 
 if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR (HWLOC_GIVEN_BY_USER) )
 
@@ -282,9 +282,9 @@
     set(CMAKE_REQUIRED_INCLUDES)
     set(CMAKE_REQUIRED_FLAGS)
     set(CMAKE_REQUIRED_LIBRARIES)
-  endif(HWLOC_LIBRARIES)
+  endif()
 
-endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR (HWLOC_GIVEN_BY_USER) )
+endif()
 
 if (HWLOC_LIBRARIES)
   if (HWLOC_LIBRARY_DIRS)
diff --git a/cmake/FindKLU.cmake b/cmake/FindKLU.cmake
index 4a8f8e0..6217d14 100644
--- a/cmake/FindKLU.cmake
+++ b/cmake/FindKLU.cmake
@@ -3,7 +3,7 @@
 
 if (KLU_INCLUDES AND KLU_LIBRARIES)
   set(KLU_FIND_QUIETLY TRUE)
-endif (KLU_INCLUDES AND KLU_LIBRARIES)
+endif ()
 
 find_path(KLU_INCLUDES
   NAMES
@@ -22,7 +22,7 @@
 
   if(NOT KLU_LIBDIR)
     get_filename_component(KLU_LIBDIR ${KLU_LIBRARIES} PATH)
-  endif(NOT KLU_LIBDIR)
+  endif()
 
   find_library(COLAMD_LIBRARY colamd PATHS ${KLU_LIBDIR} $ENV{KLUDIR} ${LIB_INSTALL_DIR})
   if(COLAMD_LIBRARY)
@@ -39,7 +39,7 @@
     set(KLU_LIBRARIES ${KLU_LIBRARIES} ${BTF_LIBRARY})
   endif()
 
-endif(KLU_LIBRARIES)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(KLU DEFAULT_MSG
diff --git a/cmake/FindLAPACK.cmake b/cmake/FindLAPACK.cmake
index 2fcae21..284a452 100644
--- a/cmake/FindLAPACK.cmake
+++ b/cmake/FindLAPACK.cmake
@@ -75,8 +75,8 @@
       mark_as_advanced(${_prefix}_${_library}_LIBRARY)
       set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
       set(_libraries_found ${${_prefix}_${_library}_LIBRARY})
-    endif(_libraries_found)
-  endforeach(_library ${_list})
+    endif()
+  endforeach()
   if(_libraries_found)
     set(_libraries_found ${${LIBRARIES}})
   endif()
@@ -103,7 +103,7 @@
     set(CMAKE_REQUIRED_LIBRARIES    "")
     mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
     set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS})
-  endif(_libraries_found AND NOT _libraries_work)
+  endif()
 
   # If not found, test this combination of libraries with a C interface.
   # A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard.
@@ -117,7 +117,7 @@
     set(CMAKE_REQUIRED_LIBRARIES "")
     mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS)
     set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS})
-  endif(_libraries_found AND NOT _libraries_work)
+  endif()
 
   # on failure
   if(NOT _libraries_work)
@@ -126,7 +126,7 @@
   endif()
   #message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}")
   #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
-endmacro(check_lapack_libraries)
+endmacro()
 
 
 #
@@ -216,7 +216,7 @@
       "${BLAS_LIBRARIES}"
       "${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
       )
-    endif ( NOT LAPACK_LIBRARIES )
+    endif ()
 
     # Generic LAPACK library?
     # This configuration *must* be the last try as this library is notably slow.
@@ -242,14 +242,14 @@
   if(NOT LAPACK_FIND_QUIETLY)
     if(LAPACK_FOUND)
       message(STATUS "A library with LAPACK API found.")
-    else(LAPACK_FOUND)
+    else()
       if(LAPACK_FIND_REQUIRED)
         message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location.")
       else()
         message(STATUS "A library with LAPACK API not found. Please specify library location.")
       endif()
-    endif(LAPACK_FOUND)
-  endif(NOT LAPACK_FIND_QUIETLY)
+    endif()
+  endif()
 
   # Add variables to cache
   set( LAPACK_INCLUDE_DIR   "${LAPACK_INCLUDE_DIR}"
@@ -270,4 +270,4 @@
   #message("DEBUG: LAPACK_LIBRARIES_DIR = ${LAPACK_LIBRARIES_DIR}")
   #message("DEBUG: LAPACK_FOUND = ${LAPACK_FOUND}")
 
-endif(NOT BLAS_FOUND)
+endif()
diff --git a/cmake/FindMPFR.cmake b/cmake/FindMPFR.cmake
index aa4c2cd..d8da9d6 100644
--- a/cmake/FindMPFR.cmake
+++ b/cmake/FindMPFR.cmake
@@ -32,16 +32,16 @@
 if(NOT MPFR_FIND_VERSION)
   if(NOT MPFR_FIND_VERSION_MAJOR)
     set(MPFR_FIND_VERSION_MAJOR 1)
-  endif(NOT MPFR_FIND_VERSION_MAJOR)
+  endif()
   if(NOT MPFR_FIND_VERSION_MINOR)
     set(MPFR_FIND_VERSION_MINOR 0)
-  endif(NOT MPFR_FIND_VERSION_MINOR)
+  endif()
   if(NOT MPFR_FIND_VERSION_PATCH)
     set(MPFR_FIND_VERSION_PATCH 0)
-  endif(NOT MPFR_FIND_VERSION_PATCH)
+  endif()
 
   set(MPFR_FIND_VERSION "${MPFR_FIND_VERSION_MAJOR}.${MPFR_FIND_VERSION_MINOR}.${MPFR_FIND_VERSION_PATCH}")
-endif(NOT MPFR_FIND_VERSION)
+endif()
 
 
 if(MPFR_INCLUDES)
@@ -65,11 +65,11 @@
     set(MPFR_VERSION_OK FALSE)
     message(STATUS "MPFR version ${MPFR_VERSION} found in ${MPFR_INCLUDES}, "
                    "but at least version ${MPFR_FIND_VERSION} is required")
-  else(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
+  else()
     set(MPFR_VERSION_OK TRUE)
-  endif(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION})
+  endif()
 
-endif(MPFR_INCLUDES)
+endif()
 
 # Set MPFR_LIBRARIES
 
diff --git a/cmake/FindMetis.cmake b/cmake/FindMetis.cmake
index da2f1f1..5c9cbcb 100644
--- a/cmake/FindMetis.cmake
+++ b/cmake/FindMetis.cmake
@@ -238,7 +238,7 @@
   set(CMAKE_REQUIRED_INCLUDES)
   set(CMAKE_REQUIRED_FLAGS)
   set(CMAKE_REQUIRED_LIBRARIES)
-endif(METIS_LIBRARIES)
+endif()
 
 if (METIS_LIBRARIES)
   list(GET METIS_LIBRARIES 0 first_lib)
diff --git a/cmake/FindPTSCOTCH.cmake b/cmake/FindPTSCOTCH.cmake
index 1396d05..51eecf1 100644
--- a/cmake/FindPTSCOTCH.cmake
+++ b/cmake/FindPTSCOTCH.cmake
@@ -355,7 +355,7 @@
   set(CMAKE_REQUIRED_INCLUDES)
   set(CMAKE_REQUIRED_FLAGS)
   set(CMAKE_REQUIRED_LIBRARIES)
-endif(PTSCOTCH_LIBRARIES)
+endif()
 
 if (PTSCOTCH_LIBRARIES)
   list(GET PTSCOTCH_LIBRARIES 0 first_lib)
diff --git a/cmake/FindPastix.cmake b/cmake/FindPastix.cmake
index 470477f..3b47d5c 100644
--- a/cmake/FindPastix.cmake
+++ b/cmake/FindPastix.cmake
@@ -238,7 +238,7 @@
     mark_as_advanced(MPI_LIBRARY)
     mark_as_advanced(MPI_EXTRA_LIBRARY)
   endif()
-endif (NOT MPI_FOUND AND PASTIX_LOOK_FOR_MPI)
+endif ()
 
 # PASTIX may depend on STARPU
 #----------------------------
@@ -279,7 +279,7 @@
       COMPONENTS ${STARPU_COMPONENT_LIST})
   endif()
 
-endif( NOT STARPU_FOUND AND PASTIX_LOOK_FOR_STARPU)
+endif()
 
 # PASTIX may depends on SCOTCH
 #-----------------------------
@@ -478,7 +478,7 @@
   endif()
   mark_as_advanced(PASTIX_${pastix_lib}_LIBRARY)
 
-endforeach(pastix_lib ${PASTIX_libs_to_find})
+endforeach()
 
 # check a function to validate the find
 if(PASTIX_LIBRARIES)
@@ -681,7 +681,7 @@
   set(CMAKE_REQUIRED_INCLUDES)
   set(CMAKE_REQUIRED_FLAGS)
   set(CMAKE_REQUIRED_LIBRARIES)
-endif(PASTIX_LIBRARIES)
+endif()
 
 if (PASTIX_LIBRARIES)
   list(GET PASTIX_LIBRARIES 0 first_lib)
diff --git a/cmake/FindSPQR.cmake b/cmake/FindSPQR.cmake
index 1e958c3..d6fb2e1 100644
--- a/cmake/FindSPQR.cmake
+++ b/cmake/FindSPQR.cmake
@@ -6,7 +6,7 @@
 
 if (SPQR_INCLUDES AND SPQR_LIBRARIES)
   set(SPQR_FIND_QUIETLY TRUE)
-endif (SPQR_INCLUDES AND SPQR_LIBRARIES)
+endif ()
 
 find_path(SPQR_INCLUDES
   NAMES
@@ -33,7 +33,7 @@
     set(SPQR_LIBRARIES ${SPQR_LIBRARIES} ${CHOLMOD_LIBRARY})
   endif()
   
-endif(SPQR_LIBRARIES)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(SPQR DEFAULT_MSG SPQR_INCLUDES SPQR_LIBRARIES)
diff --git a/cmake/FindScotch.cmake b/cmake/FindScotch.cmake
index 89d295a..af00eb0 100644
--- a/cmake/FindScotch.cmake
+++ b/cmake/FindScotch.cmake
@@ -301,7 +301,7 @@
   set(CMAKE_REQUIRED_INCLUDES)
   set(CMAKE_REQUIRED_FLAGS)
   set(CMAKE_REQUIRED_LIBRARIES)
-endif(SCOTCH_LIBRARIES)
+endif()
 
 if (SCOTCH_LIBRARIES)
   list(GET SCOTCH_LIBRARIES 0 first_lib)
diff --git a/cmake/FindSuperLU.cmake b/cmake/FindSuperLU.cmake
index f38146e..e86fe5c 100644
--- a/cmake/FindSuperLU.cmake
+++ b/cmake/FindSuperLU.cmake
@@ -4,7 +4,7 @@
 
 if (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
   set(SUPERLU_FIND_QUIETLY TRUE)
-endif (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
+endif ()
 
 find_path(SUPERLU_INCLUDES
   NAMES
diff --git a/cmake/FindTriSYCL.cmake b/cmake/FindTriSYCL.cmake
index cb21541..41bc2fa 100644
--- a/cmake/FindTriSYCL.cmake
+++ b/cmake/FindTriSYCL.cmake
@@ -72,7 +72,7 @@
   if(UNIX)
     set(BOOST_COMPUTE_INCPATH /usr/include/compute CACHE PATH
       "Path to Boost.Compute headers (default is: /usr/include/compute)")
-  endif(UNIX)
+  endif()
 endif()
 
 # Find OpenMP package
@@ -147,6 +147,6 @@
     set_target_properties(${targetName}
       PROPERTIES
       LINK_FLAGS ${OpenMP_CXX_FLAGS})
-  endif(${TRISYCL_OPENMP} AND (NOT WIN32))
+  endif()
 
-endfunction(add_sycl_to_target)
+endfunction()
diff --git a/cmake/FindUmfpack.cmake b/cmake/FindUmfpack.cmake
index 53cf0b4..91cf637 100644
--- a/cmake/FindUmfpack.cmake
+++ b/cmake/FindUmfpack.cmake
@@ -3,7 +3,7 @@
 
 if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
   set(UMFPACK_FIND_QUIETLY TRUE)
-endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
+endif ()
 
 find_path(UMFPACK_INCLUDES
   NAMES
@@ -22,7 +22,7 @@
 
   if(NOT UMFPACK_LIBDIR)
     get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
-  endif(NOT UMFPACK_LIBDIR)
+  endif()
 
   find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
   if(COLAMD_LIBRARY)
@@ -44,7 +44,7 @@
     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CHOLMOD_LIBRARY})
   endif()
 
-endif(UMFPACK_LIBRARIES)
+endif()
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(UMFPACK DEFAULT_MSG
diff --git a/cmake/RegexUtils.cmake b/cmake/RegexUtils.cmake
index b59dfc3..73bed97 100644
--- a/cmake/RegexUtils.cmake
+++ b/cmake/RegexUtils.cmake
@@ -15,5 +15,5 @@
   SET(testRef "\\\\\\.\\^\\$\\-\\+\\*\\(\\)\\[\\]\\?\\|")
   if(NOT test2 STREQUAL testRef)
 	message("Error in the escape_string_for_regex function : \n   ${test1} was escaped as ${test2}, should be ${testRef}")
-  endif(NOT test2 STREQUAL testRef)
+  endif()
 endfunction()
\ No newline at end of file
diff --git a/cmake/language_support.cmake b/cmake/language_support.cmake
index ddba509..8e1baf6 100644
--- a/cmake/language_support.cmake
+++ b/cmake/language_support.cmake
@@ -51,13 +51,13 @@
       )
     if(return_code EQUAL 0)
       set(${language_works} ON PARENT_SCOPE)
-    else(return_code EQUAL 0)
+    else()
       set(${language_works} OFF PARENT_SCOPE)
-    endif(return_code EQUAL 0)
-  else(return_code EQUAL 0)
+    endif()
+  else()
     set(${language_works} OFF PARENT_SCOPE)
-  endif(return_code EQUAL 0)
-endfunction(workaround_9220)
+  endif()
+endfunction()
 
 # Temporary tests of the above function.
 #workaround_9220(CXX CXX_language_works)
diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt
index b0d2edd..deb560f 100644
--- a/demos/CMakeLists.txt
+++ b/demos/CMakeLists.txt
@@ -7,7 +7,7 @@
   if(QT4_FOUND)
     add_subdirectory(mandelbrot)
     add_subdirectory(opengl)
-  else(QT4_FOUND)
+  else()
     message(STATUS "Qt4 not found, so disabling the mandelbrot and opengl demos")
-  endif(QT4_FOUND)
+  endif()
 endif()
diff --git a/demos/mandelbrot/CMakeLists.txt b/demos/mandelbrot/CMakeLists.txt
index 5c500e0..ae6001d 100644
--- a/demos/mandelbrot/CMakeLists.txt
+++ b/demos/mandelbrot/CMakeLists.txt
@@ -5,7 +5,7 @@
 if (CMAKE_COMPILER_IS_GNUCXX)
    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
    add_definitions ( "-DNDEBUG" )
-endif (CMAKE_COMPILER_IS_GNUCXX)
+endif ()
 
 include_directories( ${QT_INCLUDE_DIR} )
 
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index f344ae5..50ae9ea 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -7,8 +7,8 @@
 if(CMAKE_COMPILER_IS_GNUCXX)
   if(CMAKE_SYSTEM_NAME MATCHES Linux)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g1")
-  endif(CMAKE_SYSTEM_NAME MATCHES Linux)
-endif(CMAKE_COMPILER_IS_GNUCXX)
+  endif()
+endif()
 
 # some examples and snippets needs c++11, so let's check it once
 check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
@@ -24,9 +24,9 @@
 set(EIGEN_DOXY_TAGFILES                 "")
 if(EIGEN_INTERNAL_DOCUMENTATION)
   set(EIGEN_DOXY_INTERNAL                 "YES")
-else(EIGEN_INTERNAL_DOCUMENTATION)
+else()
   set(EIGEN_DOXY_INTERNAL                 "NO")
-endif(EIGEN_INTERNAL_DOCUMENTATION)
+endif()
 
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt
index 4fa0b10..a2c9d05 100644
--- a/doc/examples/CMakeLists.txt
+++ b/doc/examples/CMakeLists.txt
@@ -13,7 +13,7 @@
     ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
   )
   add_dependencies(all_examples ${example})
-endforeach(example_src)
+endforeach()
 
 if(EIGEN_COMPILER_SUPPORT_CPP11)
 ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11")
diff --git a/doc/snippets/CMakeLists.txt b/doc/snippets/CMakeLists.txt
index 88ed341..65f195a 100644
--- a/doc/snippets/CMakeLists.txt
+++ b/doc/snippets/CMakeLists.txt
@@ -33,4 +33,4 @@
   else()
     message("skip snippet ${snippet_src} because compiler does not support C++11")
   endif()
-endforeach(snippet_src)
+endforeach()
diff --git a/doc/special_examples/CMakeLists.txt b/doc/special_examples/CMakeLists.txt
index 66ba4de..5b00e8b 100644
--- a/doc/special_examples/CMakeLists.txt
+++ b/doc/special_examples/CMakeLists.txt
@@ -3,7 +3,7 @@
   if(QT4_FOUND)
     include(${QT_USE_FILE})
   endif()
-endif(NOT EIGEN_TEST_NOQT)
+endif()
 
 if(QT4_FOUND)
   add_executable(Tutorial_sparse_example Tutorial_sparse_example.cpp Tutorial_sparse_example_details.cpp)
@@ -17,7 +17,7 @@
   )
 
   add_dependencies(all_examples Tutorial_sparse_example)
-endif(QT4_FOUND)
+endif()
 
 if(EIGEN_COMPILER_SUPPORT_CPP11)
   add_executable(random_cpp11 random_cpp11.cpp)
diff --git a/lapack/CMakeLists.txt b/lapack/CMakeLists.txt
index af436a3..baa2154 100644
--- a/lapack/CMakeLists.txt
+++ b/lapack/CMakeLists.txt
@@ -86,9 +86,9 @@
   endif()
   
   
-endif(EIGEN_ENABLE_LAPACK_TESTS)
+endif()
 
-endif(EIGEN_Fortran_COMPILER_WORKS)
+endif()
 
 add_library(eigen_lapack_static ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
 add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
@@ -152,7 +152,7 @@
         -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)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c9e1b7b..de274f3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -28,7 +28,7 @@
   message(STATUS "BLAS_COMPILER_FLAGS: ${BLAS_COMPILER_FLAGS}")
   add_definitions("-DEIGEN_USE_BLAS") # is adding  ${BLAS_COMPILER_FLAGS} necessary?
   list(APPEND EXTERNAL_LIBS "${BLAS_LIBRARIES}")
-endif(EIGEN_TEST_EXTERNAL_BLAS)
+endif()
 
 # configure blas/lapack (use Eigen's ones)
 set(EIGEN_BLAS_LIBRARIES eigen_blas)
@@ -39,10 +39,10 @@
   if(NOT WIN32)
     message(STATUS "Test realworld sparse matrices: ${EIGEN_TEST_MATRIX_DIR}")
     add_definitions( -DTEST_REAL_CASES="${EIGEN_TEST_MATRIX_DIR}" )
-  else(NOT WIN32)
+  else()
     message(STATUS "REAL CASES CAN NOT BE CURRENTLY TESTED ON WIN32")
-  endif(NOT WIN32)
-endif(EIGEN_TEST_MATRIX_DIR)
+  endif()
+endif()
 
 set(SPARSE_LIBS " ")
 
@@ -110,9 +110,9 @@
   elseif(METIS_FOUND)
     include_directories(${METIS_INCLUDE_DIRS})
     set(PASTIX_LIBRARIES ${PASTIX_LIBRARIES} ${METIS_LIBRARIES})
-  else(SCOTCH_FOUND)
+  else()
     ei_add_property(EIGEN_MISSING_BACKENDS  "PaStiX, ")
-  endif(SCOTCH_FOUND)
+  endif()
   set(SPARSE_LIBS ${SPARSE_LIBS} ${PASTIX_LIBRARIES_DEP} ${ORDERING_LIBRARIES})
   set(PASTIX_ALL_LIBS ${PASTIX_LIBRARIES_DEP})
   ei_add_property(EIGEN_TESTED_BACKENDS  "PaStiX, ")
@@ -148,11 +148,11 @@
   else()
     ei_add_property(EIGEN_MISSING_BACKENDS  "Qt4 support, ")
   endif()
-endif(NOT EIGEN_TEST_NOQT)
+endif()
 
 if(TEST_LIB)
   add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1")
-endif(TEST_LIB)
+endif()
 
 set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Official")
 add_custom_target(BuildOfficial)
@@ -311,7 +311,7 @@
 
 if(QT4_FOUND)
   ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}")
-endif(QT4_FOUND)
+endif()
 
 if(UMFPACK_FOUND)
   ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}")
@@ -405,9 +405,9 @@
   
   unset(EIGEN_ADD_TEST_FILENAME_EXTENSION)
 
-endif(CUDA_FOUND)
+endif()
 
-endif(EIGEN_TEST_CUDA)
+endif()
 
 
 # HIP unit tests
@@ -439,7 +439,7 @@
 	message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
       endif()
       
-    endif(HIP_FOUND)
+    endif()
     
   else ()
 
@@ -447,7 +447,7 @@
     
   endif()
     
-endif(EIGEN_TEST_HIP)
+endif()
 
 option(EIGEN_TEST_BUILD_DOCUMENTATION "Test building the doxygen documentation" OFF)
 IF(EIGEN_TEST_BUILD_DOCUMENTATION)
diff --git a/unsupported/test/CMakeLists.txt b/unsupported/test/CMakeLists.txt
index 4017476..3d9ac92 100644
--- a/unsupported/test/CMakeLists.txt
+++ b/unsupported/test/CMakeLists.txt
@@ -17,9 +17,9 @@
   add_definitions("-DEIGEN_GOOGLEHASH_SUPPORT")
   include_directories(${GOOGLEHASH_INCLUDES})
   ei_add_property(EIGEN_TESTED_BACKENDS  "GoogleHash, ")
-else(GOOGLEHASH_FOUND)
+else()
   ei_add_property(EIGEN_MISSING_BACKENDS  "GoogleHash, ")
-endif(GOOGLEHASH_FOUND)
+endif()
 
 
 find_package(Adolc)
@@ -31,9 +31,9 @@
   else()
     message(STATUS "Adolc found, but tests require C++11 mode")
   endif()
-else(ADOLC_FOUND)
+else()
   ei_add_property(EIGEN_MISSING_BACKENDS "Adolc, ")
-endif(ADOLC_FOUND)
+endif()
 
 # this test seems to never have been successful on x87, so is considered to contain a FP-related bug.
 # see thread: "non-linear optimization test summary"
@@ -114,13 +114,13 @@
     if(EIGEN_SYCL_TRISYCL)
       set(CMAKE_CXX_STANDARD 14)
       set(STD_CXX_FLAG "-std=c++1z")
-    else(EIGEN_SYCL_TRISYCL)
+    else()
       # It should be safe to always run these tests as there is some fallback code for
       # older compiler that don't support cxx11.
       # This is already set if EIGEN_TEST_CXX11 is enabled:
       # set(CMAKE_CXX_STANDARD 11)
       # set(STD_CXX_FLAG "-std=c++11")
-    endif(EIGEN_SYCL_TRISYCL)
+    endif()
 
     ei_add_test_sycl(cxx11_tensor_sycl ${STD_CXX_FLAG})
     ei_add_test_sycl(cxx11_tensor_forced_eval_sycl ${STD_CXX_FLAG})
@@ -145,7 +145,7 @@
     ei_add_test_sycl(cxx11_tensor_volume_patch_sycl ${STD_CXX_FLAG})
     ei_add_test_sycl(cxx11_tensor_argmax_sycl ${STD_CXX_FLAG})
     ei_add_test_sycl(cxx11_tensor_custom_op_sycl ${STD_CXX_FLAG})
-  endif(EIGEN_TEST_SYCL)
+  endif()
 
   ei_add_test(cxx11_eventcount "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
   ei_add_test(cxx11_runqueue "-pthread" "${CMAKE_THREAD_LIBS_INIT}")
@@ -339,7 +339,7 @@
 	message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
       endif()
 
-    endif(HIP_FOUND)
+    endif()
 
   else ()
 
@@ -347,5 +347,5 @@
 
   endif()
 
-endif(EIGEN_TEST_HIP)
+endif()