From: Matthias Maier Date: Fri, 25 Nov 2022 11:52:24 +0000 (-0600) Subject: CMake: Rename macro to process_feature() and rework output X-Git-Tag: v9.5.0-rc1~797^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8046a6c00c5d438d0af9a295542460af8f94abe1;p=dealii.git CMake: Rename macro to process_feature() and rework output --- diff --git a/cmake/macros/macro_deal_ii_package_handle.cmake b/cmake/macros/macro_process_feature.cmake similarity index 92% rename from cmake/macros/macro_deal_ii_package_handle.cmake rename to cmake/macros/macro_process_feature.cmake index 79b86e0f66..3f2d9eb018 100644 --- a/cmake/macros/macro_deal_ii_package_handle.cmake +++ b/cmake/macros/macro_process_feature.cmake @@ -14,7 +14,7 @@ ## --------------------------------------------------------------------- # -# deal_ii_package_handle( +# process_feature( # { {(REQUIRED|OPTIONAL) }} # [CLEAR ] # ) @@ -25,7 +25,7 @@ # # Its usage is best explained with an example: # -# deal_ii_package_handle(PETSC +# process_feature(PETSC # LIBRARIES # REQUIRED PETSC_LIBRARY # OPTIONAL _petsc_libraries @@ -45,7 +45,9 @@ # search. # -macro(deal_ii_package_handle _feature) +macro(process_feature _feature) + + message(STATUS "Configuring ${_feature} interface target:") if(DEFINED ${_feature}_VERSION) message(STATUS " ${_feature}_VERSION: ${${_feature}_VERSION}") @@ -105,7 +107,7 @@ macro(deal_ii_package_handle _feature) if ("${_current_suffix}" STREQUAL "") message(FATAL_ERROR "Internal configuration error: the second " - "argument to DEAL_II_PACKAGE_HANDLE must be a keyword" + "argument to process_feature must be a keyword" ) endif() @@ -155,17 +157,6 @@ macro(deal_ii_package_handle _feature) to_string(_temp_${_suffix} ${_temp_${_suffix}}) endforeach() - # - # Write back into global variables: - # - clear_feature(${_feature}) - foreach(_suffix ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES}) - if(NOT "${_temp_${_suffix}}" STREQUAL "") - set(${_feature}_${_suffix} "${_temp_${_suffix}}") - message(STATUS " ${_feature}_${_suffix}: ${${_feature}_${_suffix}}") - endif() - endforeach() - # # Remove certain system libraries from the link interface. This is # purely cosmetic (we always implicitly link against the C library, and @@ -173,19 +164,33 @@ macro(deal_ii_package_handle _feature) # necessary). # foreach(_suffix LIBRARIES LIBRARIES_DEBUG LIBRARIES_RELEASE) - if(NOT "${${_feature}_${_suffix}}" STREQUAL "") - list(REMOVE_ITEM ${_feature}_${_suffix} + if(NOT "${_temp_${_suffix}}" STREQUAL "") + list(REMOVE_ITEM _temp_${_suffix} "pthread" "-pthread" "-lpthread" "c" "-lc" ) endif() endforeach() - message(STATUS "Found ${_feature}") + # + # Write back into global variables: + # + clear_feature(${_feature}) + foreach(_suffix ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES}) + if(NOT "${_temp_${_suffix}}" STREQUAL "") + set(${_feature}_${_suffix} "${_temp_${_suffix}}") + message(STATUS " ${_feature}_${_suffix}: ${${_feature}_${_suffix}}") + endif() + endforeach() mark_as_advanced(${_feature}_DIR ${_feature}_ARCH) + # + # Finally create interface target: + # + # define_feature_target(${_feature}) + else() - message(STATUS "Could NOT find ${_feature}") + message(STATUS "Could NOT configure ${_feature}") endif() endmacro() diff --git a/cmake/modules/FindDEAL_II_ADOLC.cmake b/cmake/modules/FindDEAL_II_ADOLC.cmake index a0b0e9bc1d..145f6d2573 100644 --- a/cmake/modules/FindDEAL_II_ADOLC.cmake +++ b/cmake/modules/FindDEAL_II_ADOLC.cmake @@ -107,7 +107,7 @@ if(EXISTS ${ADOLC_SETTINGS_H}) endif() -deal_ii_package_handle(ADOLC +process_feature(ADOLC LIBRARIES REQUIRED ADOLC_LIBRARY ${_additional_library} diff --git a/cmake/modules/FindDEAL_II_ARBORX.cmake b/cmake/modules/FindDEAL_II_ARBORX.cmake index 1f784df5ba..0dccbe70cf 100644 --- a/cmake/modules/FindDEAL_II_ARBORX.cmake +++ b/cmake/modules/FindDEAL_II_ARBORX.cmake @@ -66,7 +66,7 @@ if(ArborX_FOUND) endif() endif() -deal_ii_package_handle(ARBORX +process_feature(ARBORX # ArborX is a header-only library INCLUDE_DIRS REQUIRED ARBORX_INSTALL_INCLUDE_DIR CLEAR ARBORX_DIR ArborX_DIR diff --git a/cmake/modules/FindDEAL_II_ARPACK.cmake b/cmake/modules/FindDEAL_II_ARPACK.cmake index 8f9baf5176..6a7197f2a8 100644 --- a/cmake/modules/FindDEAL_II_ARPACK.cmake +++ b/cmake/modules/FindDEAL_II_ARPACK.cmake @@ -71,7 +71,7 @@ else() set(ARPACK_WITH_PARPACK FALSE) endif() -deal_ii_package_handle(ARPACK +process_feature(ARPACK LIBRARIES OPTIONAL PARPACK_LIBRARY REQUIRED ARPACK_LIBRARY LAPACK_LIBRARIES diff --git a/cmake/modules/FindDEAL_II_ASSIMP.cmake b/cmake/modules/FindDEAL_II_ASSIMP.cmake index ce9ed5944d..e702a3fa06 100644 --- a/cmake/modules/FindDEAL_II_ASSIMP.cmake +++ b/cmake/modules/FindDEAL_II_ASSIMP.cmake @@ -35,7 +35,7 @@ deal_ii_find_path(ASSIMP_INC assimp/defs.h PATH_SUFFIXES include ) -deal_ii_package_handle(ASSIMP +process_feature(ASSIMP LIBRARIES REQUIRED ASSIMP_LIB INCLUDE_DIRS REQUIRED ASSIMP_INC CLEAR ASSIMP_LIB ASSIMP_INC diff --git a/cmake/modules/FindDEAL_II_BOOST.cmake b/cmake/modules/FindDEAL_II_BOOST.cmake index d65dc516c0..c9d79060c6 100644 --- a/cmake/modules/FindDEAL_II_BOOST.cmake +++ b/cmake/modules/FindDEAL_II_BOOST.cmake @@ -90,7 +90,7 @@ if(Boost_FOUND) ) endif() -deal_ii_package_handle(BOOST +process_feature(BOOST LIBRARIES REQUIRED Boost_LIBRARIES INCLUDE_DIRS REQUIRED Boost_INCLUDE_DIRS CLEAR diff --git a/cmake/modules/FindDEAL_II_CGAL.cmake b/cmake/modules/FindDEAL_II_CGAL.cmake index eb7635cdbf..4d8c26d346 100644 --- a/cmake/modules/FindDEAL_II_CGAL.cmake +++ b/cmake/modules/FindDEAL_II_CGAL.cmake @@ -82,7 +82,7 @@ else() message(STATUS "CGAL wrappers require C++17. Disabling CGAL Support.") endif() -deal_ii_package_handle(CGAL +process_feature(CGAL LIBRARIES OPTIONAL CGAL_LIBRARIES INCLUDE_DIRS REQUIRED CGAL_INCLUDE_DIRS CLEAR diff --git a/cmake/modules/FindDEAL_II_CUDA.cmake b/cmake/modules/FindDEAL_II_CUDA.cmake index 2a9174fa6a..6c234db6f0 100644 --- a/cmake/modules/FindDEAL_II_CUDA.cmake +++ b/cmake/modules/FindDEAL_II_CUDA.cmake @@ -40,7 +40,7 @@ if(CUDA_FOUND) message(STATUS "Configured to use CUDA installation at ${CUDA_TOOLKIT_ROOT_DIR}") endif() -deal_ii_package_handle(CUDA +process_feature(CUDA LIBRARIES REQUIRED CUDA_LIBRARIES CUDA_cusparse_LIBRARY CUDA_cusolver_LIBRARY INCLUDE_DIRS REQUIRED CUDA_INCLUDE_DIRS CLEAR diff --git a/cmake/modules/FindDEAL_II_GINKGO.cmake b/cmake/modules/FindDEAL_II_GINKGO.cmake index ccc7bdb229..aceb8db189 100644 --- a/cmake/modules/FindDEAL_II_GINKGO.cmake +++ b/cmake/modules/FindDEAL_II_GINKGO.cmake @@ -75,7 +75,7 @@ if(Ginkgo_FOUND) set(GINKGO_VERSION "${GINKGO_PROJECT_VERSION}") endif() -deal_ii_package_handle(GINKGO +process_feature(GINKGO LIBRARIES REQUIRED ${_libraries} INCLUDE_DIRS REQUIRED GINKGO_INSTALL_INCLUDE_DIR CLEAR Ginkgo_DIR ${_libraries} diff --git a/cmake/modules/FindDEAL_II_GMSH.cmake b/cmake/modules/FindDEAL_II_GMSH.cmake index 9947d8cbbc..8d2a173cd2 100644 --- a/cmake/modules/FindDEAL_II_GMSH.cmake +++ b/cmake/modules/FindDEAL_II_GMSH.cmake @@ -53,7 +53,7 @@ else() set(GMSH_WITH_API TRUE) endif() -deal_ii_package_handle(GMSH +process_feature(GMSH EXECUTABLE REQUIRED GMSH_EXE LIBRARIES OPTIONAL GMSH_LIBRARY INCLUDE_DIRS OPTIONAL GMSH_INCLUDE_DIR diff --git a/cmake/modules/FindDEAL_II_GSL.cmake b/cmake/modules/FindDEAL_II_GSL.cmake index 1d4aa7b93c..d50bcf3ae4 100644 --- a/cmake/modules/FindDEAL_II_GSL.cmake +++ b/cmake/modules/FindDEAL_II_GSL.cmake @@ -70,7 +70,7 @@ if(EXISTS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" ) ) endif() -deal_ii_package_handle(GSL +process_feature(GSL LIBRARIES REQUIRED GSL_LIBRARY OPTIONAL GSL_CBLAS_LIBRARY diff --git a/cmake/modules/FindDEAL_II_HDF5.cmake b/cmake/modules/FindDEAL_II_HDF5.cmake index b8918cfe7a..628c198456 100644 --- a/cmake/modules/FindDEAL_II_HDF5.cmake +++ b/cmake/modules/FindDEAL_II_HDF5.cmake @@ -36,7 +36,7 @@ find_package(HDF5) set(_include_dirs "${HDF5_INCLUDE_DIRS}") set(_libraries "${HDF5_LIBRARIES};${HDF5_HL_LIBRARIES}") -deal_ii_package_handle(HDF5 +process_feature(HDF5 LIBRARIES REQUIRED _libraries OPTIONAL MPI_C_LIBRARIES diff --git a/cmake/modules/FindDEAL_II_KOKKOS.cmake b/cmake/modules/FindDEAL_II_KOKKOS.cmake index 2c4ba33721..bbe1f4054d 100644 --- a/cmake/modules/FindDEAL_II_KOKKOS.cmake +++ b/cmake/modules/FindDEAL_II_KOKKOS.cmake @@ -76,7 +76,7 @@ else() endif() endif() - deal_ii_package_handle(KOKKOS + process_feature(KOKKOS LIBRARIES REQUIRED KOKKOS_CORE_LIBRARY KOKKOS_CONTAINERS_LIBRARY INCLUDE_DIRS REQUIRED KOKKOS_INSTALL_INCLUDE_DIR CXX_FLAGS OPTIONAL KOKKOS_COMPILE_FLAGS diff --git a/cmake/modules/FindDEAL_II_LAPACK.cmake b/cmake/modules/FindDEAL_II_LAPACK.cmake index aa60e6edf3..3391cb6712 100644 --- a/cmake/modules/FindDEAL_II_LAPACK.cmake +++ b/cmake/modules/FindDEAL_II_LAPACK.cmake @@ -97,7 +97,7 @@ if(NOT BUILD_SHARED_LIBS) endif() -deal_ii_package_handle(LAPACK +process_feature(LAPACK LIBRARIES REQUIRED LAPACK_LIBRARIES OPTIONAL BLAS_LIBRARIES ${_additional_libraries} diff --git a/cmake/modules/FindDEAL_II_METIS.cmake b/cmake/modules/FindDEAL_II_METIS.cmake index b31d8d5ee4..ac7b891a27 100644 --- a/cmake/modules/FindDEAL_II_METIS.cmake +++ b/cmake/modules/FindDEAL_II_METIS.cmake @@ -81,7 +81,7 @@ if(EXISTS ${METIS_INCLUDE_DIR}/metis.h) endif() endif() -deal_ii_package_handle(METIS +process_feature(METIS LIBRARIES REQUIRED METIS_LIBRARY OPTIONAL MPI_C_LIBRARIES diff --git a/cmake/modules/FindDEAL_II_MPI.cmake b/cmake/modules/FindDEAL_II_MPI.cmake index 847ed364f5..7099787697 100644 --- a/cmake/modules/FindDEAL_II_MPI.cmake +++ b/cmake/modules/FindDEAL_II_MPI.cmake @@ -154,7 +154,7 @@ if(NOT MPI_UNDERLINKAGE_OK AND NOT "${MPI_CXX_LIBRARIES}" STREQUAL "") # # Note: We don't need to check whether the find library call is # successful: If libopen-pal cannot be found then the - # DEAL_II_PACKAGE_HANDLE will drop the library automatically. + # process_feature will drop the library automatically. # # In this case the sanity check in cmake/setup_finalize.cmake will fail # and we start dropping -fuse-ld=lld and -fuse-ld=ld.gold from the @@ -162,7 +162,7 @@ if(NOT MPI_UNDERLINKAGE_OK AND NOT "${MPI_CXX_LIBRARIES}" STREQUAL "") # endif() -deal_ii_package_handle(MPI +process_feature(MPI LIBRARIES OPTIONAL MPI_CXX_LIBRARIES MPI_Fortran_LIBRARIES MPI_C_LIBRARIES _mpi_libopen_pal_library INCLUDE_DIRS diff --git a/cmake/modules/FindDEAL_II_MUPARSER.cmake b/cmake/modules/FindDEAL_II_MUPARSER.cmake index a49717bfac..b6d55c7f85 100644 --- a/cmake/modules/FindDEAL_II_MUPARSER.cmake +++ b/cmake/modules/FindDEAL_II_MUPARSER.cmake @@ -77,7 +77,7 @@ if(EXISTS ${MUPARSER_INCLUDE_DIR}/muParserDef.h) ) endif() -deal_ii_package_handle(MUPARSER +process_feature(MUPARSER LIBRARIES REQUIRED MUPARSER_LIBRARY INCLUDE_DIRS REQUIRED MUPARSER_INCLUDE_DIR CLEAR MUPARSER_LIBRARY MUPARSER_INCLUDE_DIR diff --git a/cmake/modules/FindDEAL_II_OPENCASCADE.cmake b/cmake/modules/FindDEAL_II_OPENCASCADE.cmake index 6754aa44cc..58fb656b32 100644 --- a/cmake/modules/FindDEAL_II_OPENCASCADE.cmake +++ b/cmake/modules/FindDEAL_II_OPENCASCADE.cmake @@ -84,7 +84,7 @@ foreach(_library ${_opencascade_libraries}) endforeach() -deal_ii_package_handle(OPENCASCADE +process_feature(OPENCASCADE LIBRARIES REQUIRED ${_libraries} INCLUDE_DIRS diff --git a/cmake/modules/FindDEAL_II_P4EST.cmake b/cmake/modules/FindDEAL_II_P4EST.cmake index dec566ae11..5309bdc68d 100644 --- a/cmake/modules/FindDEAL_II_P4EST.cmake +++ b/cmake/modules/FindDEAL_II_P4EST.cmake @@ -198,7 +198,7 @@ if(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) endif() endif() -deal_ii_package_handle(P4EST +process_feature(P4EST LIBRARIES REQUIRED ${_libraries} OPTIONAL LAPACK_LIBRARIES MPI_C_LIBRARIES diff --git a/cmake/modules/FindDEAL_II_PETSC.cmake b/cmake/modules/FindDEAL_II_PETSC.cmake index 5510095c29..b23d25fb70 100644 --- a/cmake/modules/FindDEAL_II_PETSC.cmake +++ b/cmake/modules/FindDEAL_II_PETSC.cmake @@ -207,7 +207,7 @@ if(PETSC_WITH_MPIUNI) set(PETSC_INCLUDE_DIR_MPIUNI "${PETSC_INCLUDE_DIR_MPIUNI}/mpiuni") endif() -deal_ii_package_handle(PETSC +process_feature(PETSC LIBRARIES REQUIRED PETSC_LIBRARY OPTIONAL _petsc_libraries diff --git a/cmake/modules/FindDEAL_II_SCALAPACK.cmake b/cmake/modules/FindDEAL_II_SCALAPACK.cmake index fa3633b015..ee209f51c7 100644 --- a/cmake/modules/FindDEAL_II_SCALAPACK.cmake +++ b/cmake/modules/FindDEAL_II_SCALAPACK.cmake @@ -83,7 +83,7 @@ if (SCALAPACK_LIBRARY) endif() -deal_ii_package_handle(SCALAPACK +process_feature(SCALAPACK LIBRARIES REQUIRED SCALAPACK_LIBRARY LAPACK_LIBRARIES OPTIONAL BLACS_LIBRARY BLACSCINIT_LIBRARY BLACSF77INIT_LIBRARY MPI_Fortran_LIBRARIES diff --git a/cmake/modules/FindDEAL_II_SLEPC.cmake b/cmake/modules/FindDEAL_II_SLEPC.cmake index 186051fa09..6e30ed482b 100644 --- a/cmake/modules/FindDEAL_II_SLEPC.cmake +++ b/cmake/modules/FindDEAL_II_SLEPC.cmake @@ -89,7 +89,7 @@ if(EXISTS ${SLEPC_SLEPCVERSION_H}) ) endif() -deal_ii_package_handle(SLEPC +process_feature(SLEPC LIBRARIES REQUIRED SLEPC_LIBRARY PETSC_LIBRARIES INCLUDE_DIRS diff --git a/cmake/modules/FindDEAL_II_SUNDIALS.cmake b/cmake/modules/FindDEAL_II_SUNDIALS.cmake index 301f02f251..256f24ffa8 100644 --- a/cmake/modules/FindDEAL_II_SUNDIALS.cmake +++ b/cmake/modules/FindDEAL_II_SUNDIALS.cmake @@ -122,7 +122,7 @@ if(NOT SUNDIALS_CONFIG_H MATCHES "-NOTFOUND") ) endif() -deal_ii_package_handle(SUNDIALS +process_feature(SUNDIALS LIBRARIES REQUIRED ${_sundials_lib_ida} SUNDIALS_LIB_ARKODE diff --git a/cmake/modules/FindDEAL_II_SYMENGINE.cmake b/cmake/modules/FindDEAL_II_SYMENGINE.cmake index c7b49df206..a7d6610424 100644 --- a/cmake/modules/FindDEAL_II_SYMENGINE.cmake +++ b/cmake/modules/FindDEAL_II_SYMENGINE.cmake @@ -132,7 +132,7 @@ foreach(SYMENGINE_LIBRARY_NAME ${SYMENGINE_LIBRARIES}) endforeach() set(SYMENGINE_LIBRARIES ${_symengine_libraries}) -deal_ii_package_handle(SYMENGINE +process_feature(SYMENGINE LIBRARIES REQUIRED SYMENGINE_LIBRARIES INCLUDE_DIRS REQUIRED SYMENGINE_INCLUDE_DIRS CLEAR SYMENGINE_SETTINGS_H SYMENGINE_SKIP_DEPENDENCIES SymEngine_DIR diff --git a/cmake/modules/FindDEAL_II_TASKFLOW.cmake b/cmake/modules/FindDEAL_II_TASKFLOW.cmake index 07b1921806..84b8bfd48d 100644 --- a/cmake/modules/FindDEAL_II_TASKFLOW.cmake +++ b/cmake/modules/FindDEAL_II_TASKFLOW.cmake @@ -51,7 +51,7 @@ string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" TASKFLOW_VERSION_MINOR "${TASKFLOW_CONFIG_VERSION}") -deal_ii_package_handle(TASKFLOW +process_feature(TASKFLOW INCLUDE_DIRS REQUIRED TASKFLOW_INCLUDE_DIR CLEAR TASKFLOW_CONFIG_DIR ) diff --git a/cmake/modules/FindDEAL_II_TBB.cmake b/cmake/modules/FindDEAL_II_TBB.cmake index 13928f6eeb..c91b310d09 100644 --- a/cmake/modules/FindDEAL_II_TBB.cmake +++ b/cmake/modules/FindDEAL_II_TBB.cmake @@ -114,7 +114,7 @@ else() set(TBB_WITH_ONEAPI TRUE) endif() -deal_ii_package_handle(TBB +process_feature(TBB LIBRARIES REQUIRED ${_libraries} INCLUDE_DIRS REQUIRED TBB_INCLUDE_DIR CLEAR TBB_DEBUG_LIBRARY TBB_LIBRARY TBB_INCLUDE_DIR diff --git a/cmake/modules/FindDEAL_II_TRILINOS.cmake b/cmake/modules/FindDEAL_II_TRILINOS.cmake index ac3f6d0ec4..a230841646 100644 --- a/cmake/modules/FindDEAL_II_TRILINOS.cmake +++ b/cmake/modules/FindDEAL_II_TRILINOS.cmake @@ -155,7 +155,7 @@ foreach(_library ${Trilinos_LIBRARIES}) endforeach() -deal_ii_package_handle(TRILINOS +process_feature(TRILINOS LIBRARIES REQUIRED ${_libraries} OPTIONAL Trilinos_TPL_LIBRARIES MPI_CXX_LIBRARIES diff --git a/cmake/modules/FindDEAL_II_UMFPACK.cmake b/cmake/modules/FindDEAL_II_UMFPACK.cmake index 00b0f26932..f4d6be32d7 100644 --- a/cmake/modules/FindDEAL_II_UMFPACK.cmake +++ b/cmake/modules/FindDEAL_II_UMFPACK.cmake @@ -126,7 +126,7 @@ FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig) # find_system_library(rt_LIBRARY NAMES rt) -deal_ii_package_handle(UMFPACK +process_feature(UMFPACK LIBRARIES REQUIRED UMFPACK_LIBRARY OPTIONAL CHOLMOD_LIBRARY CCOLAMD_LIBRARY COLAMD_LIBRARY CAMD_LIBRARY SuiteSparse_config_LIBRARY diff --git a/cmake/modules/FindDEAL_II_ZLIB.cmake b/cmake/modules/FindDEAL_II_ZLIB.cmake index 7d6f01811c..3edca1f72b 100644 --- a/cmake/modules/FindDEAL_II_ZLIB.cmake +++ b/cmake/modules/FindDEAL_II_ZLIB.cmake @@ -33,7 +33,7 @@ find_package(ZLIB) set(ZLIB_VERSION ${ZLIB_VERSION_STRING}) -deal_ii_package_handle(ZLIB +process_feature(ZLIB LIBRARIES REQUIRED ZLIB_LIBRARY INCLUDE_DIRS REQUIRED ZLIB_INCLUDE_DIR CLEAR ZLIB_INCLUDE_DIR ZLIB_LIBRARY