]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Rename macro to process_feature() and rework output
authorMatthias Maier <tamiko@43-1.org>
Fri, 25 Nov 2022 11:52:24 +0000 (05:52 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 26 Nov 2022 23:48:04 +0000 (17:48 -0600)
29 files changed:
cmake/macros/macro_process_feature.cmake [moved from cmake/macros/macro_deal_ii_package_handle.cmake with 92% similarity]
cmake/modules/FindDEAL_II_ADOLC.cmake
cmake/modules/FindDEAL_II_ARBORX.cmake
cmake/modules/FindDEAL_II_ARPACK.cmake
cmake/modules/FindDEAL_II_ASSIMP.cmake
cmake/modules/FindDEAL_II_BOOST.cmake
cmake/modules/FindDEAL_II_CGAL.cmake
cmake/modules/FindDEAL_II_CUDA.cmake
cmake/modules/FindDEAL_II_GINKGO.cmake
cmake/modules/FindDEAL_II_GMSH.cmake
cmake/modules/FindDEAL_II_GSL.cmake
cmake/modules/FindDEAL_II_HDF5.cmake
cmake/modules/FindDEAL_II_KOKKOS.cmake
cmake/modules/FindDEAL_II_LAPACK.cmake
cmake/modules/FindDEAL_II_METIS.cmake
cmake/modules/FindDEAL_II_MPI.cmake
cmake/modules/FindDEAL_II_MUPARSER.cmake
cmake/modules/FindDEAL_II_OPENCASCADE.cmake
cmake/modules/FindDEAL_II_P4EST.cmake
cmake/modules/FindDEAL_II_PETSC.cmake
cmake/modules/FindDEAL_II_SCALAPACK.cmake
cmake/modules/FindDEAL_II_SLEPC.cmake
cmake/modules/FindDEAL_II_SUNDIALS.cmake
cmake/modules/FindDEAL_II_SYMENGINE.cmake
cmake/modules/FindDEAL_II_TASKFLOW.cmake
cmake/modules/FindDEAL_II_TBB.cmake
cmake/modules/FindDEAL_II_TRILINOS.cmake
cmake/modules/FindDEAL_II_UMFPACK.cmake
cmake/modules/FindDEAL_II_ZLIB.cmake

similarity index 92%
rename from cmake/macros/macro_deal_ii_package_handle.cmake
rename to cmake/macros/macro_process_feature.cmake
index 79b86e0f66aa5a54196ad32460823a2f07433acc..3f2d9eb0184d65a7d64c0567db619cf2119b7972 100644 (file)
@@ -14,7 +14,7 @@
 ## ---------------------------------------------------------------------
 
 #
-# deal_ii_package_handle(<feature>
+# process_feature(<feature>
 #  {<conf. variable> {(REQUIRED|OPTIONAL) <variables>}}
 #  [CLEAR <variables>]
 #  )
@@ -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()
index a0b0e9bc1dfe7e61c674c368d39fe45251f5999b..145f6d2573a949bb27ef96634e82cf5310c2a469 100644 (file)
@@ -107,7 +107,7 @@ if(EXISTS ${ADOLC_SETTINGS_H})
 endif()
 
 
-deal_ii_package_handle(ADOLC
+process_feature(ADOLC
   LIBRARIES
     REQUIRED ADOLC_LIBRARY
     ${_additional_library}
index 1f784df5baec57e4c8ce53323ba5ec60b220068b..0dccbe70cf6eb653d9570184ff03217a96d10661 100644 (file)
@@ -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
index 8f9baf5176c51a8b3c3a400932f73d35a44c17fd..6a7197f2a826df469f6cacb558af172b77d10f25 100644 (file)
@@ -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
index ce9ed5944d3b52f9069230450efc52b8b0493c0e..e702a3fa063a68d5711d353dad104605ed7eb11f 100644 (file)
@@ -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
index d65dc516c0419ba445b3fc395615457ca17bb780..c9d79060c67707ea9920fe391df21036480e4a2a 100644 (file)
@@ -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
index eb7635cdbf94cbc3e40a56f9d63702ad4c83f996..4d8c26d346e3e7df0ec3319186a4ff302af5e89b 100644 (file)
@@ -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
index 2a9174fa6a7c222c076bcdde5620fd29815a65a0..6c234db6f0db7e66916468c7e2bef659eee96927 100644 (file)
@@ -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
index ccc7bdb229dde8bd596ddcc45078d9952c149622..aceb8db1890d032551dc19a2288b21c503f873e3 100644 (file)
@@ -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}
index 9947d8cbbc8cecda83652821e4020e8a998d074a..8d2a173cd2cb8775f9b3eec9a31dcf32d4e65e5e 100644 (file)
@@ -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
index 1d4aa7b93c51d0323e98bfb1b83afc4e716b5073..d50bcf3ae41954758189062cbee951dc6b658ed0 100644 (file)
@@ -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
index b8918cfe7a9b050dc75c3c78684072b3bf028c24..628c1984569a32a864f50a8d31fec9667e85aa61 100644 (file)
@@ -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
index 2c4ba337213596e371b2adb9f052e57efda08a52..bbe1f4054dc84213f069d319ff77c035e8fe780c 100644 (file)
@@ -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
index aa60e6edf39e553d957ff11719cb20e1cc988d04..3391cb6712a18d3e44cc10b81b96779e16f11aff 100644 (file)
@@ -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}
index b31d8d5ee47585cc49c33bcbb2d521013b224a2f..ac7b891a273bdc8f0e9962785c36e9bf245ba91e 100644 (file)
@@ -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
index 847ed364f545b9b49127242f45aa7bc4585d5a77..7099787697b00559820a1abeb1bb40ff5c3755d1 100644 (file)
@@ -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
index a49717bfacc215e33f5cb92f2e067985e61e937c..b6d55c7f852c7b1cf37e49ec57b1252864a7c097 100644 (file)
@@ -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
index 6754aa44ccf8f440be65457bdd58b01f3dc841ce..58fb656b32f377998bcc87ca441301004fb9feb8 100644 (file)
@@ -84,7 +84,7 @@ foreach(_library ${_opencascade_libraries})
 endforeach()
 
 
-deal_ii_package_handle(OPENCASCADE
+process_feature(OPENCASCADE
   LIBRARIES
     REQUIRED ${_libraries}
   INCLUDE_DIRS
index dec566ae11198fed97f89253b93f5d4f6d25f11b..5309bdc68d73abaf9b22a98b090b5c24a30f4dbe 100644 (file)
@@ -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
index 5510095c292b5a1112488f844337243f5f53852c..b23d25fb70a054e29f1e14f22a31f0624f01bb3e 100644 (file)
@@ -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
index fa3633b0158d378d0d03fcd71495bc345c3de30d..ee209f51c7cc8c62a43beb5c6528b7fd19b94d5d 100644 (file)
@@ -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
index 186051fa09c2deea982a8b420b808d8b524dcf4d..6e30ed482b2ff3525c9f1f85369d1ad4eee5dfd8 100644 (file)
@@ -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
index 301f02f25122611e4592b3538855f47ed8b7ca10..256f24ffa8ad0ded8076ba350c8908b43ef0a525 100644 (file)
@@ -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
index c7b49df206192866ba8738a30f5edf14101f1a41..a7d6610424cf669e98802bf9889e65bcec66db3e 100644 (file)
@@ -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
index 07b192180664bcefd4d429cc51141372c121cdad..84b8bfd48d14985c782a04faea1188dea1cae226 100644 (file)
@@ -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
   )
index 13928f6eeb39ecb2baed7b8e564dbd92e9d680ab..c91b310d0981a6dbc811932d417daa855300be6a 100644 (file)
@@ -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
index ac3f6d0ec4e55ae77d3a681988b800b230349c90..a2308416460710afc4c3c2330933cc5999afd4ce 100644 (file)
@@ -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
index 00b0f2693216874fd2602c350840639f08dd6c8b..f4d6be32d7f4429bf4f2f49663f9012542062498 100644 (file)
@@ -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
index 7d6f01811cfa79d431c83cfac44b04729d917961..3edca1f72b2416a1db707df311ee729ff6474cc9 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.