From: Matthias Maier Date: Fri, 25 Nov 2022 13:21:20 +0000 (-0600) Subject: CMake: remove CMAKE_MODULE_PATH workarounds X-Git-Tag: v9.5.0-rc1~808^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14472%2Fhead;p=dealii.git CMake: remove CMAKE_MODULE_PATH workarounds --- diff --git a/cmake/modules/FindDEAL_II_BOOST.cmake b/cmake/modules/FindDEAL_II_BOOST.cmake index ebdfcd9a99..d65dc516c0 100644 --- a/cmake/modules/FindDEAL_II_BOOST.cmake +++ b/cmake/modules/FindDEAL_II_BOOST.cmake @@ -48,9 +48,6 @@ if(NOT BUILD_SHARED_LIBS) set(Boost_USE_STATIC_LIBS TRUE) endif() -# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup -list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - # Work around a CMake compatibility issue with boost-1.70.0 # compare https://gitlab.kitware.com/cmake/cmake/issues/18865 # and https://lists.boost.org/Archives/boost/2019/02/245016.php @@ -65,7 +62,6 @@ else() serialization system thread ) endif() -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # # Fall back to dynamic libraries if no static libraries could be found: diff --git a/cmake/modules/FindDEAL_II_CGAL.cmake b/cmake/modules/FindDEAL_II_CGAL.cmake index 584d853189..eb7635cdbf 100644 --- a/cmake/modules/FindDEAL_II_CGAL.cmake +++ b/cmake/modules/FindDEAL_II_CGAL.cmake @@ -37,8 +37,6 @@ endif() # fail cracefully: # if(DEAL_II_HAVE_CXX17 AND NOT FEATURE_BOOST_BUNDLED_CONFIGURED) - # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup - list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE ON) find_package(CGAL QUIET) @@ -50,8 +48,6 @@ if(DEAL_II_HAVE_CXX17 AND NOT FEATURE_BOOST_BUNDLED_CONFIGURED) message(STATUS "CGAL wrappers require CGAL version 5 and above.") endif() - list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - if(CGAL_FOUND) get_target_property(CGAL_LIBRARIES CGAL::CGAL INTERFACE_LINK_LIBRARIES) diff --git a/cmake/modules/FindDEAL_II_CUDA.cmake b/cmake/modules/FindDEAL_II_CUDA.cmake index 20efb60b71..2a9174fa6a 100644 --- a/cmake/modules/FindDEAL_II_CUDA.cmake +++ b/cmake/modules/FindDEAL_II_CUDA.cmake @@ -34,10 +34,7 @@ if(NOT "${CUDA_DIR}" STREQUAL "") set(CUDA_TOOLKIT_ROOT_DIR "${CUDA_DIR}") endif() -# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup -list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) find_package(CUDA) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) if(CUDA_FOUND) message(STATUS "Configured to use CUDA installation at ${CUDA_TOOLKIT_ROOT_DIR}") diff --git a/cmake/modules/FindDEAL_II_HDF5.cmake b/cmake/modules/FindDEAL_II_HDF5.cmake index a40aed8530..b8918cfe7a 100644 --- a/cmake/modules/FindDEAL_II_HDF5.cmake +++ b/cmake/modules/FindDEAL_II_HDF5.cmake @@ -26,9 +26,6 @@ set(HDF5_DIR "" CACHE PATH "An optional hint to an hdf5 directory") set_if_empty(HDF5_DIR "$ENV{HDF5_DIR}") -# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup -list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - if(NOT "${HDF5_DIR}" STREQUAL "") set(HDF5_ROOT "${HDF5_DIR}") endif() @@ -36,8 +33,6 @@ endif() set(HDF5_PREFER_PARALLEL TRUE) find_package(HDF5) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - set(_include_dirs "${HDF5_INCLUDE_DIRS}") set(_libraries "${HDF5_LIBRARIES};${HDF5_HL_LIBRARIES}") diff --git a/cmake/modules/FindDEAL_II_KOKKOS.cmake b/cmake/modules/FindDEAL_II_KOKKOS.cmake index 6ef4b0115a..2c4ba33721 100644 --- a/cmake/modules/FindDEAL_II_KOKKOS.cmake +++ b/cmake/modules/FindDEAL_II_KOKKOS.cmake @@ -32,12 +32,9 @@ if(DEAL_II_TRILINOS_WITH_KOKKOS) # Let deal.II know that we have found Kokkos set(KOKKOS_FOUND ON) else() - # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup - list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) find_package(Kokkos 3.7.0 QUIET HINTS ${KOKKOS_DIR} ${Kokkos_DIR} $ENV{Kokkos_DIR} ) - list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) if(Kokkos_FOUND) # We are only interested in Kokkos if it is not part of Trilinos diff --git a/cmake/modules/FindDEAL_II_LAPACK.cmake b/cmake/modules/FindDEAL_II_LAPACK.cmake index 6b39f3cb33..aa60e6edf3 100644 --- a/cmake/modules/FindDEAL_II_LAPACK.cmake +++ b/cmake/modules/FindDEAL_II_LAPACK.cmake @@ -44,9 +44,6 @@ set_if_empty(LAPACK_DIR "$ENV{LAPACK_DIR}") set(_cmake_prefix_path_backup "${CMAKE_PREFIX_PATH}") -# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup -list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - set(CMAKE_PREFIX_PATH ${BLAS_DIR} ${LAPACK_DIR} ${_cmake_prefix_path_backup}) find_package(BLAS) @@ -54,7 +51,6 @@ set(CMAKE_PREFIX_PATH ${LAPACK_DIR} ${_cmake_prefix_path_backup}) find_package(LAPACK) set(CMAKE_PREFIX_PATH ${_cmake_prefix_path_backup}) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # # Filter out spurious "FALSE" in the library lists: diff --git a/cmake/modules/FindDEAL_II_MPI.cmake b/cmake/modules/FindDEAL_II_MPI.cmake index bf31acf82b..847ed364f5 100644 --- a/cmake/modules/FindDEAL_II_MPI.cmake +++ b/cmake/modules/FindDEAL_II_MPI.cmake @@ -50,10 +50,7 @@ if(DEFINED ENV{MPIEXEC}) find_program(MPIEXEC $ENV{MPIEXEC}) endif() -# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup -list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) find_package(MPI) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # # Older versions of MPI may not have MPI_SEEK_SET, which we diff --git a/cmake/modules/FindDEAL_II_SYMENGINE.cmake b/cmake/modules/FindDEAL_II_SYMENGINE.cmake index 0c7fdb611e..c7b49df206 100644 --- a/cmake/modules/FindDEAL_II_SYMENGINE.cmake +++ b/cmake/modules/FindDEAL_II_SYMENGINE.cmake @@ -30,7 +30,7 @@ set_if_empty(SYMENGINE_DIR "$ENV{SYMENGINE_DIR}") # SymEngine overwrites the CMake module path, so we save # and restore it after this library is found and configured. # -set (DEAL_II_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) +set(_cmake_module_path ${CMAKE_MODULE_PATH}) # # Include the SymEngine: @@ -45,7 +45,7 @@ find_package(SymEngine # # Reset the CMake module path # -set (CMAKE_MODULE_PATH ${DEAL_II_CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH ${_cmake_module_path}) # diff --git a/cmake/modules/FindDEAL_II_ZLIB.cmake b/cmake/modules/FindDEAL_II_ZLIB.cmake index e6654a13a0..7d6f01811c 100644 --- a/cmake/modules/FindDEAL_II_ZLIB.cmake +++ b/cmake/modules/FindDEAL_II_ZLIB.cmake @@ -29,10 +29,7 @@ set_if_empty(ZLIB_DIR "$ENV{ZLIB_DIR}") if(NOT "${ZLIB_DIR}" STREQUAL "") set(ZLIB_ROOT ${ZLIB_DIR}) endif() -# temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup -list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) find_package(ZLIB) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) set(ZLIB_VERSION ${ZLIB_VERSION_STRING})