## ---------------------------------------------------------------------
#
-# deal_ii_package_handle(<feature>
+# process_feature(<feature>
# {<conf. variable> {(REQUIRED|OPTIONAL) <variables>}}
# [CLEAR <variables>]
# )
#
# Its usage is best explained with an example:
#
-# deal_ii_package_handle(PETSC
+# process_feature(PETSC
# LIBRARIES
# REQUIRED PETSC_LIBRARY
# OPTIONAL _petsc_libraries
# 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}")
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()
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
# 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()
endif()
-deal_ii_package_handle(ADOLC
+process_feature(ADOLC
LIBRARIES
REQUIRED ADOLC_LIBRARY
${_additional_library}
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
set(ARPACK_WITH_PARPACK FALSE)
endif()
-deal_ii_package_handle(ARPACK
+process_feature(ARPACK
LIBRARIES
OPTIONAL PARPACK_LIBRARY
REQUIRED ARPACK_LIBRARY LAPACK_LIBRARIES
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
)
endif()
-deal_ii_package_handle(BOOST
+process_feature(BOOST
LIBRARIES REQUIRED Boost_LIBRARIES
INCLUDE_DIRS REQUIRED Boost_INCLUDE_DIRS
CLEAR
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
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
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}
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
)
endif()
-deal_ii_package_handle(GSL
+process_feature(GSL
LIBRARIES
REQUIRED GSL_LIBRARY
OPTIONAL GSL_CBLAS_LIBRARY
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
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
endif()
-deal_ii_package_handle(LAPACK
+process_feature(LAPACK
LIBRARIES
REQUIRED LAPACK_LIBRARIES
OPTIONAL BLAS_LIBRARIES ${_additional_libraries}
endif()
endif()
-deal_ii_package_handle(METIS
+process_feature(METIS
LIBRARIES
REQUIRED METIS_LIBRARY
OPTIONAL MPI_C_LIBRARIES
#
# 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
#
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
)
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
endforeach()
-deal_ii_package_handle(OPENCASCADE
+process_feature(OPENCASCADE
LIBRARIES
REQUIRED ${_libraries}
INCLUDE_DIRS
endif()
endif()
-deal_ii_package_handle(P4EST
+process_feature(P4EST
LIBRARIES
REQUIRED ${_libraries}
OPTIONAL LAPACK_LIBRARIES MPI_C_LIBRARIES
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
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
)
endif()
-deal_ii_package_handle(SLEPC
+process_feature(SLEPC
LIBRARIES
REQUIRED SLEPC_LIBRARY PETSC_LIBRARIES
INCLUDE_DIRS
)
endif()
-deal_ii_package_handle(SUNDIALS
+process_feature(SUNDIALS
LIBRARIES REQUIRED
${_sundials_lib_ida}
SUNDIALS_LIB_ARKODE
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
"^[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
)
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
endforeach()
-deal_ii_package_handle(TRILINOS
+process_feature(TRILINOS
LIBRARIES
REQUIRED ${_libraries}
OPTIONAL Trilinos_TPL_LIBRARIES MPI_CXX_LIBRARIES
#
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
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