From 8aa2c4c5bcd503238c6f39a82fed569d2d364138 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 24 Nov 2022 15:03:20 -0600 Subject: [PATCH] CMake: apply contrib/utilities/lowercase_cmake --- CMakeLists.txt | 140 +++--- CTestConfig.cmake | 26 +- bundled/CMakeLists.txt | 62 +-- .../libs/iostreams/src/CMakeLists.txt | 10 +- .../libs/serialization/src/CMakeLists.txt | 10 +- .../libs/system/src/CMakeLists.txt | 6 +- .../libs/thread/src/CMakeLists.txt | 26 +- bundled/kokkos-3.7.00/CMakeLists.txt | 14 +- bundled/muparser_v2_3_3/CMakeLists.txt | 18 +- bundled/setup_bundled.cmake | 40 +- bundled/tbb-2018_U2/src/CMakeLists.txt | 38 +- bundled/umfpack/AMD/Source/CMakeLists.txt | 16 +- bundled/umfpack/UMFPACK/Source/CMakeLists.txt | 96 ++-- cmake/checks/check_01_cpu_features.cmake | 90 ++-- cmake/checks/check_01_cxx_features.cmake | 180 +++---- cmake/checks/check_02_compiler_features.cmake | 98 ++-- cmake/checks/check_02_fortran_mangling.cmake | 66 +-- cmake/checks/check_02_system_features.cmake | 44 +- cmake/checks/check_03_compiler_bugs.cmake | 14 +- cmake/config/CMakeLists.txt | 288 +++++------ cmake/config/Config.cmake.in | 140 +++--- cmake/configure/TestBoostBug/CMakeLists.txt | 16 +- cmake/configure/configure_00_threads.cmake | 18 +- cmake/configure/configure_10_lapack.cmake | 46 +- cmake/configure/configure_10_mpi.cmake | 62 +-- cmake/configure/configure_10_taskflow.cmake | 54 +- cmake/configure/configure_10_tbb.cmake | 44 +- cmake/configure/configure_10_zlib.cmake | 2 +- cmake/configure/configure_20_boost.cmake | 188 +++---- cmake/configure/configure_20_ginkgo.cmake | 26 +- cmake/configure/configure_20_metis.cmake | 28 +- cmake/configure/configure_20_trilinos.cmake | 296 +++++------ cmake/configure/configure_20_umfpack.cmake | 16 +- cmake/configure/configure_30_kokkos.cmake | 24 +- cmake/configure/configure_30_petsc.cmake | 92 ++-- cmake/configure/configure_40_cuda.cmake | 86 ++-- cmake/configure/configure_50_adolc.cmake | 88 ++-- cmake/configure/configure_50_arborx.cmake | 4 +- cmake/configure/configure_50_arpack.cmake | 6 +- cmake/configure/configure_50_assimp.cmake | 2 +- cmake/configure/configure_50_cgal.cmake | 44 +- .../configure_50_complex_values.cmake | 16 +- cmake/configure/configure_50_gmsh.cmake | 4 +- cmake/configure/configure_50_gsl.cmake | 2 +- cmake/configure/configure_50_hdf5.cmake | 28 +- cmake/configure/configure_50_muparser.cmake | 8 +- .../configure/configure_50_opencascade.cmake | 2 +- cmake/configure/configure_50_p4est.cmake | 58 +-- cmake/configure/configure_50_scalapack.cmake | 38 +- cmake/configure/configure_50_slepc.cmake | 34 +- cmake/configure/configure_50_sundials.cmake | 32 +- cmake/configure/configure_50_symengine.cmake | 44 +- .../configure_50_vectorization.cmake | 28 +- cmake/macros/macro_add_flags.cmake | 16 +- cmake/macros/macro_check_compiler_setup.cmake | 34 +- .../macros/macro_check_cxx_compiler_bug.cmake | 30 +- cmake/macros/macro_check_mpi_interface.cmake | 60 +-- cmake/macros/macro_clear_cmake_required.cmake | 10 +- cmake/macros/macro_clear_feature.cmake | 14 +- cmake/macros/macro_configure_feature.cmake | 236 ++++----- .../macro_deal_ii_add_definitions.cmake | 14 +- cmake/macros/macro_deal_ii_add_library.cmake | 32 +- cmake/macros/macro_deal_ii_add_test.cmake | 368 +++++++------- cmake/macros/macro_deal_ii_find_file.cmake | 20 +- cmake/macros/macro_deal_ii_find_library.cmake | 20 +- cmake/macros/macro_deal_ii_find_path.cmake | 20 +- cmake/macros/macro_deal_ii_find_program.cmake | 20 +- ..._deal_ii_initialize_cached_variables.cmake | 52 +- .../macro_deal_ii_insource_setup_target.cmake | 38 +- .../macro_deal_ii_invoke_autopilot.cmake | 154 +++--- .../macros/macro_deal_ii_package_handle.cmake | 158 +++--- cmake/macros/macro_deal_ii_pickup_tests.cmake | 236 ++++----- .../macro_deal_ii_query_git_information.cmake | 94 ++-- cmake/macros/macro_deal_ii_setup_target.cmake | 100 ++-- cmake/macros/macro_decorate_with_stars.cmake | 32 +- cmake/macros/macro_enable_if_links.cmake | 30 +- cmake/macros/macro_enable_if_supported.cmake | 32 +- .../macro_enable_language_optional.cmake | 58 +-- cmake/macros/macro_evaluate_expression.cmake | 12 +- .../macros/macro_expand_instantiations.cmake | 46 +- .../macro_filter_system_libraries.cmake | 28 +- cmake/macros/macro_find_system_library.cmake | 48 +- cmake/macros/macro_item_matches.cmake | 20 +- cmake/macros/macro_purge_feature.cmake | 32 +- cmake/macros/macro_register_feature.cmake | 58 +-- cmake/macros/macro_remove_duplicates.cmake | 24 +- cmake/macros/macro_replace_flag.cmake | 28 +- cmake/macros/macro_reset_cmake_required.cmake | 10 +- cmake/macros/macro_set_if_empty.cmake | 10 +- cmake/macros/macro_setup_source_list.cmake | 18 +- cmake/macros/macro_setup_unity_target.cmake | 46 +- cmake/macros/macro_strip_flag.cmake | 18 +- .../macro_switch_library_preference.cmake | 12 +- cmake/macros/macro_to_string.cmake | 16 +- .../macro_to_string_and_add_prefix.cmake | 16 +- cmake/macros/macro_unset_if_changed.cmake | 24 +- cmake/macros/macro_verbose_include.cmake | 10 +- cmake/modules/FindADOLC.cmake | 72 +-- cmake/modules/FindARBORX.cmake | 36 +- cmake/modules/FindARPACK.cmake | 48 +- cmake/modules/FindASSIMP.cmake | 10 +- cmake/modules/FindBOOST.cmake | 70 +-- cmake/modules/FindCGAL.cmake | 74 +-- cmake/modules/FindCUDA.cmake | 24 +- cmake/modules/FindGINKGO.cmake | 32 +- cmake/modules/FindGMSH.cmake | 26 +- cmake/modules/FindGSL.cmake | 20 +- cmake/modules/FindHDF5.cmake | 24 +- cmake/modules/FindKOKKOS.cmake | 58 +-- cmake/modules/FindLAPACK.cmake | 66 +-- cmake/modules/FindMETIS.cmake | 34 +- cmake/modules/FindMPI.cmake | 82 ++-- cmake/modules/FindMUPARSER.cmake | 44 +- cmake/modules/FindOPENCASCADE.cmake | 40 +- cmake/modules/FindP4EST.cmake | 116 ++--- cmake/modules/FindPETSC.cmake | 154 +++--- cmake/modules/FindSCALAPACK.cmake | 46 +- cmake/modules/FindSLEPC.cmake | 40 +- cmake/modules/FindSUNDIALS.cmake | 62 +-- cmake/modules/FindSYMENGINE.cmake | 78 +-- cmake/modules/FindTASKFLOW.cmake | 16 +- cmake/modules/FindTBB.cmake | 64 +-- cmake/modules/FindTRILINOS.cmake | 98 ++-- cmake/modules/FindUMFPACK.cmake | 66 +-- cmake/modules/FindZLIB.cmake | 20 +- cmake/scripts/CMakeLists.txt | 18 +- cmake/scripts/run_test.cmake | 110 ++--- cmake/setup_cached_variables.cmake | 226 ++++----- cmake/setup_compiler_flags.cmake | 54 +- cmake/setup_compiler_flags_gnu.cmake | 156 +++--- cmake/setup_compiler_flags_intel.cmake | 112 ++--- cmake/setup_compiler_flags_msvc.cmake | 64 +-- cmake/setup_cpack.cmake | 50 +- cmake/setup_custom_targets.cmake | 84 ++-- cmake/setup_deal_ii.cmake | 74 +-- cmake/setup_external_macros.cmake | 14 +- cmake/setup_finalize.cmake | 100 ++-- cmake/setup_write_config.cmake | 204 ++++---- contrib/python-bindings/CMakeLists.txt | 66 +-- contrib/python-bindings/source/CMakeLists.txt | 34 +- contrib/python-bindings/tests/CMakeLists.txt | 18 +- contrib/utilities/CMakeLists.txt | 6 +- doc/CMakeLists.txt | 28 +- doc/doxygen/CMakeLists.txt | 184 +++---- doc/doxygen/code-gallery/CMakeLists.txt | 88 ++-- doc/doxygen/tutorial/CMakeLists.txt | 42 +- doc/news/CMakeLists.txt | 14 +- doc/news/changes/create_changes_h.cmake | 52 +- examples/CMakeLists.txt | 104 ++-- examples/step-1/CMakeLists.txt | 26 +- examples/step-10/CMakeLists.txt | 26 +- examples/step-11/CMakeLists.txt | 26 +- examples/step-12/CMakeLists.txt | 26 +- examples/step-12b/CMakeLists.txt | 26 +- examples/step-13/CMakeLists.txt | 26 +- examples/step-14/CMakeLists.txt | 26 +- examples/step-15/CMakeLists.txt | 26 +- examples/step-16/CMakeLists.txt | 26 +- examples/step-16b/CMakeLists.txt | 26 +- examples/step-17/CMakeLists.txt | 32 +- examples/step-18/CMakeLists.txt | 32 +- examples/step-19/CMakeLists.txt | 26 +- examples/step-2/CMakeLists.txt | 26 +- examples/step-20/CMakeLists.txt | 26 +- examples/step-21/CMakeLists.txt | 26 +- examples/step-22/CMakeLists.txt | 32 +- examples/step-23/CMakeLists.txt | 26 +- examples/step-24/CMakeLists.txt | 26 +- examples/step-25/CMakeLists.txt | 26 +- examples/step-26/CMakeLists.txt | 26 +- examples/step-27/CMakeLists.txt | 26 +- examples/step-28/CMakeLists.txt | 26 +- examples/step-29/CMakeLists.txt | 32 +- examples/step-3/CMakeLists.txt | 26 +- examples/step-30/CMakeLists.txt | 26 +- examples/step-31/CMakeLists.txt | 32 +- examples/step-32/CMakeLists.txt | 34 +- examples/step-33/CMakeLists.txt | 34 +- examples/step-34/CMakeLists.txt | 32 +- examples/step-35/CMakeLists.txt | 32 +- examples/step-36/CMakeLists.txt | 32 +- examples/step-37/CMakeLists.txt | 32 +- examples/step-38/CMakeLists.txt | 26 +- examples/step-39/CMakeLists.txt | 26 +- examples/step-4/CMakeLists.txt | 26 +- examples/step-40/CMakeLists.txt | 34 +- examples/step-41/CMakeLists.txt | 32 +- examples/step-42/CMakeLists.txt | 34 +- examples/step-43/CMakeLists.txt | 32 +- examples/step-44/CMakeLists.txt | 26 +- examples/step-45/CMakeLists.txt | 32 +- examples/step-46/CMakeLists.txt | 32 +- examples/step-47/CMakeLists.txt | 26 +- examples/step-48/CMakeLists.txt | 26 +- examples/step-49/CMakeLists.txt | 26 +- examples/step-5/CMakeLists.txt | 26 +- examples/step-50/CMakeLists.txt | 34 +- examples/step-51/CMakeLists.txt | 26 +- examples/step-52/CMakeLists.txt | 34 +- examples/step-53/CMakeLists.txt | 32 +- examples/step-54/CMakeLists.txt | 32 +- examples/step-55/CMakeLists.txt | 34 +- examples/step-56/CMakeLists.txt | 32 +- examples/step-57/CMakeLists.txt | 32 +- examples/step-58/CMakeLists.txt | 32 +- examples/step-59/CMakeLists.txt | 32 +- examples/step-6/CMakeLists.txt | 26 +- examples/step-60/CMakeLists.txt | 32 +- examples/step-61/CMakeLists.txt | 26 +- examples/step-62/CMakeLists.txt | 32 +- examples/step-63/CMakeLists.txt | 26 +- examples/step-64/CMakeLists.txt | 32 +- examples/step-65/CMakeLists.txt | 26 +- examples/step-66/CMakeLists.txt | 34 +- examples/step-67/CMakeLists.txt | 26 +- examples/step-68/CMakeLists.txt | 34 +- examples/step-69/CMakeLists.txt | 34 +- examples/step-7/CMakeLists.txt | 26 +- examples/step-70/CMakeLists.txt | 34 +- examples/step-71/CMakeLists.txt | 34 +- examples/step-72/CMakeLists.txt | 34 +- examples/step-74/CMakeLists.txt | 26 +- examples/step-75/CMakeLists.txt | 34 +- examples/step-76/CMakeLists.txt | 26 +- examples/step-77/CMakeLists.txt | 32 +- examples/step-78/CMakeLists.txt | 26 +- examples/step-79/CMakeLists.txt | 26 +- examples/step-8/CMakeLists.txt | 26 +- examples/step-81/CMakeLists.txt | 34 +- examples/step-82/CMakeLists.txt | 26 +- examples/step-85/CMakeLists.txt | 26 +- examples/step-9/CMakeLists.txt | 26 +- include/CMakeLists.txt | 8 +- source/CMakeLists.txt | 96 ++-- source/algorithms/CMakeLists.txt | 12 +- source/arborx/CMakeLists.txt | 12 +- source/base/CMakeLists.txt | 24 +- source/cgal/CMakeLists.txt | 12 +- source/differentiation/CMakeLists.txt | 4 +- source/differentiation/ad/CMakeLists.txt | 12 +- source/differentiation/sd/CMakeLists.txt | 12 +- source/distributed/CMakeLists.txt | 18 +- source/dofs/CMakeLists.txt | 18 +- source/fe/CMakeLists.txt | 18 +- source/gmsh/CMakeLists.txt | 12 +- source/grid/CMakeLists.txt | 26 +- source/hp/CMakeLists.txt | 18 +- source/integrators/CMakeLists.txt | 8 +- source/lac/CMakeLists.txt | 64 +-- source/matrix_free/CMakeLists.txt | 20 +- source/meshworker/CMakeLists.txt | 12 +- source/multigrid/CMakeLists.txt | 18 +- source/non_matching/CMakeLists.txt | 12 +- source/numerics/CMakeLists.txt | 18 +- source/opencascade/CMakeLists.txt | 12 +- source/optimization/rol/CMakeLists.txt | 12 +- source/particles/CMakeLists.txt | 12 +- source/physics/CMakeLists.txt | 14 +- source/physics/elasticity/CMakeLists.txt | 12 +- source/sundials/CMakeLists.txt | 12 +- tests/CMakeLists.txt | 136 ++--- tests/a-framework/CMakeLists.txt | 48 +- tests/adolc/CMakeLists.txt | 12 +- tests/algorithms/CMakeLists.txt | 8 +- tests/all-headers/CMakeLists.txt | 58 +-- tests/aniso/CMakeLists.txt | 8 +- tests/arborx/CMakeLists.txt | 12 +- tests/arpack/CMakeLists.txt | 12 +- tests/base/CMakeLists.txt | 8 +- tests/belos/CMakeLists.txt | 12 +- tests/bits/CMakeLists.txt | 8 +- tests/boost/CMakeLists.txt | 8 +- tests/cgal/CMakeLists.txt | 12 +- tests/codim_one/CMakeLists.txt | 8 +- tests/cuda/CMakeLists.txt | 12 +- tests/data_out/CMakeLists.txt | 8 +- tests/distributed_grids/CMakeLists.txt | 12 +- tests/dofs/CMakeLists.txt | 8 +- tests/epetraext/CMakeLists.txt | 12 +- tests/examples/CMakeLists.txt | 8 +- tests/fe/CMakeLists.txt | 8 +- tests/feinterface/CMakeLists.txt | 8 +- tests/full_matrix/CMakeLists.txt | 8 +- tests/fullydistributed_grids/CMakeLists.txt | 8 +- tests/ginkgo/CMakeLists.txt | 12 +- tests/gla/CMakeLists.txt | 12 +- tests/gmsh/CMakeLists.txt | 12 +- tests/grid/CMakeLists.txt | 8 +- tests/hp/CMakeLists.txt | 8 +- tests/integrators/CMakeLists.txt | 8 +- tests/lac/CMakeLists.txt | 8 +- tests/lapack/CMakeLists.txt | 12 +- tests/manifold/CMakeLists.txt | 8 +- tests/mappings/CMakeLists.txt | 8 +- tests/matrix_free/CMakeLists.txt | 8 +- tests/meshworker/CMakeLists.txt | 8 +- tests/metis/CMakeLists.txt | 12 +- tests/mpi/CMakeLists.txt | 12 +- .../CMakeLists.txt | 8 +- tests/multigrid/CMakeLists.txt | 8 +- tests/multithreading/CMakeLists.txt | 8 +- tests/non_matching/CMakeLists.txt | 8 +- tests/numerics/CMakeLists.txt | 8 +- tests/opencascade/CMakeLists.txt | 12 +- tests/optimization/CMakeLists.txt | 8 +- tests/parameter_handler/CMakeLists.txt | 8 +- tests/particles/CMakeLists.txt | 8 +- tests/performance/CMakeLists.txt | 32 +- tests/petsc/CMakeLists.txt | 12 +- tests/petsc_complex/CMakeLists.txt | 12 +- tests/physics/CMakeLists.txt | 8 +- tests/quick_tests/CMakeLists.txt | 146 +++--- tests/quick_tests/run.cmake | 50 +- tests/remote_point_evaluation/CMakeLists.txt | 8 +- tests/rol/CMakeLists.txt | 12 +- tests/run_buildtest.cmake | 12 +- tests/run_coverage.cmake | 6 +- tests/run_memorycheck.cmake | 6 +- tests/run_performance_tests.cmake | 64 +-- tests/run_testsuite.cmake | 464 +++++++++--------- tests/sacado/CMakeLists.txt | 12 +- tests/scalapack/CMakeLists.txt | 12 +- tests/serialization/CMakeLists.txt | 8 +- tests/setup_testsubproject.cmake | 18 +- tests/sharedtria/CMakeLists.txt | 10 +- tests/simplex/CMakeLists.txt | 8 +- tests/slepc/CMakeLists.txt | 12 +- tests/slepc_complex/CMakeLists.txt | 12 +- tests/sparsity/CMakeLists.txt | 8 +- tests/submit_results.cmake | 32 +- tests/sundials/CMakeLists.txt | 12 +- tests/symengine/CMakeLists.txt | 12 +- tests/tensors/CMakeLists.txt | 8 +- tests/trilinos/CMakeLists.txt | 12 +- tests/umfpack/CMakeLists.txt | 12 +- tests/vector/CMakeLists.txt | 8 +- tests/vector_tools/CMakeLists.txt | 8 +- tests/zoltan/CMakeLists.txt | 12 +- 338 files changed, 6640 insertions(+), 6640 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4319cbae34..b4ff66d740 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,10 +30,10 @@ # # General configuration for cmake: # -MESSAGE(STATUS "This is CMake ${CMAKE_VERSION}") -MESSAGE(STATUS "") +message(STATUS "This is CMake ${CMAKE_VERSION}") +message(STATUS "") -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) @@ -42,101 +42,101 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) # policies CMP0001 - CMP0054 to new for version 3.3 (and later) to avoid # some unnecessary warnings. # -CMAKE_POLICY(VERSION 3.3.0) +cmake_policy(VERSION 3.3.0) -IF("${CMAKE_VERSION}" VERSION_LESS "3.11" AND POLICY CMP0037) +if("${CMAKE_VERSION}" VERSION_LESS "3.11" AND POLICY CMP0037) # Allow to override "test" target for quick tests. - CMAKE_POLICY(SET CMP0037 OLD) -ENDIF() + cmake_policy(SET CMP0037 OLD) +endif() -IF(POLICY CMP0075) +if(POLICY CMP0075) # Use CMAKE_REQUIRED_LIBRARIES also in include file checks. We set the # policy to NEW explicitly in order to avoid spurious configure warnings. - CMAKE_POLICY(SET CMP0075 NEW) -ENDIF() + cmake_policy(SET CMP0075 NEW) +endif() -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # # Load all macros: # -FILE(GLOB _macro_files "cmake/macros/*.cmake") -MESSAGE(STATUS "Include ${CMAKE_SOURCE_DIR}/cmake/setup_external_macros.cmake") -INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_external_macros.cmake) -FOREACH(_file ${_macro_files}) - MESSAGE(STATUS "Include ${_file}") - INCLUDE(${_file}) -ENDFOREACH() +file(GLOB _macro_files "cmake/macros/*.cmake") +message(STATUS "Include ${CMAKE_SOURCE_DIR}/cmake/setup_external_macros.cmake") +include(${CMAKE_SOURCE_DIR}/cmake/setup_external_macros.cmake) +foreach(_file ${_macro_files}) + message(STATUS "Include ${_file}") + include(${_file}) +endforeach() # # Avoid verbose "Up-to-date" status information during installation: # -SET_IF_EMPTY(CMAKE_INSTALL_MESSAGE "LAZY") +set_if_empty(CMAKE_INSTALL_MESSAGE "LAZY") # # Check for the existence of various optional folders: # -IF(EXISTS ${CMAKE_SOURCE_DIR}/bundled/CMakeLists.txt) - SET(DEAL_II_HAVE_BUNDLED_DIRECTORY TRUE) -ENDIF() +if(EXISTS ${CMAKE_SOURCE_DIR}/bundled/CMakeLists.txt) + set(DEAL_II_HAVE_BUNDLED_DIRECTORY TRUE) +endif() -IF(EXISTS ${CMAKE_SOURCE_DIR}/doc/CMakeLists.txt) - SET(DEAL_II_HAVE_DOC_DIRECTORY TRUE) -ENDIF() +if(EXISTS ${CMAKE_SOURCE_DIR}/doc/CMakeLists.txt) + set(DEAL_II_HAVE_DOC_DIRECTORY TRUE) +endif() -IF(EXISTS ${CMAKE_SOURCE_DIR}/tests/CMakeLists.txt) - SET(DEAL_II_HAVE_TESTS_DIRECTORY TRUE) -ENDIF() +if(EXISTS ${CMAKE_SOURCE_DIR}/tests/CMakeLists.txt) + set(DEAL_II_HAVE_TESTS_DIRECTORY TRUE) +endif() # # We have to initialize some cached variables before PROJECT is called, so # do it at this point: # -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_cached_variables.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_cached_variables.cmake) # # Now, set the project and set up the rest: # -PROJECT(deal.II CXX C) -ENABLE_LANGUAGE_OPTIONAL(Fortran) +project(deal.II CXX C) +enable_language_optional(Fortran) -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_deal_ii.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_deal_ii.cmake) -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags.cmake) # # Include information about bundled libraries: # -IF(DEAL_II_HAVE_BUNDLED_DIRECTORY) - VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/bundled/setup_bundled.cmake) -ENDIF() +if(DEAL_II_HAVE_BUNDLED_DIRECTORY) + verbose_include(${CMAKE_SOURCE_DIR}/bundled/setup_bundled.cmake) +endif() # # Run all system checks: # -FILE(GLOB _check_files "cmake/checks/*.cmake") -LIST(SORT _check_files) -FOREACH(_file ${_check_files}) - VERBOSE_INCLUDE(${_file}) -ENDFOREACH() +file(GLOB _check_files "cmake/checks/*.cmake") +list(SORT _check_files) +foreach(_file ${_check_files}) + verbose_include(${_file}) +endforeach() # # Feature configuration: # -FILE(GLOB _configure_files "cmake/configure/configure_*.cmake") -LIST(SORT _configure_files) # make sure to include in alphabetical order -FOREACH(_file ${_configure_files}) - VERBOSE_INCLUDE(${_file}) -ENDFOREACH() +file(GLOB _configure_files "cmake/configure/configure_*.cmake") +list(SORT _configure_files) # make sure to include in alphabetical order +foreach(_file ${_configure_files}) + verbose_include(${_file}) +endforeach() # # Finalize the configuration: # -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_cpack.cmake) -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_custom_targets.cmake) -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_finalize.cmake) -VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_write_config.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_cpack.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_custom_targets.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_finalize.cmake) +verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_write_config.cmake) ######################################################################## # # @@ -144,34 +144,34 @@ VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_write_config.cmake) # # ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Configuring done. Proceed to target definitions now.") +message(STATUS "") +message(STATUS "Configuring done. Proceed to target definitions now.") -ADD_SUBDIRECTORY(cmake/scripts) -ADD_SUBDIRECTORY(include) +add_subdirectory(cmake/scripts) +add_subdirectory(include) -IF(DEAL_II_HAVE_DOC_DIRECTORY) - ADD_SUBDIRECTORY(doc) # has to be included after include -ENDIF() +if(DEAL_II_HAVE_DOC_DIRECTORY) + add_subdirectory(doc) # has to be included after include +endif() -IF(DEAL_II_HAVE_BUNDLED_DIRECTORY) - ADD_SUBDIRECTORY(bundled) -ENDIF() -ADD_SUBDIRECTORY(source) # has to be included after bundled +if(DEAL_II_HAVE_BUNDLED_DIRECTORY) + add_subdirectory(bundled) +endif() +add_subdirectory(source) # has to be included after bundled -ADD_SUBDIRECTORY(cmake/config) # has to be included after source -ADD_SUBDIRECTORY(examples) +add_subdirectory(cmake/config) # has to be included after source +add_subdirectory(examples) -ADD_SUBDIRECTORY(contrib/utilities) +add_subdirectory(contrib/utilities) -IF(DEAL_II_HAVE_TESTS_DIRECTORY) - ADD_SUBDIRECTORY(tests) -ENDIF() +if(DEAL_II_HAVE_TESTS_DIRECTORY) + add_subdirectory(tests) +endif() -ADD_SUBDIRECTORY(contrib/python-bindings) # has to be included after tests +add_subdirectory(contrib/python-bindings) # has to be included after tests # # And finally, print the configuration: # -FILE(READ ${CMAKE_BINARY_DIR}/summary.log DEAL_II_LOG_SUMMARY) -MESSAGE("${DEAL_II_LOG_SUMMARY}") +file(READ ${CMAKE_BINARY_DIR}/summary.log DEAL_II_LOG_SUMMARY) +message("${DEAL_II_LOG_SUMMARY}") diff --git a/CTestConfig.cmake b/CTestConfig.cmake index a38fe986ee..a96550c271 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -17,39 +17,39 @@ # Dashboard configuration: # -SET(CTEST_PROJECT_NAME "deal.II") +set(CTEST_PROJECT_NAME "deal.II") -SET(CTEST_DROP_METHOD "https") -SET(CTEST_DROP_SITE "cdash.dealii.org") -SET(CTEST_DROP_LOCATION "/submit.php?project=deal.II") -SET(CTEST_DROP_SITE_CDASH TRUE) +set(CTEST_DROP_METHOD "https") +set(CTEST_DROP_SITE "cdash.dealii.org") +set(CTEST_DROP_LOCATION "/submit.php?project=deal.II") +set(CTEST_DROP_SITE_CDASH TRUE) # # We use the CTEST_UPDATE routine to query information about the repository # but we don't want to actually perform an update. Thus, replace the update # by a noop: # -SET(CTEST_GIT_COMMAND "git") -SET(CTEST_UPDATE_VERSION_ONLY true) +set(CTEST_GIT_COMMAND "git") +set(CTEST_UPDATE_VERSION_ONLY true) -SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 100) -SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300) +set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 100) +set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300) # number of lines to submit before an error: -SET(CTEST_CUSTOM_ERROR_PRE_CONTEXT 5) +set(CTEST_CUSTOM_ERROR_PRE_CONTEXT 5) # number of lines to submit after an error: -SET(CTEST_CUSTOM_ERROR_POST_CONTEXT 20) +set(CTEST_CUSTOM_ERROR_POST_CONTEXT 20) # # Coverage options: # -SET(CTEST_EXTRA_COVERAGE_GLOB +set(CTEST_EXTRA_COVERAGE_GLOB # These files should have executable lines and therefore coverage: # source/**/*.cc ) -SET(CTEST_CUSTOM_COVERAGE_EXCLUDE +set(CTEST_CUSTOM_COVERAGE_EXCLUDE "/bundled" "/cmake/scripts/" "/contrib" diff --git a/bundled/CMakeLists.txt b/bundled/CMakeLists.txt index a1e00489ce..00b96cff67 100644 --- a/bundled/CMakeLists.txt +++ b/bundled/CMakeLists.txt @@ -17,73 +17,73 @@ # Compile and install enabled bundled features: # -MESSAGE(STATUS "Setting up bundled features") +message(STATUS "Setting up bundled features") -IF(FEATURE_BOOST_BUNDLED_CONFIGURED) - INSTALL(DIRECTORY ${BOOST_FOLDER}/include/boost +if(FEATURE_BOOST_BUNDLED_CONFIGURED) + install(DIRECTORY ${BOOST_FOLDER}/include/boost DESTINATION ${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled COMPONENT library ) - ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/serialization/src) - ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/system/src) + add_subdirectory(${BOOST_FOLDER}/libs/serialization/src) + add_subdirectory(${BOOST_FOLDER}/libs/system/src) - IF(DEAL_II_WITH_ZLIB) - ADD_SUBDIRECTORY(${BOOST_FOLDER}/libs/iostreams/src) - ELSE() - MESSAGE(STATUS "BOOST::Iostreams will not be available because zlib or its header files could not be found") - ENDIF() -ENDIF() + if(DEAL_II_WITH_ZLIB) + add_subdirectory(${BOOST_FOLDER}/libs/iostreams/src) + else() + message(STATUS "BOOST::Iostreams will not be available because zlib or its header files could not be found") + endif() +endif() -IF(FEATURE_KOKKOS_BUNDLED_CONFIGURED) - ADD_SUBDIRECTORY(${KOKKOS_FOLDER}) +if(FEATURE_KOKKOS_BUNDLED_CONFIGURED) + add_subdirectory(${KOKKOS_FOLDER}) - INSTALL(DIRECTORY ${KOKKOS_BUNDLED_INCLUDE_DIRS} + install(DIRECTORY ${KOKKOS_BUNDLED_INCLUDE_DIRS} DESTINATION ${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled COMPONENT library ) -ENDIF() +endif() -IF(FEATURE_TASKFLOW_BUNDLED_CONFIGURED) - INSTALL(DIRECTORY ${TASKFLOW_FOLDER}/include/taskflow +if(FEATURE_TASKFLOW_BUNDLED_CONFIGURED) + install(DIRECTORY ${TASKFLOW_FOLDER}/include/taskflow DESTINATION ${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled COMPONENT library ) -ENDIF() +endif() -IF(FEATURE_TBB_BUNDLED_CONFIGURED) - INSTALL(DIRECTORY ${TBB_FOLDER}/include/tbb +if(FEATURE_TBB_BUNDLED_CONFIGURED) + install(DIRECTORY ${TBB_FOLDER}/include/tbb DESTINATION ${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled COMPONENT library FILES_MATCHING PATTERN "*.h" ) - ADD_SUBDIRECTORY(${TBB_FOLDER}/src) -ENDIF() + add_subdirectory(${TBB_FOLDER}/src) +endif() -IF(FEATURE_UMFPACK_BUNDLED_CONFIGURED) - ADD_SUBDIRECTORY(${UMFPACK_FOLDER}/UMFPACK/Source) - ADD_SUBDIRECTORY(${UMFPACK_FOLDER}/AMD/Source) +if(FEATURE_UMFPACK_BUNDLED_CONFIGURED) + add_subdirectory(${UMFPACK_FOLDER}/UMFPACK/Source) + add_subdirectory(${UMFPACK_FOLDER}/AMD/Source) - INSTALL(DIRECTORY + install(DIRECTORY ${UMFPACK_FOLDER}/UMFPACK/Include/ ${UMFPACK_FOLDER}/AMD/Include/ DESTINATION ${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled COMPONENT library FILES_MATCHING PATTERN "*.h" ) -ENDIF() +endif() -IF(FEATURE_MUPARSER_BUNDLED_CONFIGURED) - ADD_SUBDIRECTORY(${MUPARSER_FOLDER}) -ENDIF() +if(FEATURE_MUPARSER_BUNDLED_CONFIGURED) + add_subdirectory(${MUPARSER_FOLDER}) +endif() -MESSAGE(STATUS "Setting up bundled features - Done") +message(STATUS "Setting up bundled features - Done") diff --git a/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt b/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt index 1d3adeed63..b5850d4e7b 100644 --- a/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt +++ b/bundled/boost-1.70.0/libs/iostreams/src/CMakeLists.txt @@ -14,19 +14,19 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES( +include_directories( ${BOOST_BUNDLED_INCLUDE_DIRS} ${DEAL_II_INCLUDE_DIRS} ) -SET(src_boost_iostreams +set(src_boost_iostreams file_descriptor.cpp gzip.cpp mapped_file.cpp zlib.cpp ) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-deprecated-copy) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-c11-extensions) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-deprecated-copy) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-c11-extensions) -DEAL_II_ADD_LIBRARY(obj_boost_iostreams OBJECT ${src_boost_iostreams}) +deal_ii_add_library(obj_boost_iostreams OBJECT ${src_boost_iostreams}) diff --git a/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt b/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt index e987a0f76b..b43910b331 100644 --- a/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt +++ b/bundled/boost-1.70.0/libs/serialization/src/CMakeLists.txt @@ -14,12 +14,12 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES( +include_directories( ${BOOST_BUNDLED_INCLUDE_DIRS} ${DEAL_II_INCLUDE_DIRS} ) -SET(src_boost_serialization +set(src_boost_serialization archive_exception.cpp basic_archive.cpp basic_iarchive.cpp @@ -59,7 +59,7 @@ SET(src_boost_serialization xml_wiarchive.cpp xml_woarchive.cpp ) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-deprecated-copy) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-c11-extensions) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-deprecated-copy) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-c11-extensions) -DEAL_II_ADD_LIBRARY(obj_boost_serialization OBJECT ${src_boost_serialization}) +deal_ii_add_library(obj_boost_serialization OBJECT ${src_boost_serialization}) diff --git a/bundled/boost-1.70.0/libs/system/src/CMakeLists.txt b/bundled/boost-1.70.0/libs/system/src/CMakeLists.txt index 90ba0444ff..02f08a432d 100644 --- a/bundled/boost-1.70.0/libs/system/src/CMakeLists.txt +++ b/bundled/boost-1.70.0/libs/system/src/CMakeLists.txt @@ -14,14 +14,14 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES( +include_directories( ${BOOST_BUNDLED_INCLUDE_DIRS} ${DEAL_II_INCLUDE_DIRS} ) -SET(src_boost_system +set(src_boost_system error_code.cpp ) -DEAL_II_ADD_LIBRARY(obj_boost_system OBJECT ${src_boost_system}) +deal_ii_add_library(obj_boost_system OBJECT ${src_boost_system}) diff --git a/bundled/boost-1.70.0/libs/thread/src/CMakeLists.txt b/bundled/boost-1.70.0/libs/thread/src/CMakeLists.txt index f81d1bcd4a..40d6bc2830 100644 --- a/bundled/boost-1.70.0/libs/thread/src/CMakeLists.txt +++ b/bundled/boost-1.70.0/libs/thread/src/CMakeLists.txt @@ -14,32 +14,32 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES( +include_directories( ${BOOST_BUNDLED_INCLUDE_DIRS} ${DEAL_II_INCLUDE_DIRS} ) -IF(DEAL_II_USE_MT_POSIX) - SET(src_boost_thread +if(DEAL_II_USE_MT_POSIX) + set(src_boost_thread pthread/once.cpp pthread/thread.cpp ) -ELSE() - SET(src_boost_thread +else() + set(src_boost_thread win32/thread.cpp win32/tss_dll.cpp win32/tss_pe.cpp ) -ENDIF() +endif() -DEAL_II_ADD_LIBRARY(obj_boost_thread OBJECT ${src_boost_thread}) -DEAL_II_ADD_DEFINITIONS(obj_boost_thread +deal_ii_add_library(obj_boost_thread OBJECT ${src_boost_thread}) +deal_ii_add_definitions(obj_boost_thread "BOOST_THREAD_BUILD_LIB" "BOOST_ALL_NO_LIB" ) -IF(CMAKE_SYSTEM_NAME MATCHES "Windows") - DEAL_II_ADD_DEFINITIONS(obj_boost_thread "BOOST_HAS_WINTHREADS") -ELSE() - DEAL_II_ADD_DEFINITIONS(obj_boost_thread "BOOST_THREAD_POSIX") -ENDIF() +if(CMAKE_SYSTEM_NAME MATCHES "Windows") + deal_ii_add_definitions(obj_boost_thread "BOOST_HAS_WINTHREADS") +else() + deal_ii_add_definitions(obj_boost_thread "BOOST_THREAD_POSIX") +endif() diff --git a/bundled/kokkos-3.7.00/CMakeLists.txt b/bundled/kokkos-3.7.00/CMakeLists.txt index f0556a90f3..19d5c80c49 100644 --- a/bundled/kokkos-3.7.00/CMakeLists.txt +++ b/bundled/kokkos-3.7.00/CMakeLists.txt @@ -13,7 +13,7 @@ ## ## --------------------------------------------------------------------- -SET(src_kokkos +set(src_kokkos #tpls/desul/src/Lock_Array_CUDA.cpp #tpls/desul/src/Lock_Array_HIP.cpp core/src/impl/Kokkos_Profiling.cpp @@ -63,11 +63,11 @@ SET(src_kokkos simd/src/Kokkos_SIMD_dummy.cpp containers/src/impl/Kokkos_UnorderedMap_impl.cpp ) -INCLUDE_DIRECTORIES(${KOKKOS_BUNDLED_INCLUDE_DIRS}) +include_directories(${KOKKOS_BUNDLED_INCLUDE_DIRS}) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-float-conversion) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-missing-field-initializers) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-suggest-override) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-unused-but-set-parameter) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-float-conversion) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-missing-field-initializers) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-suggest-override) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-unused-but-set-parameter) -DEAL_II_ADD_LIBRARY(obj_kokkos OBJECT ${src_kokkos}) +deal_ii_add_library(obj_kokkos OBJECT ${src_kokkos}) diff --git a/bundled/muparser_v2_3_3/CMakeLists.txt b/bundled/muparser_v2_3_3/CMakeLists.txt index a1a7e0f734..7aca3bc9cb 100644 --- a/bundled/muparser_v2_3_3/CMakeLists.txt +++ b/bundled/muparser_v2_3_3/CMakeLists.txt @@ -16,19 +16,19 @@ # # avoid some annoying warnings... # -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wall") -STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-switch) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-nested-anon-types) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-implicit-fallthrough) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-cast-function-type) -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-float-conversion) +strip_flag(DEAL_II_CXX_FLAGS "-Wall") +strip_flag(DEAL_II_CXX_FLAGS "-pedantic") +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-switch) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-nested-anon-types) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-implicit-fallthrough) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-cast-function-type) +enable_if_supported(DEAL_II_CXX_FLAGS -Wno-float-conversion) -INCLUDE_DIRECTORIES( +include_directories( include/ ) -DEAL_II_ADD_LIBRARY(obj_muparser OBJECT +deal_ii_add_library(obj_muparser OBJECT src/muParserBase.cpp src/muParserBytecode.cpp src/muParserCallback.cpp diff --git a/bundled/setup_bundled.cmake b/bundled/setup_bundled.cmake index ef62d1ae82..a7227eb8d9 100644 --- a/bundled/setup_bundled.cmake +++ b/bundled/setup_bundled.cmake @@ -22,77 +22,77 @@ # Boost C++ libraries # -SET(FEATURE_BOOST_HAVE_BUNDLED TRUE) +set(FEATURE_BOOST_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_BOOST +option(DEAL_II_FORCE_BUNDLED_BOOST "Always use the bundled boost library instead of an external one." OFF) -SET(BOOST_FOLDER "${CMAKE_SOURCE_DIR}/bundled/boost-1.70.0") +set(BOOST_FOLDER "${CMAKE_SOURCE_DIR}/bundled/boost-1.70.0") # # Kokkos # -SET(FEATURE_KOKKOS_HAVE_BUNDLED TRUE) +set(FEATURE_KOKKOS_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_KOKKOS +option(DEAL_II_FORCE_BUNDLED_KOKKOS "Always use the bundled Kokkos library instead of an external one." OFF) -SET(KOKKOS_FOLDER "${CMAKE_SOURCE_DIR}/bundled/kokkos-3.7.00") +set(KOKKOS_FOLDER "${CMAKE_SOURCE_DIR}/bundled/kokkos-3.7.00") # # Taskflow # -SET(FEATURE_TASKFLOW_HAVE_BUNDLED TRUE) +set(FEATURE_TASKFLOW_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_TASKFLOW +option(DEAL_II_FORCE_BUNDLED_TASKFLOW "Always use the bundled taskflow header library instead of an external one." OFF) -SET(TASKFLOW_FOLDER "${CMAKE_SOURCE_DIR}/bundled/taskflow-2.5.0") +set(TASKFLOW_FOLDER "${CMAKE_SOURCE_DIR}/bundled/taskflow-2.5.0") # # Threading Building Blocks library # -IF( NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN" +if( NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN" AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) # # Cygwin is unsupported by tbb, Windows due to the way we compile tbb... # - SET(FEATURE_TBB_HAVE_BUNDLED TRUE) + set(FEATURE_TBB_HAVE_BUNDLED TRUE) - OPTION(DEAL_II_FORCE_BUNDLED_TBB + option(DEAL_II_FORCE_BUNDLED_TBB "Always use the bundled tbb library instead of an external one." OFF) - SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb-2018_U2") -ENDIF() + set(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb-2018_U2") +endif() # # UMFPACK, AMD and UFCONFIG: # -SET(FEATURE_UMFPACK_HAVE_BUNDLED TRUE) +set(FEATURE_UMFPACK_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_UMFPACK +option(DEAL_II_FORCE_BUNDLED_UMFPACK "Always use the bundled umfpack library instead of an external one." OFF) -SET(UMFPACK_FOLDER "${CMAKE_SOURCE_DIR}/bundled/umfpack") +set(UMFPACK_FOLDER "${CMAKE_SOURCE_DIR}/bundled/umfpack") # # muparser # -SET(FEATURE_MUPARSER_HAVE_BUNDLED TRUE) +set(FEATURE_MUPARSER_HAVE_BUNDLED TRUE) -OPTION(DEAL_II_FORCE_BUNDLED_MUPARSER +option(DEAL_II_FORCE_BUNDLED_MUPARSER "Always use the bundled functionparser library instead of an external one." OFF) -SET(MUPARSER_FOLDER "${CMAKE_SOURCE_DIR}/bundled/muparser_v2_3_3/") +set(MUPARSER_FOLDER "${CMAKE_SOURCE_DIR}/bundled/muparser_v2_3_3/") diff --git a/bundled/tbb-2018_U2/src/CMakeLists.txt b/bundled/tbb-2018_U2/src/CMakeLists.txt index 4129306816..91ced155b0 100644 --- a/bundled/tbb-2018_U2/src/CMakeLists.txt +++ b/bundled/tbb-2018_U2/src/CMakeLists.txt @@ -17,8 +17,8 @@ # Remove -Wall and -pedantic from DEAL_II_CXX_FLAGS (in directory scope) to # avoid some annoying warnings... # -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wall") -STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") +strip_flag(DEAL_II_CXX_FLAGS "-Wall") +strip_flag(DEAL_II_CXX_FLAGS "-pedantic") # # As discussed in @@ -31,31 +31,31 @@ STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") # this approach. Hence, if supported, disable this particular optimization. The # original TBB makefile specifies this flag for recent versions of GCC. # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-flifetime-dse=1") +enable_if_supported(DEAL_II_CXX_FLAGS "-flifetime-dse=1") # # Disable other warnings: # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wimplicit-fallthrough=0") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wstringop-overflow=0") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-deprecated-copy") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wtautological-overlap-compare=0") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wimplicit-fallthrough=0") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wstringop-overflow=0") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-deprecated-copy") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wtautological-overlap-compare=0") -SET(CMAKE_INCLUDE_CURRENT_DIR TRUE) -INCLUDE_DIRECTORIES( +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) +include_directories( ${TBB_BUNDLED_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/rml/include ) -IF(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/version_string.ver") - FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/version_string.ver" +if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/version_string.ver") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/version_string.ver" "#define __TBB_VERSION_STRINGS(N) \"Custom\"\n" ) -ENDIF() +endif() -SET(src_tbb +set(src_tbb rml/client/rml_tbb.cpp tbb/arena.cpp tbb/cache_aligned_allocator.cpp @@ -90,14 +90,14 @@ SET(src_tbb tbb/tbb_thread.cpp tbb/x86_rtm_rw_mutex.cpp ) -DEAL_II_ADD_LIBRARY(obj_tbb OBJECT ${src_tbb}) +deal_ii_add_library(obj_tbb OBJECT ${src_tbb}) # # Add necessary definitions: # -DEAL_II_ADD_DEFINITIONS(obj_tbb "__TBB_BUILD=1") -DEAL_II_ADD_DEFINITIONS(obj_tbb "USE_PTHREAD") -IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") - DEAL_II_ADD_DEFINITIONS(obj_tbb "DO_ITT_NOTIFY") -ENDIF() +deal_ii_add_definitions(obj_tbb "__TBB_BUILD=1") +deal_ii_add_definitions(obj_tbb "USE_PTHREAD") +if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") + deal_ii_add_definitions(obj_tbb "DO_ITT_NOTIFY") +endif() diff --git a/bundled/umfpack/AMD/Source/CMakeLists.txt b/bundled/umfpack/AMD/Source/CMakeLists.txt index f09fe04e81..f1bf0293c9 100644 --- a/bundled/umfpack/AMD/Source/CMakeLists.txt +++ b/bundled/umfpack/AMD/Source/CMakeLists.txt @@ -13,11 +13,11 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(${UMFPACK_BUNDLED_INCLUDE_DIRS}) +include_directories(${UMFPACK_BUNDLED_INCLUDE_DIRS}) -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wfloat-conversion") +strip_flag(DEAL_II_CXX_FLAGS "-Wfloat-conversion") -SET(src_amd +set(src_amd amd_1.cc amd_2.cc amd_aat.cc @@ -32,11 +32,11 @@ SET(src_amd amd_valid.cc ) -DEAL_II_ADD_LIBRARY(obj_amd_int OBJECT ${src_amd}) -DEAL_II_ADD_DEFINITIONS(obj_amd_int "DINT") +deal_ii_add_library(obj_amd_int OBJECT ${src_amd}) +deal_ii_add_definitions(obj_amd_int "DINT") -DEAL_II_ADD_LIBRARY(obj_amd_long OBJECT ${src_amd}) -DEAL_II_ADD_DEFINITIONS(obj_amd_long "DLONG") +deal_ii_add_library(obj_amd_long OBJECT ${src_amd}) +deal_ii_add_definitions(obj_amd_long "DLONG") -DEAL_II_ADD_LIBRARY(obj_amd_global OBJECT "amd_global.cc") +deal_ii_add_library(obj_amd_global OBJECT "amd_global.cc") diff --git a/bundled/umfpack/UMFPACK/Source/CMakeLists.txt b/bundled/umfpack/UMFPACK/Source/CMakeLists.txt index b993c422ae..1929a68b02 100644 --- a/bundled/umfpack/UMFPACK/Source/CMakeLists.txt +++ b/bundled/umfpack/UMFPACK/Source/CMakeLists.txt @@ -281,17 +281,17 @@ # .................................................. # -INCLUDE_DIRECTORIES(${UMFPACK_BUNDLED_INCLUDE_DIRS}) +include_directories(${UMFPACK_BUNDLED_INCLUDE_DIRS}) # # *Shush!* # (Remove locally in this subdirectory) # -STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic") -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wall") -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wfloat-conversion") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-sign-compare") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-write-strings") +strip_flag(DEAL_II_CXX_FLAGS "-pedantic") +strip_flag(DEAL_II_CXX_FLAGS "-Wall") +strip_flag(DEAL_II_CXX_FLAGS "-Wfloat-conversion") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-sign-compare") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-write-strings") # @@ -309,7 +309,7 @@ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-write-strings") # # Start by definining which files these collections include. # -SET(src_umfpack_DL_AND_ZL +set(src_umfpack_DL_AND_ZL # Files that originate in $(UMF), which is really just $(UMFCH) for our # purposes: umf_assemble.cc umf_blas3_update.cc umf_build_tuples.cc umf_create_element.cc @@ -337,13 +337,13 @@ SET(src_umfpack_DL_AND_ZL umfpack_load_symbolic.cc umfpack_save_symbolic.cc ) -SET(src_umfpack_LL +set(src_umfpack_LL umf_analyze.cc umf_apply_order.cc umf_colamd.cc umf_free.cc umf_fsize.cc umf_is_permutation.cc umf_malloc.cc umf_realloc.cc umf_report_perm.cc umf_singletons.cc ) -SET(src_umfpack_GENERIC +set(src_umfpack_GENERIC umfpack_global.cc umfpack_tictoc.cc umfpack_timer.cc @@ -357,17 +357,17 @@ SET(src_umfpack_GENERIC #------------------------------------------------------------------------------- # Do what the GNUmakefile calls the DI targets: -DEAL_II_ADD_LIBRARY(obj_umfpack_L_UMF OBJECT ${src_umfpack_DL_AND_ZL}) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_L_UMF "DLONG") +deal_ii_add_library(obj_umfpack_L_UMF OBJECT ${src_umfpack_DL_AND_ZL}) +deal_ii_add_definitions(obj_umfpack_L_UMF "DLONG") # Repeat these steps for complex-valued matrices. This corresponds to # the ZL targets: -DEAL_II_ADD_LIBRARY(obj_umfpack_Z_UMF OBJECT ${src_umfpack_DL_AND_ZL}) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_Z_UMF "ZLONG") +deal_ii_add_library(obj_umfpack_Z_UMF OBJECT ${src_umfpack_DL_AND_ZL}) +deal_ii_add_definitions(obj_umfpack_Z_UMF "ZLONG") # Do what the GNUmakefile calls the LL targets: -DEAL_II_ADD_LIBRARY(obj_umfpack_L_UMFPACK OBJECT ${src_umfpack_LL}) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_L_UMFPACK "DLONG") +deal_ii_add_library(obj_umfpack_L_UMFPACK OBJECT ${src_umfpack_LL}) +deal_ii_add_definitions(obj_umfpack_L_UMFPACK "DLONG") #------------------------------------------------------------------------------- @@ -375,58 +375,58 @@ DEAL_II_ADD_DEFINITIONS(obj_umfpack_L_UMFPACK "DLONG") # version. #------------------------------------------------------------------------------- -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_TSOLVE OBJECT umf_ltsolve.cc umf_utsolve.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TSOLVE "DLONG" "CONJUGATE_SOLVE") +deal_ii_add_library(obj_umfpack_DL_TSOLVE OBJECT umf_ltsolve.cc umf_utsolve.cc) +deal_ii_add_definitions(obj_umfpack_DL_TSOLVE "DLONG" "CONJUGATE_SOLVE") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_NOX OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_MAP_NOX "DLONG" "DO_MAP") +deal_ii_add_library(obj_umfpack_DL_TRIPLET_MAP_NOX OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_DL_TRIPLET_MAP_NOX "DLONG" "DO_MAP") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_X OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_MAP_X "DLONG" "DO_MAP" "DO_VALUES") +deal_ii_add_library(obj_umfpack_DL_TRIPLET_MAP_X OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_DL_TRIPLET_MAP_X "DLONG" "DO_MAP" "DO_VALUES") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_TRIPLET_NOMAP_X OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_NOMAP_X "DLONG" "DO_VALUES") +deal_ii_add_library(obj_umfpack_DL_TRIPLET_NOMAP_X OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_DL_TRIPLET_NOMAP_X "DLONG" "DO_VALUES") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_TRIPLET_NOMAP_NOX OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_TRIPLET_NOMAP_NOX "DLONG") +deal_ii_add_library(obj_umfpack_DL_TRIPLET_NOMAP_NOX OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_DL_TRIPLET_NOMAP_NOX "DLONG") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_STORE OBJECT umf_store_lu.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_STORE "DLONG" "DROP") +deal_ii_add_library(obj_umfpack_DL_STORE OBJECT umf_store_lu.cc) +deal_ii_add_definitions(obj_umfpack_DL_STORE "DLONG" "DROP") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_ASSEMBLE OBJECT umf_assemble.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_ASSEMBLE "DLONG" "FIXQ") +deal_ii_add_library(obj_umfpack_DL_ASSEMBLE OBJECT umf_assemble.cc) +deal_ii_add_definitions(obj_umfpack_DL_ASSEMBLE "DLONG" "FIXQ") -DEAL_II_ADD_LIBRARY(obj_umfpack_DL_SOLVE OBJECT umfpack_solve.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_DL_SOLVE "DLONG" "WSOLVE") +deal_ii_add_library(obj_umfpack_DL_SOLVE OBJECT umfpack_solve.cc) +deal_ii_add_definitions(obj_umfpack_DL_SOLVE "DLONG" "WSOLVE") # Again with complex arguments: -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_TSOLVE OBJECT umf_ltsolve.cc umf_utsolve.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_TSOLVE "ZLONG" "CONJUGATE_SOLVE") +deal_ii_add_library(obj_umfpack_ZL_TSOLVE OBJECT umf_ltsolve.cc umf_utsolve.cc) +deal_ii_add_definitions(obj_umfpack_ZL_TSOLVE "ZLONG" "CONJUGATE_SOLVE") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_TRIPLET_MAP_NOX OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_TRIPLET_MAP_NOX "ZLONG" "DO_MAP") +deal_ii_add_library(obj_umfpack_ZL_TRIPLET_MAP_NOX OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_ZL_TRIPLET_MAP_NOX "ZLONG" "DO_MAP") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_TRIPLET_MAP_X OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_TRIPLET_MAP_X "ZLONG" "DO_MAP" "DO_VALUES") +deal_ii_add_library(obj_umfpack_ZL_TRIPLET_MAP_X OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_ZL_TRIPLET_MAP_X "ZLONG" "DO_MAP" "DO_VALUES") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_TRIPLET_NOMAP_X OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_TRIPLET_NOMAP_X "ZLONG" "DO_VALUES") +deal_ii_add_library(obj_umfpack_ZL_TRIPLET_NOMAP_X OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_ZL_TRIPLET_NOMAP_X "ZLONG" "DO_VALUES") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_TRIPLET_NOMAP_NOX OBJECT umf_triplet.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_TRIPLET_NOMAP_NOX "ZLONG") +deal_ii_add_library(obj_umfpack_ZL_TRIPLET_NOMAP_NOX OBJECT umf_triplet.cc) +deal_ii_add_definitions(obj_umfpack_ZL_TRIPLET_NOMAP_NOX "ZLONG") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_STORE OBJECT umf_store_lu.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_STORE "ZLONG" "DROP") +deal_ii_add_library(obj_umfpack_ZL_STORE OBJECT umf_store_lu.cc) +deal_ii_add_definitions(obj_umfpack_ZL_STORE "ZLONG" "DROP") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_ASSEMBLE OBJECT umf_assemble.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_ASSEMBLE "ZLONG" "FIXQ") +deal_ii_add_library(obj_umfpack_ZL_ASSEMBLE OBJECT umf_assemble.cc) +deal_ii_add_definitions(obj_umfpack_ZL_ASSEMBLE "ZLONG" "FIXQ") -DEAL_II_ADD_LIBRARY(obj_umfpack_ZL_SOLVE OBJECT umfpack_solve.cc) -DEAL_II_ADD_DEFINITIONS(obj_umfpack_ZL_SOLVE "ZLONG" "WSOLVE") +deal_ii_add_library(obj_umfpack_ZL_SOLVE OBJECT umfpack_solve.cc) +deal_ii_add_definitions(obj_umfpack_ZL_SOLVE "ZLONG" "WSOLVE") #------------------------------------------------------------------------------- # Create the generic routines (GN) using a generic rule #------------------------------------------------------------------------------- -DEAL_II_ADD_LIBRARY(obj_umfpack_GENERIC OBJECT ${src_umfpack_GENERIC}) +deal_ii_add_library(obj_umfpack_GENERIC OBJECT ${src_umfpack_GENERIC}) diff --git a/cmake/checks/check_01_cpu_features.cmake b/cmake/checks/check_01_cpu_features.cmake index 182d946971..53a45c38d1 100644 --- a/cmake/checks/check_01_cpu_features.cmake +++ b/cmake/checks/check_01_cpu_features.cmake @@ -42,18 +42,18 @@ # # Determine the Endianness of the platform: # -IF(CMAKE_C_COMPILER_WORKS) - INCLUDE(TestBigEndian) +if(CMAKE_C_COMPILER_WORKS) + include(TestBigEndian) - CLEAR_CMAKE_REQUIRED() + clear_cmake_required() TEST_BIG_ENDIAN(DEAL_II_WORDS_BIGENDIAN) - RESET_CMAKE_REQUIRED() -ELSE() - MESSAGE(STATUS + reset_cmake_required() +else() + message(STATUS "No suitable C compiler was found! Assuming little endian platform." ) - SET(DEAL_II_WORDS_BIGENDIAN "0") -ENDIF() + set(DEAL_II_WORDS_BIGENDIAN "0") +endif() # @@ -67,12 +67,12 @@ ENDIF() # - Matthias Maier, rewritten 2012 # -IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) +if(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) # # Take care that the following tests are rerun if the # CMAKE_REQUIRED_FLAGS changes.. # - UNSET_IF_CHANGED(CHECK_CPU_FEATURES_FLAGS_SAVED "${CMAKE_REQUIRED_FLAGS}" + unset_if_changed(CHECK_CPU_FEATURES_FLAGS_SAVED "${CMAKE_REQUIRED_FLAGS}" DEAL_II_HAVE_SSE2 DEAL_II_HAVE_AVX DEAL_II_HAVE_AVX512 DEAL_II_HAVE_ALTIVEC ) @@ -254,21 +254,21 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) # # Choosing the right compiler flag is a bit of a mess: # - IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "15" ) - SET(_keyword "qopenmp") - ELSEIF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "14" ) - SET(_keyword "openmp") - ENDIF() - ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - SET(_keyword "openmp") - ELSE() - SET(_keyword "fopenmp") - ENDIF() + if(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "15" ) + set(_keyword "qopenmp") + elseif("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "14" ) + set(_keyword "openmp") + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(_keyword "openmp") + else() + set(_keyword "fopenmp") + endif() CHECK_CXX_COMPILER_FLAG("-${_keyword}-simd" DEAL_II_HAVE_OPENMP_SIMD) -ENDIF() # IF DEAL_II_ALLOW_PLATFORM_INTROSPECTION +endif() # IF DEAL_II_ALLOW_PLATFORM_INTROSPECTION # @@ -276,19 +276,19 @@ ENDIF() # IF DEAL_II_ALLOW_PLATFORM_INTROSPECTION # (that was autodetected or manually specified). # -IF(DEAL_II_HAVE_AVX512) - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 512) -ELSEIF(DEAL_II_HAVE_AVX) - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 256) -ELSEIF(DEAL_II_HAVE_SSE2) - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128) -ELSE() - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) -ENDIF() +if(DEAL_II_HAVE_AVX512) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 512) +elseif(DEAL_II_HAVE_AVX) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 256) +elseif(DEAL_II_HAVE_SSE2) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128) +else() + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) +endif() -IF(DEAL_II_HAVE_ALTIVEC) - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128) -ENDIF() +if(DEAL_II_HAVE_ALTIVEC) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128) +endif() # # We need to disable SIMD vectorization for CUDA device code. @@ -296,21 +296,21 @@ ENDIF() # "[...] contains a vector, which is not supported in device code" # -IF(DEAL_II_WITH_CUDA) - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) -ENDIF() +if(DEAL_II_WITH_CUDA) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) +endif() # # If we have OpenMP SIMD support (i.e. DEAL_II_HAVE_OPENMP_SIMD is true) # populate DEAL_II_OPENMP_SIMD_PRAGMA. # -SET(DEAL_II_OPENMP_SIMD_PRAGMA " ") -IF(DEAL_II_HAVE_OPENMP_SIMD) - ADD_FLAGS(DEAL_II_CXX_FLAGS "-${_keyword}-simd") +set(DEAL_II_OPENMP_SIMD_PRAGMA " ") +if(DEAL_II_HAVE_OPENMP_SIMD) + add_flags(DEAL_II_CXX_FLAGS "-${_keyword}-simd") # Intel is special: - IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - ADD_FLAGS(DEAL_II_LINKER_FLAGS "-${_keyword}") - ENDIF() - SET(DEAL_II_OPENMP_SIMD_PRAGMA "_Pragma(\"omp simd\")") -ENDIF() + if(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_flags(DEAL_II_LINKER_FLAGS "-${_keyword}") + endif() + set(DEAL_II_OPENMP_SIMD_PRAGMA "_Pragma(\"omp simd\")") +endif() diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 4f7556d040..e697484a97 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -44,20 +44,20 @@ # We need compiler flags specified in ${DEAL_II_CXX_FLAGS} for all the # tests. Create a small macro to easily set CMAKE_REQUIRED_FLAGS # -MACRO(_set_up_cmake_required) - RESET_CMAKE_REQUIRED() - SET(CMAKE_REQUIRED_FLAGS "") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS_SAVED}") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS}") -ENDMACRO() +macro(_set_up_cmake_required) + reset_cmake_required() + set(CMAKE_REQUIRED_FLAGS "") + add_flags(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS_SAVED}") + add_flags(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS}") +endmacro() # # Wrap the following checks into a macro to make it easier to rerun them. # -MACRO(_test_cxx20_support) +macro(_test_cxx20_support) - UNSET_IF_CHANGED(CHECK_CXX20_FEATURES_FLAGS_SAVED + unset_if_changed(CHECK_CXX20_FEATURES_FLAGS_SAVED "${CMAKE_REQUIRED_FLAGS}" DEAL_II_HAVE_CXX20_FEATURES ) @@ -85,22 +85,22 @@ MACRO(_test_cxx20_support) " DEAL_II_HAVE_CXX20_FEATURES) - IF(DEAL_II_HAVE_CXX20_FEATURES) - MESSAGE(STATUS "C++20 support is enabled.") - SET(DEAL_II_HAVE_CXX20 TRUE) - ELSE() - MESSAGE(STATUS "C++20 support is disabled.") - SET(DEAL_II_HAVE_CXX20 FALSE) - ENDIF() -ENDMACRO() + if(DEAL_II_HAVE_CXX20_FEATURES) + message(STATUS "C++20 support is enabled.") + set(DEAL_II_HAVE_CXX20 TRUE) + else() + message(STATUS "C++20 support is disabled.") + set(DEAL_II_HAVE_CXX20 FALSE) + endif() +endmacro() # # Wrap the following checks into a macro to make it easier to rerun them. # -MACRO(_test_cxx17_support) +macro(_test_cxx17_support) - UNSET_IF_CHANGED(CHECK_CXX17_FEATURES_FLAGS_SAVED + unset_if_changed(CHECK_CXX17_FEATURES_FLAGS_SAVED "${CMAKE_REQUIRED_FLAGS}" DEAL_II_HAVE_CXX17_FEATURES DEAL_II_HAVE_CXX17_CONSTEXPR_LAMBDA_BUG_OK @@ -174,22 +174,22 @@ MACRO(_test_cxx17_support) " DEAL_II_HAVE_CXX17_CONSTEXPR_LAMBDA_BUG_OK) - IF(DEAL_II_HAVE_CXX17_FEATURES AND + if(DEAL_II_HAVE_CXX17_FEATURES AND DEAL_II_HAVE_CXX17_CONSTEXPR_LAMBDA_BUG_OK) - MESSAGE(STATUS "C++17 support is enabled.") - SET(DEAL_II_HAVE_CXX17 TRUE) - ELSE() - MESSAGE(STATUS "C++17 support is disabled.") - SET(DEAL_II_HAVE_CXX17 FALSE) - ENDIF() -ENDMACRO() + message(STATUS "C++17 support is enabled.") + set(DEAL_II_HAVE_CXX17 TRUE) + else() + message(STATUS "C++17 support is disabled.") + set(DEAL_II_HAVE_CXX17 FALSE) + endif() +endmacro() # # Wrap the following checks into a macro to make it easier to rerun them. # -MACRO(_test_cxx14_support) - UNSET_IF_CHANGED(CHECK_CXX14_FEATURES_FLAGS_SAVED +macro(_test_cxx14_support) + unset_if_changed(CHECK_CXX14_FEATURES_FLAGS_SAVED "${CMAKE_REQUIRED_FLAGS}" DEAL_II_HAVE_CXX14_FEATURES DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK @@ -224,9 +224,9 @@ MACRO(_test_cxx14_support) # of an undeduced auto return type. # # https://llvm.org/bugs/show_bug.cgi?id=16876 - SET(_flags "${DEAL_II_CXX_FLAGS_DEBUG}") - STRIP_FLAG(_flags "-Wa,--compress-debug-sections") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_flags}") + set(_flags "${DEAL_II_CXX_FLAGS_DEBUG}") + strip_flag(_flags "-Wa,--compress-debug-sections") + add_flags(CMAKE_REQUIRED_FLAGS "${_flags}") CHECK_CXX_SOURCE_COMPILES( " struct foo @@ -284,17 +284,17 @@ MACRO(_test_cxx14_support) " DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK) - IF(DEAL_II_HAVE_CXX14_FEATURES AND + if(DEAL_II_HAVE_CXX14_FEATURES AND DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK AND DEAL_II_HAVE_CXX11_FEATURES AND DEAL_II_HAVE_CXX11_FUNCTIONAL_LLVMBUG20084_OK) - MESSAGE(STATUS "C++14 support is enabled.") - SET(DEAL_II_HAVE_CXX14 TRUE) - ELSE() - MESSAGE(STATUS "C++14 support is disabled.") - SET(DEAL_II_HAVE_CXX14 FALSE) - ENDIF() -ENDMACRO() + message(STATUS "C++14 support is enabled.") + set(DEAL_II_HAVE_CXX14 TRUE) + else() + message(STATUS "C++14 support is disabled.") + set(DEAL_II_HAVE_CXX14 FALSE) + endif() +endmacro() # @@ -304,29 +304,29 @@ ENDMACRO() _set_up_cmake_required() _test_cxx14_support() -IF(NOT DEAL_II_HAVE_CXX14) +if(NOT DEAL_II_HAVE_CXX14) # # We failed to detect C++14 support. Let's make an attempt to set the # -std= compiler flag. (But in order to minimize confusion let's not # override any manually specified -std= variable set by the user.) # - IF(NOT "${DEAL_II_CXX_FLAGS_SAVED}" MATCHES "-std=") - MESSAGE(STATUS "C++14 support not available. Try to set -std=c++14 explicitly") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_SAVED "-std=c++14") + if(NOT "${DEAL_II_CXX_FLAGS_SAVED}" MATCHES "-std=") + message(STATUS "C++14 support not available. Try to set -std=c++14 explicitly") + enable_if_supported(DEAL_II_CXX_FLAGS_SAVED "-std=c++14") _set_up_cmake_required() _test_cxx14_support() - ENDIF() -ENDIF() + endif() +endif() -IF(NOT DEAL_II_HAVE_CXX14) - MESSAGE(FATAL_ERROR +if(NOT DEAL_II_HAVE_CXX14) + message(FATAL_ERROR "\nThe current version of deal.II requires a compiler with enabled " "C++14 support. Make sure to use a modern enough compiler (GCC version " "5 onwards, Clang version 4 onwards, or Microsoft MS VS 2015 onwards) " "and check that the compiler flag \"-std=\" is either unset, or set to " "at least c++14.\n\n" ) -ENDIF() +endif() _test_cxx17_support() _test_cxx20_support() @@ -344,16 +344,16 @@ _test_cxx20_support() # features that we test below and do not issue an error but a warning. Set # -Werror to make the feature detection more reliable. # -SET(_werror_flag "") -IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - ENABLE_IF_SUPPORTED(_werror_flag "/WX /EHsc") -ELSE() - ENABLE_IF_SUPPORTED(_werror_flag "-Werror") - ENABLE_IF_SUPPORTED(_werror_flag "-Wno-unused-command-line-argument") -ENDIF() -ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_werror_flag}") +set(_werror_flag "") +if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + enable_if_supported(_werror_flag "/WX /EHsc") +else() + enable_if_supported(_werror_flag "-Werror") + enable_if_supported(_werror_flag "-Wno-unused-command-line-argument") +endif() +add_flags(CMAKE_REQUIRED_FLAGS "${_werror_flag}") -UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_SAVED +unset_if_changed(CHECK_CXX_FEATURES_FLAGS_SAVED "${CMAKE_REQUIRED_FLAGS}" DEAL_II_HAVE_FP_EXCEPTIONS DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS @@ -376,7 +376,7 @@ UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_SAVED # # - Timo Heister, 2015 # -SET(_snippet +set(_snippet " #include #include @@ -394,15 +394,15 @@ SET(_snippet } " ) -IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) +if(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) CHECK_CXX_SOURCE_RUNS("${_snippet}" DEAL_II_HAVE_FP_EXCEPTIONS) -ELSE() +else() # # If we are not allowed to do platform introspection, just test whether # we can compile above code. # CHECK_CXX_SOURCE_COMPILES("${_snippet}" DEAL_II_HAVE_FP_EXCEPTIONS) -ENDIF() +endif() # @@ -488,18 +488,18 @@ CHECK_CXX_SOURCE_COMPILES( DEAL_II_HAVE_ATTRIBUTE_DEPRECATED ) -IF(DEAL_II_HAVE_CXX17_ATTRIBUTE_DEPRECATED) - SET(DEAL_II_DEPRECATED "[[deprecated]]") -ELSEIF(DEAL_II_HAVE_ATTRIBUTE_DEPRECATED AND NOT DEAL_II_WITH_CUDA) - SET(DEAL_II_DEPRECATED "__attribute__((deprecated))") -ELSE() - SET(DEAL_II_DEPRECATED " ") -ENDIF() -IF(DEAL_II_EARLY_DEPRECATIONS) - SET(DEAL_II_DEPRECATED_EARLY ${DEAL_II_DEPRECATED}) -ELSE() - SET(DEAL_II_DEPRECATED_EARLY " ") -ENDIF() +if(DEAL_II_HAVE_CXX17_ATTRIBUTE_DEPRECATED) + set(DEAL_II_DEPRECATED "[[deprecated]]") +elseif(DEAL_II_HAVE_ATTRIBUTE_DEPRECATED AND NOT DEAL_II_WITH_CUDA) + set(DEAL_II_DEPRECATED "__attribute__((deprecated))") +else() + set(DEAL_II_DEPRECATED " ") +endif() +if(DEAL_II_EARLY_DEPRECATIONS) + set(DEAL_II_DEPRECATED_EARLY ${DEAL_II_DEPRECATED}) +else() + set(DEAL_II_DEPRECATED_EARLY " ") +endif() # @@ -554,13 +554,13 @@ CHECK_CXX_SOURCE_COMPILES( DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH ) -IF(DEAL_II_HAVE_CXX17_ATTRIBUTE_FALLTHROUGH) - SET(DEAL_II_FALLTHROUGH "[[fallthrough]]") -ELSEIF(DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH) - SET(DEAL_II_FALLTHROUGH "__attribute__((fallthrough))") -ELSE() - SET(DEAL_II_FALLTHROUGH " ") -ENDIF() +if(DEAL_II_HAVE_CXX17_ATTRIBUTE_FALLTHROUGH) + set(DEAL_II_FALLTHROUGH "[[fallthrough]]") +elseif(DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH) + set(DEAL_II_FALLTHROUGH "__attribute__((fallthrough))") +else() + set(DEAL_II_FALLTHROUGH " ") +endif() # @@ -619,10 +619,10 @@ CHECK_CXX_SOURCE_COMPILES( # MSVC has considerable problems with "constexpr", disable unconditionally # for now -IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - SET(DEAL_II_CXX14_CONSTEXPR_BUG true) -ELSE() - CHECK_CXX_COMPILER_BUG( +if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(DEAL_II_CXX14_CONSTEXPR_BUG true) +else() + check_cxx_compiler_bug( " #define Assert(x,y) if (!(x)) throw y; void bar() @@ -644,12 +644,12 @@ ELSE() } " DEAL_II_CXX14_CONSTEXPR_BUG) -ENDIF() +endif() -SET(DEAL_II_CONSTEXPR "constexpr") -IF(DEAL_II_CXX14_CONSTEXPR_BUG) - SET(DEAL_II_CONSTEXPR " ") -ENDIF() +set(DEAL_II_CONSTEXPR "constexpr") +if(DEAL_II_CXX14_CONSTEXPR_BUG) + set(DEAL_II_CONSTEXPR " ") +endif() -RESET_CMAKE_REQUIRED() +reset_cmake_required() diff --git a/cmake/checks/check_02_compiler_features.cmake b/cmake/checks/check_02_compiler_features.cmake index 77b6eafbfc..c3a112afe5 100644 --- a/cmake/checks/check_02_compiler_features.cmake +++ b/cmake/checks/check_02_compiler_features.cmake @@ -88,7 +88,7 @@ CHECK_CXX_SOURCE_COMPILES( # # - Matthias Maier, rewritten 2012 # -CHECK_CXX_COMPILER_BUG( +check_cxx_compiler_bug( " #include template void f(T) {} @@ -111,14 +111,14 @@ CHECK_CXX_COMPILER_BUG( # # - Matthias Maier, rewritten 2012 # -IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel") +if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel") CHECK_CXX_SOURCE_COMPILES( " bool f() { return true; } int main(){ if (__builtin_expect(f(),false)) {} } " DEAL_II_HAVE_BUILTIN_EXPECT) -ENDIF() +endif() # @@ -141,9 +141,9 @@ CHECK_CXX_SOURCE_COMPILES( " DEAL_II_HAVE_GLIBC_STACKTRACE) -IF(DEAL_II_HAVE_GLIBC_STACKTRACE AND NOT DEAL_II_STATIC_EXECUTABLE) - ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-rdynamic") -ENDIF() +if(DEAL_II_HAVE_GLIBC_STACKTRACE AND NOT DEAL_II_STATIC_EXECUTABLE) + enable_if_links(DEAL_II_LINKER_FLAGS "-rdynamic") +endif() # @@ -220,7 +220,7 @@ CHECK_CXX_SOURCE_COMPILES( " DEAL_II_COMPILER_HAS_ATTRIBUTE_PRETTY_FUNCTION) -IF(NOT DEAL_II_COMPILER_HAS_ATTRIBUTE_PRETTY_FUNCTION) +if(NOT DEAL_II_COMPILER_HAS_ATTRIBUTE_PRETTY_FUNCTION) CHECK_CXX_SOURCE_COMPILES( " #include @@ -232,12 +232,12 @@ IF(NOT DEAL_II_COMPILER_HAS_ATTRIBUTE_PRETTY_FUNCTION) " DEAL_II_COMPILER_HAS_ATTRIBUTE_FUNC) - IF(DEAL_II_COMPILER_HAS_ATTRIBUTE_FUNC) - SET(__PRETTY_FUNCTION__ "__func__") - ELSE() - SET(__PRETTY_FUNCTION__ "\"(not available)\"") - ENDIF() -ENDIF() + if(DEAL_II_COMPILER_HAS_ATTRIBUTE_FUNC) + set(__PRETTY_FUNCTION__ "__func__") + else() + set(__PRETTY_FUNCTION__ "\"(not available)\"") + endif() +endif() # @@ -262,13 +262,13 @@ ENDIF() # # - Matthias Maier, rewritten 2012, 2013 # -IF( (NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN") AND +if( (NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN") AND (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") AND (NOT CMAKE_CXX_COMPILER_ID MATCHES "Intel") ) - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS_DEBUG}") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Wa,--compress-debug-sections") - RESET_CMAKE_REQUIRED() -ENDIF() + add_flags(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS_DEBUG}") + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-Wa,--compress-debug-sections") + reset_cmake_required() +endif() # @@ -282,11 +282,11 @@ CHECK_CXX_SOURCE_COMPILES( DEAL_II_COMPILER_HAS_ATTRIBUTE_ALWAYS_INLINE ) -IF(DEAL_II_COMPILER_HAS_ATTRIBUTE_ALWAYS_INLINE) - SET(DEAL_II_ALWAYS_INLINE "__attribute__((always_inline))") -ELSE() - SET(DEAL_II_ALWAYS_INLINE " ") -ENDIF() +if(DEAL_II_COMPILER_HAS_ATTRIBUTE_ALWAYS_INLINE) + set(DEAL_II_ALWAYS_INLINE "__attribute__((always_inline))") +else() + set(DEAL_II_ALWAYS_INLINE " ") +endif() # @@ -300,11 +300,11 @@ CHECK_CXX_SOURCE_COMPILES( DEAL_II_COMPILER_HAS_RESTRICT_KEYWORD ) -IF(DEAL_II_COMPILER_HAS_RESTRICT_KEYWORD) - SET(DEAL_II_RESTRICT "__restrict") -ELSE() - SET(DEAL_II_RESTRICT " ") -ENDIF() +if(DEAL_II_COMPILER_HAS_RESTRICT_KEYWORD) + set(DEAL_II_RESTRICT "__restrict") +else() + set(DEAL_II_RESTRICT " ") +endif() # @@ -315,7 +315,7 @@ ENDIF() # # - Matthias Maier, 2015 # -ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_werror_flag}") +add_flags(CMAKE_REQUIRED_FLAGS "${_werror_flag}") CHECK_CXX_SOURCE_COMPILES( " _Pragma(\"GCC diagnostic push\") @@ -326,7 +326,7 @@ CHECK_CXX_SOURCE_COMPILES( _Pragma(\"GCC diagnostic pop\") " DEAL_II_COMPILER_HAS_DIAGNOSTIC_PRAGMA) -RESET_CMAKE_REQUIRED() +reset_cmake_required() # @@ -356,21 +356,21 @@ RESET_CMAKE_REQUIRED() # Wolfgang Bangerth, Matthias Maier, Daniel Arndt, Binrui Dong, 2015, 2018-2020 # -IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") +if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument") - ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-diag-error warn") - ENDIF() - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-shared") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fPIC") + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_flags(CMAKE_REQUIRED_FLAGS "-Wno-unused-command-line-argument") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_flags(CMAKE_REQUIRED_FLAGS "-diag-error warn") + endif() + add_flags(CMAKE_REQUIRED_FLAGS "-Werror") + add_flags(CMAKE_REQUIRED_FLAGS "-shared") + add_flags(CMAKE_REQUIRED_FLAGS "-fPIC") # # Check for ld.lld and ld.gold support: # - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld") + add_flags(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld") CHECK_CXX_SOURCE_COMPILES( " #include @@ -378,8 +378,8 @@ IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") " DEAL_II_COMPILER_HAS_FUSE_LD_LLD) - STRIP_FLAG(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-fuse-ld=gold") + strip_flag(CMAKE_REQUIRED_FLAGS "-fuse-ld=lld") + add_flags(CMAKE_REQUIRED_FLAGS "-fuse-ld=gold") CHECK_CXX_SOURCE_COMPILES( " #include @@ -387,11 +387,11 @@ IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") " DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) - IF(DEAL_II_COMPILER_HAS_FUSE_LD_LLD) - ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=lld") - ELSEIF(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) - ADD_FLAGS(DEAL_II_LINKER_FLAGS "-fuse-ld=gold") - ENDIF() + if(DEAL_II_COMPILER_HAS_FUSE_LD_LLD) + add_flags(DEAL_II_LINKER_FLAGS "-fuse-ld=lld") + elseif(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) + add_flags(DEAL_II_LINKER_FLAGS "-fuse-ld=gold") + endif() - RESET_CMAKE_REQUIRED() -ENDIF() + reset_cmake_required() +endif() diff --git a/cmake/checks/check_02_fortran_mangling.cmake b/cmake/checks/check_02_fortran_mangling.cmake index 4024afc408..d898c8d47d 100644 --- a/cmake/checks/check_02_fortran_mangling.cmake +++ b/cmake/checks/check_02_fortran_mangling.cmake @@ -32,47 +32,47 @@ # mangling. # -IF(${DEAL_II_Fortran_COMPILER_WORKS}) - MESSAGE(STATUS "Found a valid Fortran compiler - using it to set up mangling") - INCLUDE(FortranCInterface) - IF("${FortranCInterface_GLOBAL_CASE}" STREQUAL "LOWER") - SET(_name "name") - ELSE() - SET(_name "NAME") - ENDIF() +if(${DEAL_II_Fortran_COMPILER_WORKS}) + message(STATUS "Found a valid Fortran compiler - using it to set up mangling") + include(FortranCInterface) + if("${FortranCInterface_GLOBAL_CASE}" STREQUAL "LOWER") + set(_name "name") + else() + set(_name "NAME") + endif() - # STRING(JOIN ...) is in CMake 3.12 and newer, which we don't yet require - SET(DEAL_II_FORTRAN_MANGLE "${_name}") - IF(NOT "${FortranCInterface_GLOBAL_PREFIX}" STREQUAL "") - SET(DEAL_II_FORTRAN_MANGLE + # string(JOIN ...) is in CMake 3.12 and newer, which we don't yet require + set(DEAL_II_FORTRAN_MANGLE "${_name}") + if(NOT "${FortranCInterface_GLOBAL_PREFIX}" STREQUAL "") + set(DEAL_II_FORTRAN_MANGLE "${FortranCInterface_GLOBAL_PREFIX} ## ${DEAL_II_FORTRAN_MANGLE}") - ENDIF() - IF(NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "") - SET(DEAL_II_FORTRAN_MANGLE + endif() + if(NOT "${FortranCInterface_GLOBAL_SUFFIX}" STREQUAL "") + set(DEAL_II_FORTRAN_MANGLE "${DEAL_II_FORTRAN_MANGLE} ## ${FortranCInterface_GLOBAL_SUFFIX}") - ENDIF() + endif() # Same issue for identifiers containing underscores - IF("${FortranCInterface_GLOBAL__CASE}" STREQUAL "LOWER") - SET(_name "name") - ELSE() - SET(_name "NAME") - ENDIF() + if("${FortranCInterface_GLOBAL__CASE}" STREQUAL "LOWER") + set(_name "name") + else() + set(_name "NAME") + endif() - SET(DEAL_II_FORTRAN_MANGLE_UNDERSCORE "${_name}") - IF(NOT "${FortranCInterface_GLOBAL__PREFIX}" STREQUAL "") - SET(DEAL_II_FORTRAN_MANGLE_UNDERSCORE + set(DEAL_II_FORTRAN_MANGLE_UNDERSCORE "${_name}") + if(NOT "${FortranCInterface_GLOBAL__PREFIX}" STREQUAL "") + set(DEAL_II_FORTRAN_MANGLE_UNDERSCORE "${FortranCInterface_GLOBAL__PREFIX} ## ${DEAL_II_FORTRAN_MANGLE_UNDERSCORE}") - ENDIF() - IF(NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "") - SET(DEAL_II_FORTRAN_MANGLE_UNDERSCORE + endif() + if(NOT "${FortranCInterface_GLOBAL__SUFFIX}" STREQUAL "") + set(DEAL_II_FORTRAN_MANGLE_UNDERSCORE "${DEAL_II_FORTRAN_MANGLE_UNDERSCORE} ## ${FortranCInterface_GLOBAL__SUFFIX}") - ENDIF() -ELSE() + endif() +else() # Otherwise just use GNU mangling. This is almost always the right choice # anyway - until 2021 we did not even support other mangling options - MESSAGE(STATUS "Could NOT find a valid Fortran compiler - using default mangling") + message(STATUS "Could NOT find a valid Fortran compiler - using default mangling") - SET(DEAL_II_FORTRAN_MANGLE "name ## _") - SET(DEAL_II_FORTRAN_MANGLE_UNDERSCORE "name ## _") -ENDIF() + set(DEAL_II_FORTRAN_MANGLE "name ## _") + set(DEAL_II_FORTRAN_MANGLE_UNDERSCORE "name ## _") +endif() diff --git a/cmake/checks/check_02_system_features.cmake b/cmake/checks/check_02_system_features.cmake index 44bb1a523b..2765163d8b 100644 --- a/cmake/checks/check_02_system_features.cmake +++ b/cmake/checks/check_02_system_features.cmake @@ -45,13 +45,13 @@ CHECK_CXX_SYMBOL_EXISTS("getpid" "unistd.h" DEAL_II_HAVE_GETPID) # # ######################################################################## -IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") # # Use -Wno-long-double on Apple Darwin to avoid some unnecessary # warnings. However, newer gccs on that platform do not have # this flag any more, so check whether we can indeed do this # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-long-double") + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-long-double") # # On Mac OS X, -rdynamic is accepted by the compiler (i.e. @@ -60,14 +60,14 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") # # TODO: MM: Check whether this is still necessary... # - STRIP_FLAG(DEAL_II_LINKER_FLAGS "-rdynamic") + strip_flag(DEAL_II_LINKER_FLAGS "-rdynamic") # # At least on Clang 5.0.0 the template depth is set to 128, which is too low # to compile parts of the library. Fix this by setting a large value. # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-ftemplate-depth=1024") -ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS "-ftemplate-depth=1024") +endif() @@ -80,41 +80,41 @@ ENDIF() # # Put an end to user's suffering from cygwin's defects # -IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR +if( CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR CMAKE_SYSTEM_NAME MATCHES "Windows" ) - IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - MESSAGE(FATAL_ERROR + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + message(FATAL_ERROR "\nCygwin and forks such as MinGW and MinGW-64 are unsupported due to " "multiple unresolved miscompilation issues.\n\n" ) - ENDIF() -ENDIF() + endif() +endif() -IF(CMAKE_SYSTEM_NAME MATCHES "Windows") +if(CMAKE_SYSTEM_NAME MATCHES "Windows") # # Export DEAL_II_MSVC if we are on a Windows platform: # - SET(DEAL_II_MSVC TRUE) + set(DEAL_II_MSVC TRUE) # # Shared library handling: # - IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") # With MinGW we're lucky: - ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--export-all-symbols") - ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--enable-auto-import") - ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--allow-multiple-definition") - ELSE() + enable_if_links(DEAL_II_LINKER_FLAGS "-Wl,--export-all-symbols") + enable_if_links(DEAL_II_LINKER_FLAGS "-Wl,--enable-auto-import") + enable_if_links(DEAL_II_LINKER_FLAGS "-Wl,--allow-multiple-definition") + else() # Otherwise disable shared libraries: - MESSAGE(WARNING "\n" + message(WARNING "\n" "BUILD_SHARED_LIBS forced to OFF\n\n" ) - SET(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) # And disable compilation of examples: - SET(DEAL_II_COMPILE_EXAMPLES OFF CACHE BOOL "" FORCE) - ENDIF() + set(DEAL_II_COMPILE_EXAMPLES OFF CACHE BOOL "" FORCE) + endif() -ENDIF() +endif() diff --git a/cmake/checks/check_03_compiler_bugs.cmake b/cmake/checks/check_03_compiler_bugs.cmake index 630dce5ce1..cf9d782af2 100644 --- a/cmake/checks/check_03_compiler_bugs.cmake +++ b/cmake/checks/check_03_compiler_bugs.cmake @@ -28,9 +28,9 @@ # # - Timo Heister, 2013, 2015 # -IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0.3" ) - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-vec") -ENDIF() +if(CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0.3" ) + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-no-vec") +endif() # @@ -38,9 +38,9 @@ ENDIF() # tests/fe/curl_curl_01.debug but 16.0.2 is known to work. Blacklist this # version. Also see github.com/dealii/dealii/issues/2203 # -IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "16.0.1" ) - MESSAGE(FATAL_ERROR "Intel compiler version 16.0.1 is not supported, please update to 16.0.2 or newer!") -ENDIF() +if(CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "16.0.1" ) + message(FATAL_ERROR "Intel compiler version 16.0.1 is not supported, please update to 16.0.2 or newer!") +endif() # @@ -53,7 +53,7 @@ ENDIF() # # - Mathias Anselmann, Matthias Maier, David Wells, 2021 # -CHECK_CXX_COMPILER_BUG( +check_cxx_compiler_bug( " struct NonMovable { NonMovable() = default; diff --git a/cmake/config/CMakeLists.txt b/cmake/config/CMakeLists.txt index bc7ea40db3..2eb87c03f8 100644 --- a/cmake/config/CMakeLists.txt +++ b/cmake/config/CMakeLists.txt @@ -24,12 +24,12 @@ # two distinct setups. # -MESSAGE(STATUS "Setting up project configuration") +message(STATUS "Setting up project configuration") # # Configure the template-arguments file # -CONFIGURE_FILE( # for binary dir: +configure_file( # for binary dir: ${CMAKE_CURRENT_SOURCE_DIR}/template-arguments.in ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/template-arguments ) @@ -41,7 +41,7 @@ CONFIGURE_FILE( # for binary dir: # # ######################################################################## -SET(_macros +set(_macros ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_invoke_autopilot.cmake ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake @@ -49,10 +49,10 @@ SET(_macros ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_add_test.cmake ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_pickup_tests.cmake ) -FILE(COPY ${_macros} +file(COPY ${_macros} DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/macros ) -INSTALL(FILES ${_macros} +install(FILES ${_macros} DESTINATION ${DEAL_II_SHARE_RELDIR}/macros COMPONENT library ) @@ -69,7 +69,7 @@ INSTALL(FILES ${_macros} # deprecation warnings are actually shown for user code: # -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") +strip_flag(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") # # Strip -Wsuggest-override. Enabling this warning is a stylistic choice @@ -77,64 +77,64 @@ STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") # Let's be nice and disable the flag for now. # -STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wsuggest-override") +strip_flag(DEAL_II_CXX_FLAGS "-Wsuggest-override") # # Populate a bunch of CONFIG_* variables with useful information: # -FOREACH(_build ${DEAL_II_BUILD_TYPES}) +foreach(_build ${DEAL_II_BUILD_TYPES}) - IF(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") - SET(_keyword "general") - ELSE() - IF(_build MATCHES DEBUG) - SET(_keyword "debug") - ELSE() - SET(_keyword "optimized") - ENDIF() - ENDIF() + if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") + set(_keyword "general") + else() + if(_build MATCHES DEBUG) + set(_keyword "debug") + else() + set(_keyword "optimized") + endif() + endif() # # Build up library name depending on link type and platform: # - IF(BUILD_SHARED_LIBS) - SET(_type "SHARED") - ELSE() - SET(_type "STATIC") - ENDIF() + if(BUILD_SHARED_LIBS) + set(_type "SHARED") + else() + set(_type "STATIC") + endif() - SET(_name "${CMAKE_${_type}_LIBRARY_PREFIX}${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}${CMAKE_${_type}_LIBRARY_SUFFIX}") - SET(CONFIG_LIBRARIES_${_build} + set(_name "${CMAKE_${_type}_LIBRARY_PREFIX}${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}${CMAKE_${_type}_LIBRARY_SUFFIX}") + set(CONFIG_LIBRARIES_${_build} "\${DEAL_II_PATH}/${DEAL_II_LIBRARY_RELDIR}/${_name}" ${DEAL_II_LIBRARIES_${_build}} ${DEAL_II_LIBRARIES} ) - LIST(APPEND CONFIG_LIBRARIES ${_keyword} \${DEAL_II_LIBRARIES_${_build}}) + list(APPEND CONFIG_LIBRARIES ${_keyword} \${DEAL_II_LIBRARIES_${_build}}) - SET(CONFIG_TARGET_${_build} ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}) - LIST(APPEND CONFIG_TARGET ${_keyword} \${DEAL_II_TARGET_${_build}}) -ENDFOREACH() + set(CONFIG_TARGET_${_build} ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}) + list(APPEND CONFIG_TARGET ${_keyword} \${DEAL_II_TARGET_${_build}}) +endforeach() # # For binary dir: # -SET(CONFIG_BUILD_DIR TRUE) -SET(CONFIG_INCLUDE_DIRS +set(CONFIG_BUILD_DIR TRUE) +set(CONFIG_INCLUDE_DIRS \${DEAL_II_PATH}/include ${CMAKE_SOURCE_DIR}/include/ ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake @ONLY ) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ConfigVersion.cmake.in ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake @ONLY @@ -146,32 +146,32 @@ CONFIGURE_FILE( # Make sure that we only ever record the bundled subdirectory if it is in # fact created: -IF("${DEAL_II_BUNDLED_INCLUDE_DIRS}" STREQUAL "") - SET(_installed_bundled "") -ELSE() - SET(_installed_bundled +if("${DEAL_II_BUNDLED_INCLUDE_DIRS}" STREQUAL "") + set(_installed_bundled "") +else() + set(_installed_bundled "\${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR}/deal.II/bundled" ) -ENDIF() +endif() -SET(CONFIG_BUILD_DIR FALSE) -SET(CONFIG_INCLUDE_DIRS +set(CONFIG_BUILD_DIR FALSE) +set(CONFIG_INCLUDE_DIRS \${DEAL_II_PATH}/\${DEAL_II_INCLUDE_RELDIR} ${_installed_bundled} ${DEAL_II_USER_INCLUDE_DIRS} ) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake @ONLY ) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/ConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake @ONLY ) -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake @@ -183,52 +183,52 @@ INSTALL(FILES # Append feature configuration to all configuration files: # -SET(_files +set(_files ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake ) -FOREACH(_file ${_files}) - FILE(APPEND ${_file} "\n\n#\n# Feature configuration:\n#\n\n") - FILE(APPEND ${_file} - "SET(DEAL_II_WITH_CXX11 ON)\n" - "SET(DEAL_II_WITH_CXX14 ON)\n" - "SET(DEAL_II_WITH_CXX17 ${DEAL_II_HAVE_CXX17})\n" - "SET(DEAL_II_WITH_THREADS ON)\n" +foreach(_file ${_files}) + file(APPEND ${_file} "\n\n#\n# Feature configuration:\n#\n\n") + file(APPEND ${_file} + "set(DEAL_II_WITH_CXX11 ON)\n" + "set(DEAL_II_WITH_CXX14 ON)\n" + "set(DEAL_II_WITH_CXX17 ${DEAL_II_HAVE_CXX17})\n" + "set(DEAL_II_WITH_THREADS ON)\n" ) -ENDFOREACH() - -GET_CMAKE_PROPERTY(_res VARIABLES) -FOREACH(_var ${_res}) - IF(_var MATCHES "DEAL_II_.*WITH") - LIST(APPEND _additional_config_variables ${_var}) - ENDIF() -ENDFOREACH() - -SET(_deal_ii_features_sorted ${DEAL_II_FEATURES}) -LIST(SORT _deal_ii_features_sorted) -FOREACH(_name ${_deal_ii_features_sorted}) - SET(_var DEAL_II_WITH_${_name}) - - FOREACH(_file ${_files}) - FILE(APPEND ${_file} "SET(${_var} ${${_var}})\n") +endforeach() + +get_cmake_property(_res VARIABLES) +foreach(_var ${_res}) + if(_var MATCHES "DEAL_II_.*WITH") + list(APPEND _additional_config_variables ${_var}) + endif() +endforeach() + +set(_deal_ii_features_sorted ${DEAL_II_FEATURES}) +list(SORT _deal_ii_features_sorted) +foreach(_name ${_deal_ii_features_sorted}) + set(_var DEAL_II_WITH_${_name}) + + foreach(_file ${_files}) + file(APPEND ${_file} "set(${_var} ${${_var}})\n") # # Do not pollute deal.IIConfig.cmake with package details of # unconfigured features. # - IF(${_var}) - IF(NOT "${${_name}_VERSION}" STREQUAL "") - FILE(APPEND ${_file} - "SET(DEAL_II_${_name}_VERSION \"${${_name}_VERSION}\")\n" + if(${_var}) + if(NOT "${${_name}_VERSION}" STREQUAL "") + file(APPEND ${_file} + "set(DEAL_II_${_name}_VERSION \"${${_name}_VERSION}\")\n" ) - ENDIF() - FOREACH(_additional ${_additional_config_variables}) - IF(_additional MATCHES "DEAL_II_${_name}_WITH") - FILE(APPEND ${_file} "SET(${_additional} ${${_additional}})\n") - ENDIF() - ENDFOREACH() - ENDIF() - ENDFOREACH() -ENDFOREACH() + endif() + foreach(_additional ${_additional_config_variables}) + if(_additional MATCHES "DEAL_II_${_name}_WITH") + file(APPEND ${_file} "set(${_additional} ${${_additional}})\n") + endif() + endforeach() + endif() + endforeach() +endforeach() ######################################################################## @@ -259,120 +259,120 @@ ENDFOREACH() # We need to gather some variables for the regex below to work. # -SET(_library_prefixes "") -IF (CMAKE_SHARED_LIBRARY_PREFIX) - LIST(APPEND _library_prefixes ${CMAKE_SHARED_LIBRARY_PREFIX}) -ENDIF() -IF (CMAKE_STATIC_LIBRARY_PREFIX) - LIST(APPEND _library_prefixes ${CMAKE_STATIC_LIBRARY_PREFIX}) -ENDIF() -STRING(REPLACE ";" "|" _library_prefixes "${_library_prefixes}") +set(_library_prefixes "") +if (CMAKE_SHARED_LIBRARY_PREFIX) + list(APPEND _library_prefixes ${CMAKE_SHARED_LIBRARY_PREFIX}) +endif() +if (CMAKE_STATIC_LIBRARY_PREFIX) + list(APPEND _library_prefixes ${CMAKE_STATIC_LIBRARY_PREFIX}) +endif() +string(REPLACE ";" "|" _library_prefixes "${_library_prefixes}") -SET(_library_suffixes "") -IF (CMAKE_SHARED_LIBRARY_SUFFIX) - LIST(APPEND _library_suffixes ${CMAKE_SHARED_LIBRARY_SUFFIX}) -ENDIF() -IF (CMAKE_STATIC_LIBRARY_SUFFIX) - LIST(APPEND _library_suffixes ${CMAKE_STATIC_LIBRARY_SUFFIX}) -ENDIF() -STRING(REPLACE ";" "|" _library_suffixes "${_library_suffixes}") +set(_library_suffixes "") +if (CMAKE_SHARED_LIBRARY_SUFFIX) + list(APPEND _library_suffixes ${CMAKE_SHARED_LIBRARY_SUFFIX}) +endif() +if (CMAKE_STATIC_LIBRARY_SUFFIX) + list(APPEND _library_suffixes ${CMAKE_STATIC_LIBRARY_SUFFIX}) +endif() +string(REPLACE ";" "|" _library_suffixes "${_library_suffixes}") # # Build up the link line from our list of libraries: # -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) +foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - SET(_name "${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}") + set(_name "${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX}") - SET(CONFIG_RPATH_${_build}_PC "\\\${libdir}") - SET(CONFIG_LIBRARIES_${_build}_PC "-L\${libdir} -l${_name}") + set(CONFIG_RPATH_${_build}_PC "\\\${libdir}") + set(CONFIG_LIBRARIES_${_build}_PC "-L\${libdir} -l${_name}") - FOREACH(_lib ${DEAL_II_LIBRARIES_${_build}} ${DEAL_II_LIBRARIES}) + foreach(_lib ${DEAL_II_LIBRARIES_${_build}} ${DEAL_II_LIBRARIES}) - GET_FILENAME_COMPONENT(_name ${_lib} NAME) - GET_FILENAME_COMPONENT(_dir ${_lib} PATH) + get_filename_component(_name ${_lib} NAME) + get_filename_component(_dir ${_lib} PATH) - IF("${_dir}" STREQUAL "") + if("${_dir}" STREQUAL "") # ${_lib} is a simple library name, just add it to the link line: - SET(_library_string "-l${_lib}") + set(_library_string "-l${_lib}") - ELSE() + else() # ${_lib} is a full library path: # # Only append a library directory if it is new ... # - LIST(FIND CONFIG_RPATH_${_build}_PC "${_dir}" _index) - IF (${_index} EQUAL -1) - SET(_library_string "-L${_dir} ") - LIST(APPEND CONFIG_RPATH_${_build}_PC ${_dir}) - ELSE() - SET(_library_string "") - ENDIF() + list(FIND CONFIG_RPATH_${_build}_PC "${_dir}" _index) + if (${_index} EQUAL -1) + set(_library_string "-L${_dir} ") + list(APPEND CONFIG_RPATH_${_build}_PC ${_dir}) + else() + set(_library_string "") + endif() # Recover short name: - IF(_library_prefixes) - STRING(REGEX REPLACE "^(${_library_prefixes})" "" _name "${_name}") - ENDIF() - IF(_library_suffixes) - STRING(REGEX REPLACE "(${_library_suffixes})$" "" _name "${_name}") - ENDIF() - SET(_library_string "${_library_string}-l${_name}") - ENDIF() - - SET(CONFIG_LIBRARIES_${_build}_PC + if(_library_prefixes) + string(REGEX REPLACE "^(${_library_prefixes})" "" _name "${_name}") + endif() + if(_library_suffixes) + string(REGEX REPLACE "(${_library_suffixes})$" "" _name "${_name}") + endif() + set(_library_string "${_library_string}-l${_name}") + endif() + + set(CONFIG_LIBRARIES_${_build}_PC "${CONFIG_LIBRARIES_${_build}_PC} ${_library_string}" ) - ENDFOREACH() + endforeach() - TO_STRING_AND_ADD_PREFIX(CONFIG_RPATH_${_build}_PC + to_string_and_add_prefix(CONFIG_RPATH_${_build}_PC "-Wl,-rpath," ${CONFIG_RPATH_${_build}_PC} ) -ENDFOREACH() +endforeach() # # For binary dir (aka build dir): # -SET(CONFIG_PATH_PC "${CMAKE_BINARY_DIR}") +set(CONFIG_PATH_PC "${CMAKE_BINARY_DIR}") -TO_STRING_AND_ADD_PREFIX(CONFIG_INCLUDE_DIRS_PC "-I" +to_string_and_add_prefix(CONFIG_INCLUDE_DIRS_PC "-I" \\\${prefix}/include ${CMAKE_SOURCE_DIR}/include ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) +foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - SET(_config_directory "${CMAKE_BINARY_DIR}/${DEAL_II_PKGCONF_RELDIR}") + set(_config_directory "${CMAKE_BINARY_DIR}/${DEAL_II_PKGCONF_RELDIR}") - CONFIGURE_FILE( + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config_${_build_lowercase}.pc.in ${_config_directory}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build_lowercase}.pc @ONLY ) -ENDFOREACH() +endforeach() # # For installation: # -SET(CONFIG_PATH_PC "${CMAKE_INSTALL_PREFIX}") +set(CONFIG_PATH_PC "${CMAKE_INSTALL_PREFIX}") -TO_STRING_AND_ADD_PREFIX(CONFIG_INCLUDE_DIRS_PC "-I" +to_string_and_add_prefix(CONFIG_INCLUDE_DIRS_PC "-I" \\\${includedir} ${DEAL_II_BUNDLED_INCLUDE_DIRS} ${DEAL_II_USER_INCLUDE_DIRS} ) -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) +foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) # # Only populate the pkgconf files for the install directory if @@ -384,25 +384,25 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES}) # FIXME: Unify RPATH handling between cmake and pkgconf configuration and # clearly document RPATH behavior. # - IF(NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH) - SET(CONFIG_RPATH_${_build}_PC "") - ENDIF() + if(NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH) + set(CONFIG_RPATH_${_build}_PC "") + endif() - CONFIGURE_FILE( + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config_${_build_lowercase}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build_lowercase}.pc @ONLY ) - INSTALL(FILES + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}_${_build_lowercase}.pc DESTINATION ${DEAL_II_PKGCONF_RELDIR} COMPONENT library ) -ENDFOREACH() +endforeach() # # Job's done. # -MESSAGE(STATUS "Setting up project configuration - Done") +message(STATUS "Setting up project configuration - Done") diff --git a/cmake/config/Config.cmake.in b/cmake/config/Config.cmake.in index ec0e07e119..11a70b2cc2 100644 --- a/cmake/config/Config.cmake.in +++ b/cmake/config/Config.cmake.in @@ -25,135 +25,135 @@ # General information # -SET(DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@") -SET(DEAL_II_PACKAGE_VERSION "@DEAL_II_PACKAGE_VERSION@") -SET(DEAL_II_PACKAGE_VENDOR "@DEAL_II_PACKAGE_VENDOR@") -SET(DEAL_II_PACKAGE_DESCRIPTION "@DEAL_II_PACKAGE_DESCRIPTION@") +set(DEAL_II_PACKAGE_NAME "@DEAL_II_PACKAGE_NAME@") +set(DEAL_II_PACKAGE_VERSION "@DEAL_II_PACKAGE_VERSION@") +set(DEAL_II_PACKAGE_VENDOR "@DEAL_II_PACKAGE_VENDOR@") +set(DEAL_II_PACKAGE_DESCRIPTION "@DEAL_II_PACKAGE_DESCRIPTION@") -SET(DEAL_II_VERSION_MAJOR "@DEAL_II_VERSION_MAJOR@") -SET(DEAL_II_VERSION_MINOR "@DEAL_II_VERSION_MINOR@") -SET(DEAL_II_VERSION_SUBMINOR "@DEAL_II_VERSION_SUBMINOR@") -SET(DEAL_II_VERSION "@DEAL_II_VERSION@") +set(DEAL_II_VERSION_MAJOR "@DEAL_II_VERSION_MAJOR@") +set(DEAL_II_VERSION_MINOR "@DEAL_II_VERSION_MINOR@") +set(DEAL_II_VERSION_SUBMINOR "@DEAL_II_VERSION_SUBMINOR@") +set(DEAL_II_VERSION "@DEAL_II_VERSION@") -SET(DEAL_II_GIT_BRANCH "@DEAL_II_GIT_BRANCH@") -SET(DEAL_II_GIT_REVISION "@DEAL_II_GIT_REVISION@") -SET(DEAL_II_GIT_SHORTREV "@DEAL_II_GIT_SHORTREV@") -SET(DEAL_II_GIT_TAG "@DEAL_II_GIT_TAG@") +set(DEAL_II_GIT_BRANCH "@DEAL_II_GIT_BRANCH@") +set(DEAL_II_GIT_REVISION "@DEAL_II_GIT_REVISION@") +set(DEAL_II_GIT_SHORTREV "@DEAL_II_GIT_SHORTREV@") +set(DEAL_II_GIT_TAG "@DEAL_II_GIT_TAG@") -SET(DEAL_II_PROJECT_CONFIG_NAME "@DEAL_II_PROJECT_CONFIG_NAME@") +set(DEAL_II_PROJECT_CONFIG_NAME "@DEAL_II_PROJECT_CONFIG_NAME@") -SET(DEAL_II_BUILD_TYPE "@CMAKE_BUILD_TYPE@") -SET(DEAL_II_BUILD_TYPES "@DEAL_II_BUILD_TYPES@") +set(DEAL_II_BUILD_TYPE "@CMAKE_BUILD_TYPE@") +set(DEAL_II_BUILD_TYPES "@DEAL_II_BUILD_TYPES@") # # Information about the project location # -SET(DEAL_II_DOCHTML_RELDIR "@DEAL_II_DOCHTML_RELDIR@") -SET(DEAL_II_DOCREADME_RELDIR "@DEAL_II_DOCREADME_RELDIR@") -SET(DEAL_II_EXAMPLES_RELDIR "@DEAL_II_EXAMPLES_RELDIR@") -SET(DEAL_II_EXECUTABLE_RELDIR "@DEAL_II_EXECUTABLE_RELDIR@") -SET(DEAL_II_INCLUDE_RELDIR "@DEAL_II_INCLUDE_RELDIR@") -SET(DEAL_II_LIBRARY_RELDIR "@DEAL_II_LIBRARY_RELDIR@") -SET(DEAL_II_PROJECT_CONFIG_RELDIR "@DEAL_II_PROJECT_CONFIG_RELDIR@") -SET(DEAL_II_SHARE_RELDIR "@DEAL_II_SHARE_RELDIR@") +set(DEAL_II_DOCHTML_RELDIR "@DEAL_II_DOCHTML_RELDIR@") +set(DEAL_II_DOCREADME_RELDIR "@DEAL_II_DOCREADME_RELDIR@") +set(DEAL_II_EXAMPLES_RELDIR "@DEAL_II_EXAMPLES_RELDIR@") +set(DEAL_II_EXECUTABLE_RELDIR "@DEAL_II_EXECUTABLE_RELDIR@") +set(DEAL_II_INCLUDE_RELDIR "@DEAL_II_INCLUDE_RELDIR@") +set(DEAL_II_LIBRARY_RELDIR "@DEAL_II_LIBRARY_RELDIR@") +set(DEAL_II_PROJECT_CONFIG_RELDIR "@DEAL_II_PROJECT_CONFIG_RELDIR@") +set(DEAL_II_SHARE_RELDIR "@DEAL_II_SHARE_RELDIR@") # # Determine DEAL_II_PATH from CMAKE_CURRENT_LIST_DIR: # -SET(DEAL_II_PATH "${CMAKE_CURRENT_LIST_DIR}") -SET(_path "${DEAL_II_PROJECT_CONFIG_RELDIR}") -WHILE(NOT "${_path}" STREQUAL "") - GET_FILENAME_COMPONENT(DEAL_II_PATH "${DEAL_II_PATH}" PATH) - GET_FILENAME_COMPONENT(_path "${_path}" PATH) -ENDWHILE() +set(DEAL_II_PATH "${CMAKE_CURRENT_LIST_DIR}") +set(_path "${DEAL_II_PROJECT_CONFIG_RELDIR}") +while(NOT "${_path}" STREQUAL "") + get_filename_component(DEAL_II_PATH "${DEAL_II_PATH}" PATH) + get_filename_component(_path "${_path}" PATH) +endwhile() # # Print a message after inclusion of this file: # -SET(DEAL_II_PROJECT_CONFIG_INCLUDED TRUE) +set(DEAL_II_PROJECT_CONFIG_INCLUDED TRUE) -SET(DEAL_II_BUILD_DIR @CONFIG_BUILD_DIR@) +set(DEAL_II_BUILD_DIR @CONFIG_BUILD_DIR@) -IF(NOT ${DEAL_II_PACKAGE_NAME}_FIND_QUIETLY) - IF(DEAL_II_BUILD_DIR) - MESSAGE(STATUS +if(NOT ${DEAL_II_PACKAGE_NAME}_FIND_QUIETLY) + if(DEAL_II_BUILD_DIR) + message(STATUS "Using the ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} build directory found at ${DEAL_II_PATH}" ) - ELSE() - MESSAGE(STATUS + else() + message(STATUS "Using the ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} installation found at ${DEAL_II_PATH}" ) - ENDIF() -ENDIF() + endif() +endif() # # Include all convenience macros: # -FILE(GLOB _macro_files +file(GLOB _macro_files "${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/macros/*.cmake" ) -FOREACH(file ${_macro_files}) - IF(NOT ${DEAL_II_PACKAGE_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "Include macro ${file}") - ENDIF() - INCLUDE(${file}) -ENDFOREACH() +foreach(file ${_macro_files}) + if(NOT ${DEAL_II_PACKAGE_NAME}_FIND_QUIETLY) + message(STATUS "Include macro ${file}") + endif() + include(${file}) +endforeach() # # Compiler and linker configuration # -SET(DEAL_II_CXX_COMPILER "@CMAKE_CXX_COMPILER@") -SET(DEAL_II_C_COMPILER "@CMAKE_C_COMPILER@") +set(DEAL_II_CXX_COMPILER "@CMAKE_CXX_COMPILER@") +set(DEAL_II_C_COMPILER "@CMAKE_C_COMPILER@") # used for all targets: -SET(DEAL_II_CXX_FLAGS "@DEAL_II_CXX_FLAGS@") +set(DEAL_II_CXX_FLAGS "@DEAL_II_CXX_FLAGS@") # _additionally_ used for debug targets: -SET(DEAL_II_CXX_FLAGS_DEBUG "@DEAL_II_CXX_FLAGS_DEBUG@") +set(DEAL_II_CXX_FLAGS_DEBUG "@DEAL_II_CXX_FLAGS_DEBUG@") # _additionally_ used for release targets: -SET(DEAL_II_CXX_FLAGS_RELEASE "@DEAL_II_CXX_FLAGS_RELEASE@") +set(DEAL_II_CXX_FLAGS_RELEASE "@DEAL_II_CXX_FLAGS_RELEASE@") # used for all targets: -SET(DEAL_II_LINKER_FLAGS "@DEAL_II_LINKER_FLAGS@") +set(DEAL_II_LINKER_FLAGS "@DEAL_II_LINKER_FLAGS@") # _additionally_ used for debug targets: -SET(DEAL_II_LINKER_FLAGS_DEBUG "@DEAL_II_LINKER_FLAGS_DEBUG@") +set(DEAL_II_LINKER_FLAGS_DEBUG "@DEAL_II_LINKER_FLAGS_DEBUG@") # _additionally_ used for release targets: -SET(DEAL_II_LINKER_FLAGS_RELEASE "@DEAL_II_LINKER_FLAGS_RELEASE@") +set(DEAL_II_LINKER_FLAGS_RELEASE "@DEAL_II_LINKER_FLAGS_RELEASE@") # used for all targets: -SET(DEAL_II_USER_DEFINITIONS "@DEAL_II_USER_DEFINITIONS@") +set(DEAL_II_USER_DEFINITIONS "@DEAL_II_USER_DEFINITIONS@") # _additionally_ used for debug targets: -SET(DEAL_II_USER_DEFINITIONS_DEBUG "@DEAL_II_USER_DEFINITIONS_DEBUG@") +set(DEAL_II_USER_DEFINITIONS_DEBUG "@DEAL_II_USER_DEFINITIONS_DEBUG@") # _additionally_ used for release targets: -SET(DEAL_II_USER_DEFINITIONS_RELEASE "@DEAL_II_USER_DEFINITIONS_RELEASE@") +set(DEAL_II_USER_DEFINITIONS_RELEASE "@DEAL_II_USER_DEFINITIONS_RELEASE@") # # MPI runtime: # -SET(DEAL_II_MPIEXEC "@MPIEXEC@") -SET(DEAL_II_MPIEXEC_NUMPROC_FLAG "@MPIEXEC_NUMPROC_FLAG@") -SET(DEAL_II_MPIEXEC_PREFLAGS "@MPIEXEC_PREFLAGS@") -SET(DEAL_II_MPIEXEC_POSTFLAGS "@MPIEXEC_POSTFLAGS@") +set(DEAL_II_MPIEXEC "@MPIEXEC@") +set(DEAL_II_MPIEXEC_NUMPROC_FLAG "@MPIEXEC_NUMPROC_FLAG@") +set(DEAL_II_MPIEXEC_PREFLAGS "@MPIEXEC_PREFLAGS@") +set(DEAL_II_MPIEXEC_POSTFLAGS "@MPIEXEC_POSTFLAGS@") # # Build a static executable: # -SET(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@") +set(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@") # @@ -161,16 +161,16 @@ SET(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@") # # Full list of include directories: -SET(DEAL_II_INCLUDE_DIRS "@CONFIG_INCLUDE_DIRS@") +set(DEAL_II_INCLUDE_DIRS "@CONFIG_INCLUDE_DIRS@") # Full list of libraries for the debug target: -SET(DEAL_II_LIBRARIES_DEBUG "@CONFIG_LIBRARIES_DEBUG@") +set(DEAL_II_LIBRARIES_DEBUG "@CONFIG_LIBRARIES_DEBUG@") # Full list of libraries for the release target: -SET(DEAL_II_LIBRARIES_RELEASE "@CONFIG_LIBRARIES_RELEASE@") +set(DEAL_II_LIBRARIES_RELEASE "@CONFIG_LIBRARIES_RELEASE@") # Full list of libraries with "debug" and "optimized" keywords for easy use with TARGET_LINK_LIBRARIES: -SET(DEAL_II_LIBRARIES "@CONFIG_LIBRARIES@") +set(DEAL_II_LIBRARIES "@CONFIG_LIBRARIES@") # @@ -178,16 +178,16 @@ SET(DEAL_II_LIBRARIES "@CONFIG_LIBRARIES@") # # The library targets file: -SET(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake") +set(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake") # The Debug target: -SET(DEAL_II_TARGET_DEBUG "@CONFIG_TARGET_DEBUG@") +set(DEAL_II_TARGET_DEBUG "@CONFIG_TARGET_DEBUG@") # The Release target: -SET(DEAL_II_TARGET_RELEASE "@CONFIG_TARGET_RELEASE@") +set(DEAL_II_TARGET_RELEASE "@CONFIG_TARGET_RELEASE@") # Full list of targets with "debug" and "optimized" keywords for easy use with TARGET_LINK_LIBRARIES: -SET(DEAL_II_TARGET "@CONFIG_TARGET@") +set(DEAL_II_TARGET "@CONFIG_TARGET@") # The feature configuration file: -SET(DEAL_II_FEATURE_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake") +set(DEAL_II_FEATURE_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake") diff --git a/cmake/configure/TestBoostBug/CMakeLists.txt b/cmake/configure/TestBoostBug/CMakeLists.txt index 10e970bf07..2ce762a065 100644 --- a/cmake/configure/TestBoostBug/CMakeLists.txt +++ b/cmake/configure/TestBoostBug/CMakeLists.txt @@ -1,15 +1,15 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) -PROJECT(TestBoost) +cmake_minimum_required(VERSION 3.1.0) +project(TestBoost) -INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIRS}) +include_directories(${BOOST_INCLUDE_DIRS}) -ADD_LIBRARY(derived SHARED polymorphic_derived2.cpp) -ADD_EXECUTABLE(test_boost test_dll_exported.cpp) +add_library(derived SHARED polymorphic_derived2.cpp) +add_executable(test_boost test_dll_exported.cpp) -TARGET_LINK_LIBRARIES(derived ${BOOST_LIBRARIES}) -TARGET_LINK_LIBRARIES(test_boost derived ${BOOST_LIBRARIES}) +target_link_libraries(derived ${BOOST_LIBRARIES}) +target_link_libraries(test_boost derived ${BOOST_LIBRARIES}) -ADD_CUSTOM_TARGET(run +add_custom_target(run COMMAND test_boost DEPENDS test_boost WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}) diff --git a/cmake/configure/configure_00_threads.cmake b/cmake/configure/configure_00_threads.cmake index 33ae7145c6..a6c09a058e 100644 --- a/cmake/configure/configure_00_threads.cmake +++ b/cmake/configure/configure_00_threads.cmake @@ -19,19 +19,19 @@ # # Clear the test flags because FindThreads.cmake will use a C compiler: -CLEAR_CMAKE_REQUIRED() +clear_cmake_required() -SWITCH_LIBRARY_PREFERENCE() -FIND_PACKAGE(Threads) -SWITCH_LIBRARY_PREFERENCE() +switch_library_preference() +find_package(Threads) +switch_library_preference() -RESET_CMAKE_REQUIRED() +reset_cmake_required() -ADD_FLAGS(DEAL_II_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") +add_flags(DEAL_II_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") -IF(NOT Threads_FOUND) - MESSAGE(FATAL_ERROR +if(NOT Threads_FOUND) + message(FATAL_ERROR "\nFatal configuration error: CMake was unable to detect any threading " "support offered by the current compiler. Configuration cannot continue.\n\n" ) -ENDIF() +endif() diff --git a/cmake/configure/configure_10_lapack.cmake b/cmake/configure/configure_10_lapack.cmake index 67f70a4508..48c7063c70 100644 --- a/cmake/configure/configure_10_lapack.cmake +++ b/cmake/configure/configure_10_lapack.cmake @@ -17,21 +17,21 @@ # Configuration for the lapack library: # -MACRO(FEATURE_LAPACK_FIND_EXTERNAL var) - CLEAR_CMAKE_REQUIRED() - FIND_PACKAGE(LAPACK) +macro(FEATURE_LAPACK_FIND_EXTERNAL var) + clear_cmake_required() + find_package(LAPACK) # # We do a check for availability of every single LAPACK function we use. # - IF(LAPACK_FOUND) - SET(${var} TRUE) + if(LAPACK_FOUND) + set(${var} TRUE) # # Clear the test flags because the following test will use a C compiler # - CLEAR_CMAKE_REQUIRED() - SET(CMAKE_REQUIRED_LIBRARIES + clear_cmake_required() + set(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED} ${LAPACK_LINKER_FLAGS} ${LAPACK_LIBRARIES} ) @@ -62,13 +62,13 @@ MACRO(FEATURE_LAPACK_FIND_EXTERNAL var) }" LAPACK_SYMBOL_CHECK) - IF(NOT LAPACK_SYMBOL_CHECK) - MESSAGE(STATUS + if(NOT LAPACK_SYMBOL_CHECK) + message(STATUS "Could not find a sufficient BLAS/LAPACK installation: " "BLAS/LAPACK symbol check failed! Consult CMakeFiles/CMakeError.log " "for further information." ) - SET(LAPACK_ADDITIONAL_ERROR_STRING + set(LAPACK_ADDITIONAL_ERROR_STRING ${LAPACK_ADDITIONAL_ERROR_STRING} "Could not find a sufficient BLAS/LAPACK installation: \n" "BLAS/LAPACK symbol check failed! This usually means that your " @@ -77,13 +77,13 @@ MACRO(FEATURE_LAPACK_FIND_EXTERNAL var) " CMakeFiles/CMakeError.log\n" "for further information.\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # See if we use Intel-MKL by compiling a small program # - SET(CMAKE_REQUIRED_INCLUDES + set(CMAKE_REQUIRED_INCLUDES ${LAPACK_INCLUDE_DIRS} ) CHECK_CXX_SOURCE_COMPILES(" @@ -98,20 +98,20 @@ MACRO(FEATURE_LAPACK_FIND_EXTERNAL var) return 0; }" MKL_SYMBOL_CHECK) - IF(MKL_SYMBOL_CHECK) - MESSAGE(STATUS + if(MKL_SYMBOL_CHECK) + message(STATUS "Use Intel MKL for BLAS/LAPACK." ) - SET(DEAL_II_LAPACK_WITH_MKL ON) - ELSE() - MESSAGE(STATUS + set(DEAL_II_LAPACK_WITH_MKL ON) + else() + message(STATUS "Use other than Intel MKL implementation of BLAS/LAPACK (consult CMakeFiles/CMakeError.log for further information)." ) - SET(DEAL_II_LAPACK_WITH_MKL OFF) - ENDIF() + set(DEAL_II_LAPACK_WITH_MKL OFF) + endif() - ENDIF() -ENDMACRO() + endif() +endmacro() -CONFIGURE_FEATURE(LAPACK) +configure_feature(LAPACK) diff --git a/cmake/configure/configure_10_mpi.cmake b/cmake/configure/configure_10_mpi.cmake index 305987cfcf..3f617266b7 100644 --- a/cmake/configure/configure_10_mpi.cmake +++ b/cmake/configure/configure_10_mpi.cmake @@ -18,59 +18,59 @@ # MPI support with -DWITH_MPI=ON (or -DDEAL_II_WITH_MPI=ON) on the command # line. # -SET(DEAL_II_WITH_MPI OFF CACHE BOOL "") +set(DEAL_II_WITH_MPI OFF CACHE BOOL "") # # Configuration for mpi support: # -MACRO(FEATURE_MPI_FIND_EXTERNAL var) - FIND_PACKAGE(MPI) +macro(FEATURE_MPI_FIND_EXTERNAL var) + find_package(MPI) - IF(MPI_FOUND) - SET(${var} TRUE) + if(MPI_FOUND) + set(${var} TRUE) - IF(NOT MPI_HAVE_MPI_SEEK_SET) - MESSAGE(STATUS + if(NOT MPI_HAVE_MPI_SEEK_SET) + message(STATUS "Could not find a sufficient MPI version: " "Your MPI implementation must define MPI_SEEK_SET.") - SET(MPI_ADDITIONAL_ERROR_STRING + set(MPI_ADDITIONAL_ERROR_STRING "Your MPI implementation must define MPI_SEEK_SET.\n") - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - IF(MPI_VERSION VERSION_LESS "3.0") - MESSAGE(STATUS + if(MPI_VERSION VERSION_LESS "3.0") + message(STATUS "Could not find a sufficient MPI version: " "Your MPI implementation does not support the MPI 3.0 standard.") - SET(MPI_ADDITIONAL_ERROR_STRING + set(MPI_ADDITIONAL_ERROR_STRING "Your MPI implementation does not support the MPI 3.0 standard.\n") - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - ENDIF() -ENDMACRO() + endif() +endmacro() -MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL) +macro(FEATURE_MPI_CONFIGURE_EXTERNAL) # # We must convert the MPIEXEC_(PRE|POST)FLAGS strings to lists in order # to use them in command lines: # - SEPARATE_ARGUMENTS(MPIEXEC_PREFLAGS) - SEPARATE_ARGUMENTS(MPIEXEC_POSTFLAGS) + separate_arguments(MPIEXEC_PREFLAGS) + separate_arguments(MPIEXEC_POSTFLAGS) # # TODO: We might consider refactoring this option into an automatic check # (in Modules/FindMPI.cmake) at some point. For the time being this is an # advanced configuration option. # - OPTION(DEAL_II_MPI_WITH_CUDA_SUPPORT "Enable MPI Cuda support" OFF) - MARK_AS_ADVANCED(DEAL_II_MPI_WITH_CUDA_SUPPORT) -ENDMACRO() + option(DEAL_II_MPI_WITH_CUDA_SUPPORT "Enable MPI Cuda support" OFF) + mark_as_advanced(DEAL_II_MPI_WITH_CUDA_SUPPORT) +endmacro() -MACRO(FEATURE_MPI_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" +macro(FEATURE_MPI_ERROR_MESSAGE) + message(FATAL_ERROR "\n" "Could not find any suitable mpi library!\n" ${MPI_ADDITIONAL_ERROR_STRING} "\nPlease ensure that an mpi library is installed on your computer\n" @@ -82,16 +82,16 @@ MACRO(FEATURE_MPI_ERROR_MESSAGE) " -DMPI_Fortran_COMPILER=\".../mpif90\"\\\n" " <...>\n" ) -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(MPI) +configure_feature(MPI) -IF(NOT DEAL_II_WITH_MPI) +if(NOT DEAL_II_WITH_MPI) # # Disable and hide the DEAL_II_MPI_WITH_CUDA_SUPPORT option # - SET(DEAL_II_MPI_WITH_CUDA_SUPPORT) - UNSET(DEAL_II_MPI_WITH_CUDA_SUPPORT CACHE) -ENDIF() + set(DEAL_II_MPI_WITH_CUDA_SUPPORT) + unset(DEAL_II_MPI_WITH_CUDA_SUPPORT CACHE) +endif() diff --git a/cmake/configure/configure_10_taskflow.cmake b/cmake/configure/configure_10_taskflow.cmake index 8d389da435..9562900a86 100644 --- a/cmake/configure/configure_10_taskflow.cmake +++ b/cmake/configure/configure_10_taskflow.cmake @@ -22,58 +22,58 @@ # Disallow the default detection of taskflow for the time being to avoid # unpleasant surprises on user side. # -SET(DEAL_II_WITH_TASKFLOW OFF CACHE BOOL "") +set(DEAL_II_WITH_TASKFLOW OFF CACHE BOOL "") -MACRO(FEATURE_TASKFLOW_FIND_EXTERNAL var) - FIND_PACKAGE(TASKFLOW) +macro(FEATURE_TASKFLOW_FIND_EXTERNAL var) + find_package(TASKFLOW) - IF(TASKFLOW_FOUND) - SET(${var} TRUE) - ENDIF() + if(TASKFLOW_FOUND) + set(${var} TRUE) + endif() - IF(TASKFLOW_VERSION VERSION_LESS "2.4") + if(TASKFLOW_VERSION VERSION_LESS "2.4") # Clear the previously determined version numbers to avoid confusion - SET(TASKFLOW_VERSION "bundled") - SET(TASKFLOW_VERSION_MAJOR "") - SET(TASKFLOW_VERSION_MINOR "") + set(TASKFLOW_VERSION "bundled") + set(TASKFLOW_VERSION_MAJOR "") + set(TASKFLOW_VERSION_MINOR "") - MESSAGE(STATUS + message(STATUS "The externally provided Taskflow library is older than version 2.4, " "which cannot be used with deal.II." ) - SET(TASKFLOW_ADDITIONAL_ERROR_STRING + set(TASKFLOW_ADDITIONAL_ERROR_STRING "The externally provided Taskflow library is older than version\n" "2.4, which is the oldest version compatible with deal.II." ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - IF(NOT TASKFLOW_VERSION VERSION_LESS "3.0" AND NOT DEAL_II_HAVE_CXX17) + if(NOT TASKFLOW_VERSION VERSION_LESS "3.0" AND NOT DEAL_II_HAVE_CXX17) # Clear the previously determined version numbers to avoid confusion - SET(TASKFLOW_VERSION "bundled") - SET(TASKFLOW_VERSION_MAJOR "") - SET(TASKFLOW_VERSION_MINOR "") + set(TASKFLOW_VERSION "bundled") + set(TASKFLOW_VERSION_MAJOR "") + set(TASKFLOW_VERSION_MINOR "") - MESSAGE(STATUS + message(STATUS "The externally provided Taskflow library (version 3.0 onwards) requires C++17 support, which has not been configured." ) - SET(TASKFLOW_ADDITIONAL_ERROR_STRING + set(TASKFLOW_ADDITIONAL_ERROR_STRING "The externally provided Taskflow library (version 3.0 onwards) " "requires C++17 support, but no C++17 support had been detected " "during configuration.\n" "Try to set -DDEAL_II_CXX_FLAGS=\"-std=c++17\" by hand.\n" ) - SET(${var} FALSE) - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() +endmacro() -MACRO(FEATURE_TASKFLOW_CONFIGURE_BUNDLED) - LIST(APPEND TASKFLOW_BUNDLED_INCLUDE_DIRS ${TASKFLOW_FOLDER}/include) -ENDMACRO() +macro(FEATURE_TASKFLOW_CONFIGURE_BUNDLED) + list(APPEND TASKFLOW_BUNDLED_INCLUDE_DIRS ${TASKFLOW_FOLDER}/include) +endmacro() -CONFIGURE_FEATURE(TASKFLOW) +configure_feature(TASKFLOW) diff --git a/cmake/configure/configure_10_tbb.cmake b/cmake/configure/configure_10_tbb.cmake index ba36d0aa2f..ac8cc8cfc7 100644 --- a/cmake/configure/configure_10_tbb.cmake +++ b/cmake/configure/configure_10_tbb.cmake @@ -18,14 +18,14 @@ # library: # -MACRO(FEATURE_TBB_FIND_EXTERNAL var) - FIND_PACKAGE(TBB) +macro(FEATURE_TBB_FIND_EXTERNAL var) + find_package(TBB) - IF(TBB_FOUND) - SET(${var} TRUE) - ENDIF() + if(TBB_FOUND) + set(${var} TRUE) + endif() - SET(DEAL_II_TBB_WITH_ONEAPI ${TBB_WITH_ONEAPI}) + set(DEAL_II_TBB_WITH_ONEAPI ${TBB_WITH_ONEAPI}) # # TBB currently uses the version numbering scheme @@ -45,41 +45,41 @@ MACRO(FEATURE_TBB_FIND_EXTERNAL var) # (such as GCC 8.1 and newer). To fix this we simply disallow all older # versions: # - IF(TBB_VERSION VERSION_LESS "4.2") + if(TBB_VERSION VERSION_LESS "4.2") # Clear the previously determined version numbers to avoid confusion - SET(TBB_VERSION "bundled") - SET(TBB_VERSION_MAJOR "") - SET(TBB_VERSION_MINOR "") + set(TBB_VERSION "bundled") + set(TBB_VERSION_MAJOR "") + set(TBB_VERSION_MINOR "") - MESSAGE(STATUS + message(STATUS "The externally provided TBB library is older than version 4.2.0, which " "cannot be used with deal.II." ) - SET(TBB_ADDITIONAL_ERROR_STRING + set(TBB_ADDITIONAL_ERROR_STRING "The externally provided TBB library is older than version\n" "4.2.0, which is the oldest version compatible with deal.II and its\n" "supported compilers." ) - SET(${var} FALSE) - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() +endmacro() -MACRO(FEATURE_TBB_CONFIGURE_BUNDLED) +macro(FEATURE_TBB_CONFIGURE_BUNDLED) # # We have to disable a bunch of warnings: # - ENABLE_IF_SUPPORTED(TBB_CXX_FLAGS "-Wno-parentheses") + enable_if_supported(TBB_CXX_FLAGS "-Wno-parentheses") # # tbb uses dlopen/dlclose, so link against libdl.so as well: # - LIST(APPEND TBB_LIBRARIES ${CMAKE_DL_LIBS}) + list(APPEND TBB_LIBRARIES ${CMAKE_DL_LIBS}) - LIST(APPEND TBB_BUNDLED_INCLUDE_DIRS ${TBB_FOLDER}/include) + list(APPEND TBB_BUNDLED_INCLUDE_DIRS ${TBB_FOLDER}/include) - SET(DEAL_II_TBB_WITH_ONEAPI FALSE) -ENDMACRO() + set(DEAL_II_TBB_WITH_ONEAPI FALSE) +endmacro() -CONFIGURE_FEATURE(TBB) +configure_feature(TBB) diff --git a/cmake/configure/configure_10_zlib.cmake b/cmake/configure/configure_10_zlib.cmake index bcd33863b2..e3a89af2f5 100644 --- a/cmake/configure/configure_10_zlib.cmake +++ b/cmake/configure/configure_10_zlib.cmake @@ -17,4 +17,4 @@ # Configuration for the zlib library: # -CONFIGURE_FEATURE(ZLIB) +configure_feature(ZLIB) diff --git a/cmake/configure/configure_20_boost.cmake b/cmake/configure/configure_20_boost.cmake index 1919606eed..9559e1abb1 100644 --- a/cmake/configure/configure_20_boost.cmake +++ b/cmake/configure/configure_20_boost.cmake @@ -17,36 +17,36 @@ # Configuration for the boost library: # -IF(NOT FEATURE_ZLIB_PROCESSED) - MESSAGE(FATAL_ERROR "\n" +if(NOT FEATURE_ZLIB_PROCESSED) + message(FATAL_ERROR "\n" "Internal build system error: The configuration of " "DEAL_II_WITH_BOOST depends on " - "DEAL_II_WITH_ZLIB, but CONFIGURE_FEATURE(BOOST) " - "was called before CONFIGURE_FEATURE(ZLIB).\n\n" + "DEAL_II_WITH_ZLIB, but configure_feature(BOOST) " + "was called before configure_feature(ZLIB).\n\n" ) -ENDIF() +endif() -SET(DEAL_II_WITH_BOOST ON # Always true. We need it :-] +set(DEAL_II_WITH_BOOST ON # Always true. We need it :-] CACHE BOOL "Build deal.II with support for boost." FORCE ) -MACRO(FEATURE_BOOST_CONFIGURE_COMMON) +macro(FEATURE_BOOST_CONFIGURE_COMMON) # Some standard library implementations do not implement std::auto_ptr # (anymore) which was deprecated for C++11 and removed in the C++17 standard. # Older boost versions can't know about this but provide a possibility to # circumvent the issue. Hence, we just check ourselves. - IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "/WX /EHsc") - ELSE() - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "-Werror") - ENDIF() + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_flags(CMAKE_REQUIRED_FLAGS "/WX /EHsc") + else() + add_flags(CMAKE_REQUIRED_FLAGS "-Werror") + endif() # The configure function is called only once. In case an externally provided # boost library is detected, BOOST_INCLUDE_DIRS contains the include paths to # be used and BOOST_BUNDLED_INCLUDE_DIRS is empty. For the bundled library, it # is the other way around. - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS}) # In case, the boost library already sets BOOST_NO_AUTO_PTR we report # DEAL_II_HAS_AUTO_PTR to be true to avoid redefining the macro. @@ -66,19 +66,19 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON) " DEAL_II_HAS_AUTO_PTR) - RESET_CMAKE_REQUIRED() + reset_cmake_required() # Fix some problems by defining some additional preprocessor # symbols. Ultimately these are added into DEAL_II_DEFINITIONS and # DEAL_II_USER_DEFINITIONS. They are separate here so that they show up in # detailed.log under DEAL_II_WITH_BOOST as, logically, they are part of our # boost configuration. - IF(NOT DEAL_II_HAS_AUTO_PTR) - LIST(APPEND BOOST_DEFINITIONS "BOOST_NO_AUTO_PTR") - LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_AUTO_PTR") - ENDIF() + if(NOT DEAL_II_HAS_AUTO_PTR) + list(APPEND BOOST_DEFINITIONS "BOOST_NO_AUTO_PTR") + list(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_AUTO_PTR") + endif() - ENABLE_IF_SUPPORTED(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs") + enable_if_supported(BOOST_CXX_FLAGS "-Wno-unused-local-typedefs") # At least BOOST 1.74 has the problem that some of the BOOST headers # include other BOOST headers that are deprecated, and this then leads to @@ -88,9 +88,9 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON) # boost library is detected, BOOST_INCLUDE_DIRS contains the include paths to # be used and BOOST_BUNDLED_INCLUDE_DIRS is empty. For the bundled library, it # is the other way around. - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS}) - CHECK_CXX_COMPILER_BUG( + check_cxx_compiler_bug( " #define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED #define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\"); @@ -98,66 +98,66 @@ MACRO(FEATURE_BOOST_CONFIGURE_COMMON) int main() { return 0; } " DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS) - RESET_CMAKE_REQUIRED() -ENDMACRO() + reset_cmake_required() +endmacro() -MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED) +macro(FEATURE_BOOST_CONFIGURE_BUNDLED) # # Add rt to the link interface as well, boost/chrono needs it. # - IF(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") - FIND_SYSTEM_LIBRARY(rt_LIBRARY NAMES rt) - MARK_AS_ADVANCED(rt_LIBRARY) - IF(NOT rt_LIBRARY MATCHES "-NOTFOUND") - SET(BOOST_LIBRARIES ${rt_LIBRARY}) - ENDIF() - ENDIF() + if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + find_system_library(rt_LIBRARY NAMES rt) + mark_as_advanced(rt_LIBRARY) + if(NOT rt_LIBRARY MATCHES "-NOTFOUND") + set(BOOST_LIBRARIES ${rt_LIBRARY}) + endif() + endif() # We need to set this path before calling the configure function # to be able to use the include paths in the checks. - SET(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include) + set(BOOST_BUNDLED_INCLUDE_DIRS ${BOOST_FOLDER}/include) # # We still need the version information, which is set up in the FindBoost # module in the non-bundled case: # - FILE(STRINGS "${BOOST_BUNDLED_INCLUDE_DIRS}/boost/version.hpp" + file(STRINGS "${BOOST_BUNDLED_INCLUDE_DIRS}/boost/version.hpp" BOOST_VERSION_STRING REGEX "#define.*BOOST_VERSION") - STRING(REGEX REPLACE "^.*BOOST_VERSION.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*BOOST_VERSION.* ([0-9]+).*" "\\1" BOOST_VERSION_NUMBER "${BOOST_VERSION_STRING}" ) - MATH(EXPR Boost_MAJOR_VERSION "${BOOST_VERSION_NUMBER} / 100000") - MATH(EXPR Boost_MINOR_VERSION "${BOOST_VERSION_NUMBER} / 100 % 1000") - MATH(EXPR Boost_SUBMINOR_VERSION "${BOOST_VERSION_NUMBER} % 100") + math(EXPR Boost_MAJOR_VERSION "${BOOST_VERSION_NUMBER} / 100000") + math(EXPR Boost_MINOR_VERSION "${BOOST_VERSION_NUMBER} / 100 % 1000") + math(EXPR Boost_SUBMINOR_VERSION "${BOOST_VERSION_NUMBER} % 100") FEATURE_BOOST_CONFIGURE_COMMON() - IF(CMAKE_SYSTEM_NAME MATCHES "Windows") + if(CMAKE_SYSTEM_NAME MATCHES "Windows") # # Bundled boost tries to (dl)open itself as a dynamic library on # Windows. Disable this undesired behavior by exporting # BOOST_ALL_NO_LIB on Windows platforms (for bundled boost). # - LIST(APPEND BOOST_DEFINITIONS "BOOST_ALL_NO_LIB") - LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_ALL_NO_LIB") - ENDIF() -ENDMACRO() + list(APPEND BOOST_DEFINITIONS "BOOST_ALL_NO_LIB") + list(APPEND BOOST_USER_DEFINITIONS "BOOST_ALL_NO_LIB") + endif() +endmacro() -MACRO(FEATURE_BOOST_FIND_EXTERNAL var) - FIND_PACKAGE(BOOST) +macro(FEATURE_BOOST_FIND_EXTERNAL var) + find_package(BOOST) - IF(BOOST_FOUND) - SET(${var} TRUE) + if(BOOST_FOUND) + set(${var} TRUE) - IF(DEAL_II_WITH_ZLIB) + if(DEAL_II_WITH_ZLIB) # # Test that Boost.Iostreams is usable. # - RESET_CMAKE_REQUIRED() - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${BOOST_LIBRARIES}) - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS}) + reset_cmake_required() + list(APPEND CMAKE_REQUIRED_LIBRARIES ${BOOST_LIBRARIES}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES( " @@ -179,34 +179,34 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var) " BOOST_IOSTREAMS_USABLE ) - IF(NOT ${BOOST_IOSTREAMS_USABLE}) - MESSAGE(STATUS + if(NOT ${BOOST_IOSTREAMS_USABLE}) + message(STATUS "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled " "with zlib support but a simple test failed! " "Therefore, the bundled boost package is used." ) - SET(BOOST_ADDITIONAL_ERROR_STRING + set(BOOST_ADDITIONAL_ERROR_STRING "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled " "with zlib support but a simple test failed! " ) - SET(${var} FALSE) - ENDIF() - RESET_CMAKE_REQUIRED() - ENDIF() # DEAL_II_WITH_ZLIB + set(${var} FALSE) + endif() + reset_cmake_required() + endif() # DEAL_II_WITH_ZLIB - IF(${BOOST_VERSION} VERSION_LESS 1.74.0 AND DEAL_II_ALLOW_PLATFORM_INTROSPECTION) + if(${BOOST_VERSION} VERSION_LESS 1.74.0 AND DEAL_II_ALLOW_PLATFORM_INTROSPECTION) # # Test that Boost.Serialization is usable. # - IF(NOT DEFINED BOOST_SERIALIZATION_USABLE OR NOT ${BOOST_SERIALIZATION_USABLE}) + if(NOT DEFINED BOOST_SERIALIZATION_USABLE OR NOT ${BOOST_SERIALIZATION_USABLE}) # Only run this check if it hasn't successfully run previously. - MESSAGE(STATUS "Performing Test BOOST_SERIALIZATION_USABLE") + message(STATUS "Performing Test BOOST_SERIALIZATION_USABLE") - SET(_binary_test_dir ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBugWorkdir) + set(_binary_test_dir ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBugWorkdir) - FILE(REMOVE_RECURSE ${_binary_test_dir}) - FILE(MAKE_DIRECTORY ${_binary_test_dir}) - EXECUTE_PROCESS( + file(REMOVE_RECURSE ${_binary_test_dir}) + file(MAKE_DIRECTORY ${_binary_test_dir}) + execute_process( COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} @@ -221,61 +221,61 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var) OUTPUT_QUIET ERROR_QUIET ) - IF(${_result} EQUAL 0) - EXECUTE_PROCESS( + if(${_result} EQUAL 0) + execute_process( COMMAND ${CMAKE_COMMAND} --build . --target run WORKING_DIRECTORY ${_binary_test_dir} RESULT_VARIABLE _result OUTPUT_QUIET ERROR_QUIET ) - ENDIF() - IF(${_result} EQUAL 0) - MESSAGE(STATUS "Performing Test BOOST_SERIALIZATION_USABLE - Success") - SET(BOOST_SERIALIZATION_USABLE TRUE CACHE INTERNAL "") - ELSE() - MESSAGE(STATUS "Performing Test BOOST_SERIALIZATION_USABLE - Failed") - SET(BOOST_SERIALIZATION_USABLE FALSE) - ENDIF() - ENDIF() - - IF(NOT ${BOOST_SERIALIZATION_USABLE}) - MESSAGE(STATUS + endif() + if(${_result} EQUAL 0) + message(STATUS "Performing Test BOOST_SERIALIZATION_USABLE - Success") + set(BOOST_SERIALIZATION_USABLE TRUE CACHE INTERNAL "") + else() + message(STATUS "Performing Test BOOST_SERIALIZATION_USABLE - Failed") + set(BOOST_SERIALIZATION_USABLE FALSE) + endif() + endif() + + if(NOT ${BOOST_SERIALIZATION_USABLE}) + message(STATUS "The externally provided Boost.Serialization library " "failed to pass a crucial test. \n" "Therefore, the bundled boost package is used. \n" "The configured testing project can be found at \n" "${_binary_test_dir}" ) - SET(BOOST_ADDITIONAL_ERROR_STRING + set(BOOST_ADDITIONAL_ERROR_STRING "The externally provided Boost.Serialization library " "failed to pass a crucial test." ) - SET(${var} FALSE) - ENDIF() - ENDIF() # DEAL_II_ALLOW_PLATFORM_INTROSPECTION - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() + endif() # DEAL_II_ALLOW_PLATFORM_INTROSPECTION + endif() +endmacro() -MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL) +macro(FEATURE_BOOST_CONFIGURE_EXTERNAL) FEATURE_BOOST_CONFIGURE_COMMON() -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(BOOST) +configure_feature(BOOST) # # DEAL_II_WITH_BOOST is always required. # -IF(NOT DEAL_II_WITH_BOOST) - IF(DEAL_II_FEATURE_AUTODETECTION) - FEATURE_ERROR_MESSAGE("BOOST") - ELSE() - MESSAGE(FATAL_ERROR "\n" +if(NOT DEAL_II_WITH_BOOST) + if(DEAL_II_FEATURE_AUTODETECTION) + feature_error_message("BOOST") + else() + message(FATAL_ERROR "\n" "Unmet configuration requirements: " "DEAL_II_WITH_BOOST required, but set to OFF!\n\n" ) - ENDIF() -ENDIF() + endif() +endif() diff --git a/cmake/configure/configure_20_ginkgo.cmake b/cmake/configure/configure_20_ginkgo.cmake index 815a6c4085..c4b823362b 100644 --- a/cmake/configure/configure_20_ginkgo.cmake +++ b/cmake/configure/configure_20_ginkgo.cmake @@ -17,11 +17,11 @@ # Configuration for the Ginkgo library: # -MACRO(FEATURE_GINKGO_FIND_EXTERNAL var) - FIND_PACKAGE(GINKGO) +macro(FEATURE_GINKGO_FIND_EXTERNAL var) + find_package(GINKGO) - IF(GINKGO_FOUND) - SET(${var} TRUE) + if(GINKGO_FOUND) + set(${var} TRUE) # # We require at least version 1.4.0 @@ -29,19 +29,19 @@ MACRO(FEATURE_GINKGO_FIND_EXTERNAL var) # the LD_LIBRARY_PATH has to be set manually by: # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GINKGO_DIR/lib # - SET(_version_required 1.4.0) - IF(GINKGO_VERSION VERSION_LESS ${_version_required}) - MESSAGE(STATUS "Insufficient ginkgo installation found: " + set(_version_required 1.4.0) + if(GINKGO_VERSION VERSION_LESS ${_version_required}) + message(STATUS "Insufficient ginkgo installation found: " "At least version ${_version_required} is required." ) - SET(GINKGO_ADDITIONAL_ERROR_STRING + set(GINKGO_ADDITIONAL_ERROR_STRING "Insufficient ginkgo installation found!\n" "At least version ${_version_required} is required.\n" ) - SET(${var} FALSE) + set(${var} FALSE) - ENDIF() - ENDIF() -ENDMACRO() + endif() + endif() +endmacro() -CONFIGURE_FEATURE(GINKGO) +configure_feature(GINKGO) diff --git a/cmake/configure/configure_20_metis.cmake b/cmake/configure/configure_20_metis.cmake index e644e725a3..abea148b0d 100644 --- a/cmake/configure/configure_20_metis.cmake +++ b/cmake/configure/configure_20_metis.cmake @@ -13,31 +13,31 @@ ## ## --------------------------------------------------------------------- -SET(FEATURE_METIS_AFTER MPI) +set(FEATURE_METIS_AFTER MPI) # # Configuration for the metis library: # -MACRO(FEATURE_METIS_FIND_EXTERNAL var) - FIND_PACKAGE(METIS) +macro(FEATURE_METIS_FIND_EXTERNAL var) + find_package(METIS) - IF(METIS_FOUND) - SET(${var} TRUE) + if(METIS_FOUND) + set(${var} TRUE) - IF(NOT METIS_VERSION_MAJOR GREATER 4) - MESSAGE(STATUS "Insufficient metis installation found: " + if(NOT METIS_VERSION_MAJOR GREATER 4) + message(STATUS "Insufficient metis installation found: " "Version 5.x required!" ) - SET(METIS_ADDITIONAL_ERROR_STRING + set(METIS_ADDITIONAL_ERROR_STRING "Could not find a sufficiently modern metis installation: " "Version 5.x required!\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - CHECK_MPI_INTERFACE(METIS ${var}) - ENDIF() -ENDMACRO() + check_mpi_interface(METIS ${var}) + endif() +endmacro() -CONFIGURE_FEATURE(METIS) +configure_feature(METIS) diff --git a/cmake/configure/configure_20_trilinos.cmake b/cmake/configure/configure_20_trilinos.cmake index 2fb559f42c..01573fa071 100644 --- a/cmake/configure/configure_20_trilinos.cmake +++ b/cmake/configure/configure_20_trilinos.cmake @@ -17,100 +17,100 @@ # Configuration for the trilinos library: # -SET(FEATURE_TRILINOS_DEPENDS MPI) +set(FEATURE_TRILINOS_DEPENDS MPI) -MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) - FIND_PACKAGE(TRILINOS) +macro(FEATURE_TRILINOS_FIND_EXTERNAL var) + find_package(TRILINOS) - IF(TRILINOS_FOUND) + if(TRILINOS_FOUND) # # So, we have a library. Let's see whether we can use it: # - SET(${var} TRUE) + set(${var} TRUE) # # Set TRILINOS_DIR to something meaningful if empty # - IF("${TRILINOS_DIR}" STREQUAL "") - SET(TRILINOS_DIR "") - ENDIF() + if("${TRILINOS_DIR}" STREQUAL "") + set(TRILINOS_DIR "") + endif() # # Check whether all required modules of trilinos are installed: # - MESSAGE(STATUS + message(STATUS "Checking whether the found trilinos package contains all required modules:" ) - FOREACH(_module + foreach(_module Amesos Epetra Ifpack AztecOO Teuchos ML ) - ITEM_MATCHES(_module_found ${_module} ${Trilinos_PACKAGE_LIST}) - IF(_module_found) - MESSAGE(STATUS " Found ${_module}") - ELSE() - MESSAGE(STATUS " Module ${_module} not found!") - SET(_modules_missing "${_modules_missing} ${_module}") - SET(${var} FALSE) - ENDIF() - ENDFOREACH() - - IF(NOT ${var}) - MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " + item_matches(_module_found ${_module} ${Trilinos_PACKAGE_LIST}) + if(_module_found) + message(STATUS " Found ${_module}") + else() + message(STATUS " Module ${_module} not found!") + set(_modules_missing "${_modules_missing} ${_module}") + set(${var} FALSE) + endif() + endforeach() + + if(NOT ${var}) + message(STATUS "Could not find a sufficient Trilinos installation: " "Missing ${_modules_missing}" ) - SET(TRILINOS_ADDITIONAL_ERROR_STRING + set(TRILINOS_ADDITIONAL_ERROR_STRING "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n" "is missing one or more modules necessary for the deal.II Trilinos interfaces:\n" " ${_modules_missing}\n\n" "Please re-install Trilinos with the missing Trilinos subpackages enabled.\n\n" ) - ENDIF() + endif() # # We require at least Trilinos 12.4 # - IF(TRILINOS_VERSION VERSION_LESS 12.4) + if(TRILINOS_VERSION VERSION_LESS 12.4) - MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " + message(STATUS "Could not find a sufficient Trilinos installation: " "deal.II requires at least version 12.4, but version ${TRILINOS_VERSION} was found." ) - SET(TRILINOS_ADDITIONAL_ERROR_STRING + set(TRILINOS_ADDITIONAL_ERROR_STRING ${TRILINOS_ADDITIONAL_ERROR_STRING} "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n" "with version ${TRILINOS_VERSION} is too old.\n" "deal.II requires at least version 12.4.\n\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Trilinos has to be configured with the same MPI configuration as # deal.II. # - IF(NOT TRILINOS_WITH_MPI) - MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " + if(NOT TRILINOS_WITH_MPI) + message(STATUS "Could not find a sufficient Trilinos installation: " "Trilinos has to have MPI support enabled." ) - SET(TRILINOS_ADDITIONAL_ERROR_STRING + set(TRILINOS_ADDITIONAL_ERROR_STRING ${TRILINOS_ADDITIONAL_ERROR_STRING} "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n" "has to be configured with MPI support, but found:\n" " TRILINOS_WITH_MPI = ${TRILINOS_WITH_MPI}\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Trilinos has to be configured with 32bit indices if deal.II uses # unsigned int. # - IF(TRILINOS_WITH_NO_32BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES) - MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " + if(TRILINOS_WITH_NO_32BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES) + message(STATUS "Could not find a sufficient Trilinos installation: " "deal.II was configured to use 32bit global indices but " "Trilinos was not." ) - SET(TRILINOS_ADDITIONAL_ERROR_STRING + set(TRILINOS_ADDITIONAL_ERROR_STRING ${TRILINOS_ADDITIONAL_ERROR_STRING} "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n" "has to be configured to use the same number of bits as deal.II, but " @@ -118,19 +118,19 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) " DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n" " TRILINOS_WITH_NO_32BIT_INDICES = ${TRILINOS_WITH_NO_32_BIT_INDICES}\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Trilinos has to be configured with 64bit indices if deal.II uses # unsigned long long int. # - IF(TRILINOS_WITH_NO_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES) - MESSAGE(STATUS "Could not find a sufficient Trilinos installation: " + if(TRILINOS_WITH_NO_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES) + message(STATUS "Could not find a sufficient Trilinos installation: " "deal.II was configured to use 64bit global indices but " "Trilinos was not." ) - SET(TRILINOS_ADDITIONAL_ERROR_STRING + set(TRILINOS_ADDITIONAL_ERROR_STRING ${TRILINOS_ADDITIONAL_ERROR_STRING} "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n" "has to be configured to use the same number of bits as deal.II, but " @@ -138,88 +138,88 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) " DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n" " TRILINOS_WITH_NO_64BIT_INDICES = ${TRILINOS_WITH_NO_64_BIT_INDICES}\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - CHECK_MPI_INTERFACE(TRILINOS ${var}) + check_mpi_interface(TRILINOS ${var}) # # Check which optional features of trilinos are installed. # - IF (${var}) + if (${var}) # # Check for modules. # - FOREACH(_optional_module Belos EpetraExt Kokkos MueLu ROL Sacado SEACAS Tpetra Zoltan) - ITEM_MATCHES(_module_found ${_optional_module} ${Trilinos_PACKAGE_LIST}) - IF(_module_found) - MESSAGE(STATUS " Found ${_optional_module}") - STRING(TOUPPER "${_optional_module}" _optional_module_upper) - SET(DEAL_II_TRILINOS_WITH_${_optional_module_upper} ON) - ELSE() - MESSAGE(STATUS " Module ${_optional_module} not found!") - ENDIF() - ENDFOREACH() + foreach(_optional_module Belos EpetraExt Kokkos MueLu ROL Sacado SEACAS Tpetra Zoltan) + item_matches(_module_found ${_optional_module} ${Trilinos_PACKAGE_LIST}) + if(_module_found) + message(STATUS " Found ${_optional_module}") + string(TOUPPER "${_optional_module}" _optional_module_upper) + set(DEAL_II_TRILINOS_WITH_${_optional_module_upper} ON) + else() + message(STATUS " Module ${_optional_module} not found!") + endif() + endforeach() # # Check for third-party libraries (tpl). # - FOREACH(_optional_tpl MUMPS) - ITEM_MATCHES(_tpl_found ${_optional_tpl} ${Trilinos_TPL_LIST}) - IF(_tpl_found) - MESSAGE(STATUS " Found ${_optional_tpl}") - STRING(TOUPPER "${_optional_tpl}" _optional_tpl_upper) - SET(DEAL_II_TRILINOS_WITH_${_optional_tpl_upper} ON) - ELSE() - MESSAGE(STATUS " Module ${_optional_tpl} not found!") - ENDIF() - ENDFOREACH() - ENDIF() - - IF(DEAL_II_TRILINOS_WITH_KOKKOS) - IF(DEAL_II_FORCE_BUNDLED_KOKKOS) - SET(TRILINOS_ADDITIONAL_ERROR_STRING + foreach(_optional_tpl MUMPS) + item_matches(_tpl_found ${_optional_tpl} ${Trilinos_TPL_LIST}) + if(_tpl_found) + message(STATUS " Found ${_optional_tpl}") + string(TOUPPER "${_optional_tpl}" _optional_tpl_upper) + set(DEAL_II_TRILINOS_WITH_${_optional_tpl_upper} ON) + else() + message(STATUS " Module ${_optional_tpl} not found!") + endif() + endforeach() + endif() + + if(DEAL_II_TRILINOS_WITH_KOKKOS) + if(DEAL_II_FORCE_BUNDLED_KOKKOS) + set(TRILINOS_ADDITIONAL_ERROR_STRING ${TRILINOS_ADDITIONAL_ERROR_STRING} "The Trilinos installation (found at \"${TRILINOS_DIR}\")" "includes Kokkos, but DEAL_II_FORCE_BUNDLED_KOKKOS=ON!\n") - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - IF(Kokkos_ENABLE_CUDA) + if(Kokkos_ENABLE_CUDA) # We need to disable SIMD vectorization for CUDA device code. # Otherwise, nvcc compilers from version 9 on will emit an error message like: # "[...] contains a vector, which is not supported in device code". We # would like to set the variable in check_01_cpu_feature but at that point # we don't know if CUDA support is enabled in Kokkos - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) - ENDIF() + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) + endif() # We need a recent version of Trilinos to use kokkos_check. We want to use # VERSION_GREATER_EQUAL 13.0 but this requires CMake 3.7 - IF(TRILINOS_VERSION VERSION_GREATER 12.99 AND Kokkos_ENABLE_CUDA) + if(TRILINOS_VERSION VERSION_GREATER 12.99 AND Kokkos_ENABLE_CUDA) KOKKOS_CHECK(OPTIONS CUDA_LAMBDA) - ENDIF() - ENDIF() + endif() + endif() - IF(DEAL_II_TRILINOS_WITH_TPETRA) + if(DEAL_II_TRILINOS_WITH_TPETRA) # # Check if Tpetra is usable in fact. # - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES} ${MPI_LIBRARIES}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES} ${MPI_LIBRARIES}) # For the case of Trilinos being compiled with openmp support the # following Tpetra test needs -fopenmp to succeed. Make sure that we # supply the correct compiler and linker flags: - ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_LINKER_FLAGS}") + add_flags(CMAKE_REQUIRED_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_LINKER_FLAGS}") - IF(DEAL_II_WITH_64BIT_INDICES) - SET(_global_index_type "std::uint64_t") - ELSE() - SET(_global_index_type "unsigned int") - ENDIF() + if(DEAL_II_WITH_64BIT_INDICES) + set(_global_index_type "std::uint64_t") + else() + set(_global_index_type "unsigned int") + endif() CHECK_CXX_SOURCE_COMPILES( " @@ -240,25 +240,25 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) TRILINOS_TPETRA_IS_FUNCTIONAL ) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(NOT TRILINOS_TPETRA_IS_FUNCTIONAL) - MESSAGE( + if(NOT TRILINOS_TPETRA_IS_FUNCTIONAL) + message( STATUS "Tpetra was found but is not usable! Disabling Tpetra support." ) - SET(DEAL_II_TRILINOS_WITH_TPETRA OFF) - ENDIF() - ENDIF() + set(DEAL_II_TRILINOS_WITH_TPETRA OFF) + endif() + endif() - IF(DEAL_II_TRILINOS_WITH_MUELU) + if(DEAL_II_TRILINOS_WITH_MUELU) # # Check if MueLu is actually usable. # - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES} ${MPI_LIBRARIES}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES} ${MPI_LIBRARIES}) CHECK_CXX_SOURCE_COMPILES( " @@ -276,22 +276,22 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) TRILINOS_MUELU_IS_FUNCTIONAL ) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(NOT TRILINOS_MUELU_IS_FUNCTIONAL) - MESSAGE( + if(NOT TRILINOS_MUELU_IS_FUNCTIONAL) + message( STATUS "MueLu was found but is not usable through Epetra! Disabling MueLu support." ) - SET(DEAL_II_TRILINOS_WITH_MUELU OFF) - ENDIF() - ENDIF() + set(DEAL_II_TRILINOS_WITH_MUELU OFF) + endif() + endif() # the only thing we use from SEACAS right now is ExodusII, so just check # that it works - IF(${DEAL_II_TRILINOS_WITH_SEACAS}) - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES}) + if(${DEAL_II_TRILINOS_WITH_SEACAS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${Trilinos_LIBRARIES}) CHECK_CXX_SOURCE_COMPILES( " #include @@ -313,22 +313,22 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) TRILINOS_SEACAS_IS_FUNCTIONAL ) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(NOT TRILINOS_SEACAS_IS_FUNCTIONAL) - MESSAGE( + if(NOT TRILINOS_SEACAS_IS_FUNCTIONAL) + message( STATUS "SEACAS was found but doesn't seem to include ExodusII. Disabling SEACAS support." ) - SET(DEAL_II_TRILINOS_WITH_SEACAS OFF) - ENDIF() - ENDIF() + set(DEAL_II_TRILINOS_WITH_SEACAS OFF) + endif() + endif() - IF(${DEAL_II_TRILINOS_WITH_SACADO}) + if(${DEAL_II_TRILINOS_WITH_SACADO}) # # Look for Sacado_config.h - we'll query it to determine C++11 support: # - DEAL_II_FIND_FILE(SACADO_CONFIG_H Sacado_config.h + deal_ii_find_file(SACADO_CONFIG_H Sacado_config.h HINTS ${Trilinos_INCLUDE_DIRS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH @@ -344,14 +344,14 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) # # Test whether the compiler hits this issue # - DEAL_II_FIND_FILE(SACADO_TRAD_HPP Sacado_trad.hpp + deal_ii_find_file(SACADO_TRAD_HPP Sacado_trad.hpp HINTS ${Trilinos_INCLUDE_DIRS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) - IF(EXISTS ${SACADO_TRAD_HPP}) - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) + if(EXISTS ${SACADO_TRAD_HPP}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES( " @@ -366,50 +366,50 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var) " TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD ) - RESET_CMAKE_REQUIRED() - ENDIF() + reset_cmake_required() + endif() - ENDIF() - ENDIF() -ENDMACRO() + endif() + endif() +endmacro() -MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) - SET(DEAL_II_EXPAND_TRILINOS_SPARSITY_PATTERN "TrilinosWrappers::SparsityPattern") - SET(DEAL_II_EXPAND_TRILINOS_BLOCK_SPARSITY_PATTERN "TrilinosWrappers::BlockSparsityPattern") - SET(DEAL_II_EXPAND_TRILINOS_SPARSE_MATRICES +macro(FEATURE_TRILINOS_CONFIGURE_EXTERNAL) + set(DEAL_II_EXPAND_TRILINOS_SPARSITY_PATTERN "TrilinosWrappers::SparsityPattern") + set(DEAL_II_EXPAND_TRILINOS_BLOCK_SPARSITY_PATTERN "TrilinosWrappers::BlockSparsityPattern") + set(DEAL_II_EXPAND_TRILINOS_SPARSE_MATRICES "TrilinosWrappers::SparseMatrix" "TrilinosWrappers::BlockSparseMatrix") - SET(DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR "TrilinosWrappers::MPI::BlockVector") - SET(DEAL_II_EXPAND_TRILINOS_MPI_VECTOR "TrilinosWrappers::MPI::Vector") - SET(DEAL_II_EXPAND_EPETRA_VECTOR "LinearAlgebra::EpetraWrappers::Vector") - IF (${DEAL_II_TRILINOS_WITH_TPETRA}) - SET(DEAL_II_EXPAND_TPETRA_VECTOR_DOUBLE "LinearAlgebra::TpetraWrappers::Vector") - SET(DEAL_II_EXPAND_TPETRA_VECTOR_FLOAT "LinearAlgebra::TpetraWrappers::Vector") - IF (${DEAL_II_WITH_COMPLEX_NUMBERS}) - SET(DEAL_II_EXPAND_TPETRA_VECTOR_COMPLEX_DOUBLE "LinearAlgebra::TpetraWrappers::Vector>") - SET(DEAL_II_EXPAND_TPETRA_VECTOR_COMPLEX_FLOAT "LinearAlgebra::TpetraWrappers::Vector>") - ENDIF() - ENDIF() - IF(${DEAL_II_TRILINOS_WITH_SACADO}) + set(DEAL_II_EXPAND_TRILINOS_MPI_BLOCKVECTOR "TrilinosWrappers::MPI::BlockVector") + set(DEAL_II_EXPAND_TRILINOS_MPI_VECTOR "TrilinosWrappers::MPI::Vector") + set(DEAL_II_EXPAND_EPETRA_VECTOR "LinearAlgebra::EpetraWrappers::Vector") + if (${DEAL_II_TRILINOS_WITH_TPETRA}) + set(DEAL_II_EXPAND_TPETRA_VECTOR_DOUBLE "LinearAlgebra::TpetraWrappers::Vector") + set(DEAL_II_EXPAND_TPETRA_VECTOR_FLOAT "LinearAlgebra::TpetraWrappers::Vector") + if (${DEAL_II_WITH_COMPLEX_NUMBERS}) + set(DEAL_II_EXPAND_TPETRA_VECTOR_COMPLEX_DOUBLE "LinearAlgebra::TpetraWrappers::Vector>") + set(DEAL_II_EXPAND_TPETRA_VECTOR_COMPLEX_FLOAT "LinearAlgebra::TpetraWrappers::Vector>") + endif() + endif() + if(${DEAL_II_TRILINOS_WITH_SACADO}) # Note: Only CMake 3.0 and greater support line continuation with the "\" character # Elements of string lists are naturally separated by a ";" - SET(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD + set(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_FAD "Sacado::Fad::DFad" "Sacado::Fad::DFad" "Sacado::Fad::DFad>" "Sacado::Fad::DFad>") - SET(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD + set(DEAL_II_EXPAND_TRILINOS_SACADO_TYPES_RAD "Sacado::Rad::ADvar" "Sacado::Rad::ADvar" "Sacado::Rad::ADvar>" "Sacado::Rad::ADvar>") - IF (TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD) - SET(DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD ${TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD}) - ENDIF() - ENDIF() -ENDMACRO() + if (TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD) + set(DEAL_II_TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD ${TRILINOS_CXX_SUPPORTS_SACADO_COMPLEX_RAD}) + endif() + endif() +endmacro() -CONFIGURE_FEATURE(TRILINOS) +configure_feature(TRILINOS) diff --git a/cmake/configure/configure_20_umfpack.cmake b/cmake/configure/configure_20_umfpack.cmake index 4d8b171b79..8471406871 100644 --- a/cmake/configure/configure_20_umfpack.cmake +++ b/cmake/configure/configure_20_umfpack.cmake @@ -17,17 +17,17 @@ # Configuration for the umfpack library: # -SET(FEATURE_UMFPACK_DEPENDS LAPACK) +set(FEATURE_UMFPACK_DEPENDS LAPACK) -MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED) - SET(UMFPACK_BUNDLED_INCLUDE_DIRS +macro(FEATURE_UMFPACK_CONFIGURE_BUNDLED) + set(UMFPACK_BUNDLED_INCLUDE_DIRS ${UMFPACK_FOLDER}/UMFPACK/Include ${UMFPACK_FOLDER}/AMD/Include ) -ENDMACRO() +endmacro() -MACRO(FEATURE_UMFPACK_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" +macro(FEATURE_UMFPACK_ERROR_MESSAGE) + message(FATAL_ERROR "\n" "Could not find umfpack and supporting libraries!\n" "Please ensure that the libraries are installed on your computer.\n" "If the libraries are not at a default location, either provide some hints\n" @@ -41,6 +41,6 @@ MACRO(FEATURE_UMFPACK_ERROR_MESSAGE) "by setting DEAL_II_ALLOW_BUNDLED=ON or DEAL_II_FORCE_BUNDLED_UMFPACK=ON.\n" "(BLAS and LAPACK have to be installed for bundled UMFPACK to be available)\n\n" ) -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(UMFPACK) +configure_feature(UMFPACK) diff --git a/cmake/configure/configure_30_kokkos.cmake b/cmake/configure/configure_30_kokkos.cmake index b906bb4310..4f1e75ba27 100644 --- a/cmake/configure/configure_30_kokkos.cmake +++ b/cmake/configure/configure_30_kokkos.cmake @@ -17,32 +17,32 @@ # Configuration for Kokkos support in deal.II: # -SET(DEAL_II_WITH_KOKKOS ON # Always true. We need it :-] +set(DEAL_II_WITH_KOKKOS ON # Always true. We need it :-] CACHE BOOL "Build deal.II with support for Kokkos." FORCE ) -MACRO(FEATURE_KOKKOS_CONFIGURE_BUNDLED) - SET(KOKKOS_BUNDLED_INCLUDE_DIRS +macro(FEATURE_KOKKOS_CONFIGURE_BUNDLED) + set(KOKKOS_BUNDLED_INCLUDE_DIRS ${KOKKOS_FOLDER}/algorithms/src ${KOKKOS_FOLDER}/containers/src ${KOKKOS_FOLDER}/core/src ${KOKKOS_FOLDER}/simd/src ${KOKKOS_FOLDER}/tpls/desul/include ) -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(KOKKOS) +configure_feature(KOKKOS) # # DEAL_II_WITH_KOKKOS is always required. # -IF(NOT DEAL_II_WITH_KOKKOS) - IF(DEAL_II_FEATURE_AUTODETECTION) - FEATURE_ERROR_MESSAGE("KOKKOS") - ELSE() - MESSAGE(FATAL_ERROR "\n" +if(NOT DEAL_II_WITH_KOKKOS) + if(DEAL_II_FEATURE_AUTODETECTION) + feature_error_message("KOKKOS") + else() + message(FATAL_ERROR "\n" "Unmet configuration requirements: " "DEAL_II_WITH_KOKKOS required, but set to OFF!\n\n" ) - ENDIF() -ENDIF() + endif() +endif() diff --git a/cmake/configure/configure_30_petsc.cmake b/cmake/configure/configure_30_petsc.cmake index 08b8b0f79d..f8a85e0e47 100644 --- a/cmake/configure/configure_30_petsc.cmake +++ b/cmake/configure/configure_30_petsc.cmake @@ -17,31 +17,31 @@ # Configuration for the petsc library: # -SET(FEATURE_PETSC_AFTER MPI) +set(FEATURE_PETSC_AFTER MPI) -MACRO(FEATURE_PETSC_FIND_EXTERNAL var) - FIND_PACKAGE(PETSC) +macro(FEATURE_PETSC_FIND_EXTERNAL var) + find_package(PETSC) - IF(PETSC_FOUND) + if(PETSC_FOUND) # # So, we have found a petsc library. Let's check whether we can use it. # - SET(${var} TRUE) + set(${var} TRUE) # # We support petsc from version 3.7.x onwards # - IF(${PETSC_VERSION} VERSION_LESS 3.7.0) - MESSAGE(STATUS "Could not find a sufficiently modern PETSc installation: " + if(${PETSC_VERSION} VERSION_LESS 3.7.0) + message(STATUS "Could not find a sufficiently modern PETSc installation: " "Version >=3.7.0 required!" ) - SET(PETSC_ADDITIONAL_ERROR_STRING + set(PETSC_ADDITIONAL_ERROR_STRING "Could not find a sufficiently modern PETSc installation: " "Version >=3.7.0 required!\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Petsc has to be configured with the same MPI configuration as @@ -51,21 +51,21 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var) # _NOT_ enabled. # So we check for this: # - IF( (PETSC_WITH_MPIUNI AND DEAL_II_WITH_MPI) + if( (PETSC_WITH_MPIUNI AND DEAL_II_WITH_MPI) OR (NOT PETSC_WITH_MPIUNI AND NOT DEAL_II_WITH_MPI)) - MESSAGE(STATUS "Could not find a sufficient PETSc installation: " + message(STATUS "Could not find a sufficient PETSc installation: " "PETSc has to be configured with the same MPI configuration as deal.II." ) - SET(PETSC_ADDITIONAL_ERROR_STRING + set(PETSC_ADDITIONAL_ERROR_STRING ${PETSC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient PETSc installation:\n" "PETSc has to be configured with the same MPI configuration as deal.II, but found:\n" " DEAL_II_WITH_MPI = ${DEAL_II_WITH_MPI}\n" " PETSC_WITH_MPI = (NOT ${PETSC_WITH_MPIUNI})\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Petsc has to be configured with the same number of bits for indices as @@ -75,14 +75,14 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var) # indices support is enabled. # So we check for this: # - IF( (NOT PETSC_WITH_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES) + if( (NOT PETSC_WITH_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES) OR (PETSC_WITH_64BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES)) - MESSAGE(STATUS "Could not find a sufficient PETSc installation: " + message(STATUS "Could not find a sufficient PETSc installation: " "PETSc has to be configured to use the same number of bits for the " "global indices as deal.II." ) - SET(PETSC_ADDITIONAL_ERROR_STRING + set(PETSC_ADDITIONAL_ERROR_STRING ${PETSC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient PETSc installation:\n" "PETSc has to be configured to use the same number of bits for the " @@ -90,18 +90,18 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var) " DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n" " PETSC_WITH_64BIT_INDICES = (${PETSC_WITH_64BIT_INDICES})\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # If PETSc is compiled with complex scalar type we need to have support # for complex values within deal.II as well. # - IF( PETSC_WITH_COMPLEX AND NOT DEAL_II_WITH_COMPLEX_VALUES ) - MESSAGE(STATUS "The PETSc configuration is incompatible with the deal.II configuration: " + if( PETSC_WITH_COMPLEX AND NOT DEAL_II_WITH_COMPLEX_VALUES ) + message(STATUS "The PETSc configuration is incompatible with the deal.II configuration: " "PETSc is compiled with complex scalar type. " "This requires support for complex values in deal.II as well." ) - SET(PETSC_ADDITIONAL_ERROR_STRING + set(PETSC_ADDITIONAL_ERROR_STRING ${PETSC_ADDITIONAL_ERROR_STRING} "The PETSc configuration is incompatible with the deal.II configuration:\n" "PETSc is compiled with complex scalar type. " @@ -109,35 +109,35 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var) " DEAL_II_WITH_COMPLEX_VALUES = ${DEAL_II_WITH_COMPLEX_VALUES}\n" " PETSC_WITH_COMPLEX = (${PETSC_WITH_COMPLEX})\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - CHECK_MPI_INTERFACE(PETSC ${var}) - ENDIF() -ENDMACRO() + check_mpi_interface(PETSC ${var}) + endif() +endmacro() -MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL) - SET(DEAL_II_EXPAND_PETSC_MPI_VECTOR "PETScWrappers::MPI::Vector") - SET(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR "PETScWrappers::MPI::BlockVector") - SET(DEAL_II_EXPAND_PETSC_SPARSE_MATRICES +macro(FEATURE_PETSC_CONFIGURE_EXTERNAL) + set(DEAL_II_EXPAND_PETSC_MPI_VECTOR "PETScWrappers::MPI::Vector") + set(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR "PETScWrappers::MPI::BlockVector") + set(DEAL_II_EXPAND_PETSC_SPARSE_MATRICES "PETScWrappers::SparseMatrix" "PETScWrappers::MPI::SparseMatrix" "PETScWrappers::MPI::BlockSparseMatrix") # # FIXME: # temporary variable until deal.II fully support complex-valued PETSc - IF( NOT PETSC_WITH_COMPLEX ) - SET(DEAL_II_EXPAND_PETSC_MPI_VECTOR_REAL "PETScWrappers::MPI::Vector") - SET(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR_REAL "PETScWrappers::MPI::BlockVector") - ELSE() - MESSAGE(STATUS "Compiling with complex-valued algebra") - ENDIF() -ENDMACRO() + if( NOT PETSC_WITH_COMPLEX ) + set(DEAL_II_EXPAND_PETSC_MPI_VECTOR_REAL "PETScWrappers::MPI::Vector") + set(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR_REAL "PETScWrappers::MPI::BlockVector") + else() + message(STATUS "Compiling with complex-valued algebra") + endif() +endmacro() -MACRO(FEATURE_PETSC_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" +macro(FEATURE_PETSC_ERROR_MESSAGE) + message(FATAL_ERROR "\n" "Could not find the petsc library!\n" ${PETSC_ADDITIONAL_ERROR_STRING} "\nPlease ensure that the petsc library version 3.7.0 or newer is " @@ -153,10 +153,10 @@ MACRO(FEATURE_PETSC_ERROR_MESSAGE) " $ cmake -DPETSC_DIR=\"...\" -DPETSC_ARCH=\"...\" <...>\n" "or set the relevant variables by hand in ccmake.\n\n" ) -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(PETSC) -SET(DEAL_II_PETSC_WITH_COMPLEX ${PETSC_WITH_COMPLEX}) -SET(DEAL_II_PETSC_WITH_HYPRE ${PETSC_WITH_HYPRE}) -SET(DEAL_II_PETSC_WITH_MUMPS ${PETSC_WITH_MUMPS}) +configure_feature(PETSC) +set(DEAL_II_PETSC_WITH_COMPLEX ${PETSC_WITH_COMPLEX}) +set(DEAL_II_PETSC_WITH_HYPRE ${PETSC_WITH_HYPRE}) +set(DEAL_II_PETSC_WITH_MUMPS ${PETSC_WITH_MUMPS}) diff --git a/cmake/configure/configure_40_cuda.cmake b/cmake/configure/configure_40_cuda.cmake index 6b21a185dc..1e2f14f8c2 100644 --- a/cmake/configure/configure_40_cuda.cmake +++ b/cmake/configure/configure_40_cuda.cmake @@ -20,105 +20,105 @@ # # cuda support is experimental. Therefore, disable the feature per default: # -SET(DEAL_II_WITH_CUDA FALSE CACHE BOOL "") +set(DEAL_II_WITH_CUDA FALSE CACHE BOOL "") -MACRO(FEATURE_CUDA_FIND_EXTERNAL var) - IF(NOT Kokkos_ENABLE_CUDA) - SET(CUDA_ADDITIONAL_ERROR_STRING +macro(FEATURE_CUDA_FIND_EXTERNAL var) + if(NOT Kokkos_ENABLE_CUDA) + set(CUDA_ADDITIONAL_ERROR_STRING ${CUDA_ADDITIONAL_ERROR_STRING} "deal.II can only be compiled with Cuda support if Kokkos was built with Cuda support!" ) - SET(${var} FALSE) - ELSE() + set(${var} FALSE) + else() # FIXME We need to also find and link with cuSolver and cuSparse even though # relying on Kokkos for linking with Cuda. That's why we keep the code below for now. - # We need to set CUDA_USE_STATIC_CUDA_RUNTIME before FIND_PACKAGE(CUDA) and to - # force the value otherwise it is overwritten by FIND_PACKAGE(CUDA) - IF(BUILD_SHARED_LIBS) - SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE BOOL "" FORCE) - ENDIF() + # We need to set CUDA_USE_STATIC_CUDA_RUNTIME before find_package(CUDA) and to + # force the value otherwise it is overwritten by find_package(CUDA) + if(BUILD_SHARED_LIBS) + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE BOOL "" FORCE) + endif() # # TODO: Ultimately, this find_package call is not needed any more. We # still use it because it is very convenient to (a) check that CUDA is # installed, (b) get compiler path and include directories / libraries. # - FIND_PACKAGE(CUDA) + find_package(CUDA) - IF(CUDA_FOUND) + if(CUDA_FOUND) # # CUDA was found, check whether we can actually use it: # - SET(${var} TRUE) + set(${var} TRUE) # # CUDA support requires CMake version 3.9 or newer # - IF(CMAKE_VERSION VERSION_LESS 3.9) - SET(${var} FALSE) - MESSAGE(STATUS "deal.II requires CMake version 3.9, or newer for CUDA support") - SET(CUDA_ADDITIONAL_ERROR_STRING + if(CMAKE_VERSION VERSION_LESS 3.9) + set(${var} FALSE) + message(STATUS "deal.II requires CMake version 3.9, or newer for CUDA support") + set(CUDA_ADDITIONAL_ERROR_STRING ${CUDA_ADDITIONAL_ERROR_STRING} "deal.II requires CMake version 3.9, or newer for CUDA support.\n" "Reconfigure with a sufficient cmake version." ) - ENDIF() + endif() # # disable CUDA support older than 10.2: # - IF(CUDA_VERSION VERSION_LESS 10.2) - MESSAGE(FATAL_ERROR "\n" + if(CUDA_VERSION VERSION_LESS 10.2) + message(FATAL_ERROR "\n" "deal.II requires CUDA version 10.2 or newer." ) - ENDIF() + endif() # # CUDA Toolkit 10 is incompatible with C++17. # Make sure that deal.II is configured appropriately # - MACRO(_cuda_ensure_feature_off _version _cpp_version_bad _cpp_version_good) - IF(${CUDA_VERSION_MAJOR} EQUAL ${_version}) - IF(${DEAL_II_HAVE_CXX${_cpp_version_bad}}) - SET(${var} FALSE) - MESSAGE(STATUS "CUDA ${_version} requires ${_feature} to be set to off.") - SET(CUDA_ADDITIONAL_ERROR_STRING + macro(_cuda_ensure_feature_off _version _cpp_version_bad _cpp_version_good) + if(${CUDA_VERSION_MAJOR} EQUAL ${_version}) + if(${DEAL_II_HAVE_CXX${_cpp_version_bad}}) + set(${var} FALSE) + message(STATUS "CUDA ${_version} requires ${_feature} to be set to off.") + set(CUDA_ADDITIONAL_ERROR_STRING ${CUDA_ADDITIONAL_ERROR_STRING} "CUDA ${_version} is not compatible with the C++${_cpp_version_bad} standard.\n" "Please explicitly set the standard version to C++${_cpp_version_good}, e.g. by reconfiguring with\n" " cmake -DDEAL_II_CXX_FLAGS=\"-std=c++${_cpp_version_good}\" ." ) - ENDIF() - ENDIF() - ENDMACRO() + endif() + endif() + endmacro() _cuda_ensure_feature_off(10 17 14) # cuSOLVER requires OpenMP - FIND_PACKAGE(OpenMP REQUIRED) - SET(DEAL_II_LINKER_FLAGS "${DEAL_II_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") - ENDIF() - ENDIF() -ENDMACRO() + find_package(OpenMP REQUIRED) + set(DEAL_II_LINKER_FLAGS "${DEAL_II_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + endif() + endif() +endmacro() -MACRO(FEATURE_CUDA_CONFIGURE_EXTERNAL) +macro(FEATURE_CUDA_CONFIGURE_EXTERNAL) # We cannot use -pedantic as compiler flags. nvcc generates code that # produces a lot of warnings when pedantic is enabled. So filter out the # flag: # - STRING(REPLACE "-pedantic" "" DEAL_II_CXX_FLAGS "${DEAL_II_CXX_FLAGS}") -ENDMACRO() + string(REPLACE "-pedantic" "" DEAL_II_CXX_FLAGS "${DEAL_II_CXX_FLAGS}") +endmacro() -MACRO(FEATURE_CUDA_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" +macro(FEATURE_CUDA_ERROR_MESSAGE) + message(FATAL_ERROR "\n" "Could not find any suitable cuda library!\n" ${CUDA_ADDITIONAL_ERROR_STRING} "\nPlease ensure that a cuda library is installed on your computer\n" ) -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(CUDA) +configure_feature(CUDA) diff --git a/cmake/configure/configure_50_adolc.cmake b/cmake/configure/configure_50_adolc.cmake index 00dadb6208..a958fae298 100644 --- a/cmake/configure/configure_50_adolc.cmake +++ b/cmake/configure/configure_50_adolc.cmake @@ -17,56 +17,56 @@ # Configuration for the ADOL-C library: # -SET(FEATURE_ADOLC_AFTER BOOST TRILINOS) +set(FEATURE_ADOLC_AFTER BOOST TRILINOS) -MACRO(FEATURE_ADOLC_FIND_EXTERNAL var) - FIND_PACKAGE(ADOLC) +macro(FEATURE_ADOLC_FIND_EXTERNAL var) + find_package(ADOLC) - IF(ADOLC_FOUND) + if(ADOLC_FOUND) # # So, we have a library. Let's see whether we can use it: # - SET(${var} TRUE) + set(${var} TRUE) # # If Adolc is configured to use the Boost allocator (of an external # boost library) we must not use a bundled Boost library for deal.II. # - IF(ADOLC_WITH_BOOST_ALLOCATOR AND FEATURE_BOOST_BUNDLED_CONFIGURED) - MESSAGE(STATUS + if(ADOLC_WITH_BOOST_ALLOCATOR AND FEATURE_BOOST_BUNDLED_CONFIGURED) + message(STATUS "Could not find a sufficient ADOL-C installation: " "ADOL-C links against external Boost but deal.II was configured " "with bundled Boost." ) - SET(ADOLC_ADDITIONAL_ERROR_STRING + set(ADOLC_ADDITIONAL_ERROR_STRING ${ADOLC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient ADOL-C installation:\n" "ADOL-C links against external Boost but deal.II was configured " "with bundled Boost.\n\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # We have to avoid a symbol clash with Trilinos' SEACASChaco library # (the libchaco.so shared object exports the global symbol 'divide' but # so does adolc itself). # - ITEM_MATCHES(_module_found SEACASChaco ${Trilinos_PACKAGE_LIST}) - IF(_module_found) - MESSAGE(STATUS + item_matches(_module_found SEACASChaco ${Trilinos_PACKAGE_LIST}) + if(_module_found) + message(STATUS "Could not find a sufficient ADOL-C installation: " "Possible symbol clash between the ADOL-C library and Trilinos' SEACASChaco detected" ) - SET(ADOLC_ADDITIONAL_ERROR_STRING + set(ADOLC_ADDITIONAL_ERROR_STRING ${ADOLC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient ADOL-C installation:\n" "Possible symbol clash between the ADOL-C library and Trilinos' SEACASChaco detected." "If you want to use ADOL-C, please configure deal.II to use a " "Trilinos library with disabled SEACASChaco.\n\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # We have to avoid another symbol clash with the netcdf library that @@ -74,13 +74,13 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var) # object exports the global symbol 'function' but so does adolc # itself). # - IF("${Trilinos_TPL_LIBRARIES}" MATCHES "netcdf") - MESSAGE(STATUS + if("${Trilinos_TPL_LIBRARIES}" MATCHES "netcdf") + message(STATUS "Could not find a sufficient ADOL-C installation: " "Possible symbol clash between the ADOL-C library and netcdf " "(pulled in as optional external dependency of Trilinos) detected" ) - SET(ADOLC_ADDITIONAL_ERROR_STRING + set(ADOLC_ADDITIONAL_ERROR_STRING ${ADOLC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient ADOL-C installation:\n" "Possible symbol clash between the ADOL-C library and netcdf " @@ -88,16 +88,16 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var) "If you want to use ADOL-C, please configure deal.II to use a " "Trilinos library with disabled netcdf bindings.\n\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Check whether we have a recent enough ADOL-C library that can return # values from constant objects. # - LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${ADOLC_LIBRARIES}) - LIST(APPEND CMAKE_REQUIRED_INCLUDES ${ADOLC_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${ADOLC_LIBRARIES}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${ADOLC_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES(" #include @@ -128,47 +128,47 @@ MACRO(FEATURE_ADOLC_FIND_EXTERNAL var) }" ADOLC_ADOUBLE_OSTREAM_CHECK) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(NOT ADOLC_DOUBLE_CAST_CHECK) - MESSAGE(STATUS + if(NOT ADOLC_DOUBLE_CAST_CHECK) + message(STATUS "Could not find a sufficient ADOL-C installation: " "deal.II needs ADOL-C version 2.6.4 or newer." ) - SET(ADOLC_ADDITIONAL_ERROR_STRING + set(ADOLC_ADDITIONAL_ERROR_STRING ${ADOLC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient ADOL-C installation:\n" "ADOL-C cast check failed.\n" "deal.II needs ADOL-C version 2.6.4 or newer.\n\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - IF(NOT ADOLC_ADOUBLE_OSTREAM_CHECK) - MESSAGE(STATUS + if(NOT ADOLC_ADOUBLE_OSTREAM_CHECK) + message(STATUS "Could not find a sufficient ADOL-C installation: " "deal.II needs ADOL-C version 2.6.4 or newer." ) - SET(ADOLC_ADDITIONAL_ERROR_STRING + set(ADOLC_ADDITIONAL_ERROR_STRING ${ADOLC_ADDITIONAL_ERROR_STRING} "Could not find a sufficient ADOL-C installation:\n" "ADOL-C stream output check failed.\n" "deal.II needs ADOL-C version 2.6.4 or newer.\n\n" ) - SET(${var} FALSE) - ENDIF() - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() + endif() +endmacro() -MACRO(FEATURE_ADOLC_CONFIGURE_EXTERNAL) - SET(DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING ${ADOLC_WITH_ADVANCED_BRANCHING}) - SET(DEAL_II_ADOLC_WITH_ATRIG_ERF ${ADOLC_WITH_ATRIG_ERF}) - SET(DEAL_II_ADOLC_WITH_TAPELESS_REFCOUNTING ${ADOLC_WITH_TAPELESS_REFCOUNTING}) - SET(DEAL_II_ADOLC_WITH_BOOST_ALLOCATOR ${ADOLC_WITH_BOOST_ALLOCATOR}) +macro(FEATURE_ADOLC_CONFIGURE_EXTERNAL) + set(DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING ${ADOLC_WITH_ADVANCED_BRANCHING}) + set(DEAL_II_ADOLC_WITH_ATRIG_ERF ${ADOLC_WITH_ATRIG_ERF}) + set(DEAL_II_ADOLC_WITH_TAPELESS_REFCOUNTING ${ADOLC_WITH_TAPELESS_REFCOUNTING}) + set(DEAL_II_ADOLC_WITH_BOOST_ALLOCATOR ${ADOLC_WITH_BOOST_ALLOCATOR}) - SET(DEAL_II_EXPAND_ADOLC_TYPES "adouble; adtl::adouble") -ENDMACRO() + set(DEAL_II_EXPAND_ADOLC_TYPES "adouble; adtl::adouble") +endmacro() -CONFIGURE_FEATURE(ADOLC) +configure_feature(ADOLC) diff --git a/cmake/configure/configure_50_arborx.cmake b/cmake/configure/configure_50_arborx.cmake index dcb116867a..c9d08aca80 100644 --- a/cmake/configure/configure_50_arborx.cmake +++ b/cmake/configure/configure_50_arborx.cmake @@ -17,6 +17,6 @@ # Configuration for ArborX support in deal.II: # -SET(FEATURE_ARBORX_DEPENDS KOKKOS) +set(FEATURE_ARBORX_DEPENDS KOKKOS) -CONFIGURE_FEATURE(ARBORX) +configure_feature(ARBORX) diff --git a/cmake/configure/configure_50_arpack.cmake b/cmake/configure/configure_50_arpack.cmake index 3bc7a09bf3..3cd533af1f 100644 --- a/cmake/configure/configure_50_arpack.cmake +++ b/cmake/configure/configure_50_arpack.cmake @@ -17,7 +17,7 @@ # Configuration for the ARPACK library: # -SET(FEATURE_ARPACK_DEPENDS LAPACK) +set(FEATURE_ARPACK_DEPENDS LAPACK) -CONFIGURE_FEATURE(ARPACK) -SET(DEAL_II_ARPACK_WITH_PARPACK ${ARPACK_WITH_PARPACK}) +configure_feature(ARPACK) +set(DEAL_II_ARPACK_WITH_PARPACK ${ARPACK_WITH_PARPACK}) diff --git a/cmake/configure/configure_50_assimp.cmake b/cmake/configure/configure_50_assimp.cmake index 84391ecb4b..1942666396 100644 --- a/cmake/configure/configure_50_assimp.cmake +++ b/cmake/configure/configure_50_assimp.cmake @@ -17,4 +17,4 @@ # Configuration for the ASSIMP library: # -CONFIGURE_FEATURE(ASSIMP) +configure_feature(ASSIMP) diff --git a/cmake/configure/configure_50_cgal.cmake b/cmake/configure/configure_50_cgal.cmake index 0b2331d7de..bfabcdb0d2 100644 --- a/cmake/configure/configure_50_cgal.cmake +++ b/cmake/configure/configure_50_cgal.cmake @@ -17,55 +17,55 @@ # Configuration for the CGAL library: # -IF(NOT FEATURE_BOOST_PROCESSED) - MESSAGE(FATAL_ERROR "\n" +if(NOT FEATURE_BOOST_PROCESSED) + message(FATAL_ERROR "\n" "Internal build system error: The configuration of " "DEAL_II_WITH_CGAL depends on " - "DEAL_II_WITH_BOOST, but CONFIGURE_FEATURE(CGAL) " - "was called before CONFIGURE_FEATURE(BOOST).\n\n" + "DEAL_II_WITH_BOOST, but configure_feature(CGAL) " + "was called before configure_feature(BOOST).\n\n" ) -ENDIF() +endif() -MACRO(FEATURE_CGAL_FIND_EXTERNAL var) - FIND_PACKAGE(CGAL) +macro(FEATURE_CGAL_FIND_EXTERNAL var) + find_package(CGAL) - IF(CGAL_FOUND) - SET(${var} TRUE) - ENDIF() + if(CGAL_FOUND) + set(${var} TRUE) + endif() # # CGAL requires an full, externally installed Boost library. We can thus # not configure our internal boost and try to use CGAL at the same time. # - IF(FEATURE_BOOST_BUNDLED_CONFIGURED) - MESSAGE(STATUS + if(FEATURE_BOOST_BUNDLED_CONFIGURED) + message(STATUS "Could not find a sufficient CGAL installation: " "CGAL links against external Boost but deal.II was configured " "with bundled Boost." ) - SET(CGAL_ADDITIONAL_ERROR_STRING + set(CGAL_ADDITIONAL_ERROR_STRING ${CGAL_ADDITIONAL_ERROR_STRING} "Could not find a sufficient CGAL installation:\n" "CGAL links against external Boost but deal.II was configured " "with bundled Boost.\n\n" ) - SET(${var} FALSE) - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() +endmacro() -MACRO(FEATURE_CGAL_CONFIGURE_EXTERNAL) +macro(FEATURE_CGAL_CONFIGURE_EXTERNAL) # Similarly to the DEAL_II_BOOST_HAS_BROKEN_HEADER_DEPRECATIONS check run # in configure_20_boost.cmake we have to check whether cgal includes # a deprecated boost header. If yes, disable the boost deprecated header # warning as well. - LIST(APPEND CMAKE_REQUIRED_INCLUDES + list(APPEND CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIRS} ${BOOST_BUNDLED_INCLUDE_DIRS} ${CGAL_INCLUDE_DIRS} ) - CHECK_CXX_COMPILER_BUG( + check_cxx_compiler_bug( " #define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED #define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\"); @@ -74,7 +74,7 @@ MACRO(FEATURE_CGAL_CONFIGURE_EXTERNAL) " DEAL_II_CGAL_HAS_DEPRECATED_BOOST_INCLUDES) - RESET_CMAKE_REQUIRED() -ENDMACRO() + reset_cmake_required() +endmacro() -CONFIGURE_FEATURE(CGAL) +configure_feature(CGAL) diff --git a/cmake/configure/configure_50_complex_values.cmake b/cmake/configure/configure_50_complex_values.cmake index b868cc5e49..f69eda13c5 100644 --- a/cmake/configure/configure_50_complex_values.cmake +++ b/cmake/configure/configure_50_complex_values.cmake @@ -17,30 +17,30 @@ # Configuration for complex value support # -IF(${DEAL_II_WITH_COMPLEX_VALUES}) - SET(DEAL_II_EXPAND_COMPLEX_SCALARS +if(${DEAL_II_WITH_COMPLEX_VALUES}) + set(DEAL_II_EXPAND_COMPLEX_SCALARS "std::complex" "std::complex" ) - SET(DEAL_II_EXPAND_COMPLEX_VECTORS + set(DEAL_II_EXPAND_COMPLEX_VECTORS "Vector >" "Vector >" ) - SET(DEAL_II_EXPAND_COMPLEX_BLOCK_VECTORS + set(DEAL_II_EXPAND_COMPLEX_BLOCK_VECTORS "BlockVector >" "BlockVector >" ) - SET(DEAL_II_EXPAND_COMPLEX_LA_VECTORS + set(DEAL_II_EXPAND_COMPLEX_LA_VECTORS "LinearAlgebra::Vector >" "LinearAlgebra::Vector >" ) - SET(DEAL_II_EXPAND_COMPLEX_LA_PARALLEL_VECTORS + set(DEAL_II_EXPAND_COMPLEX_LA_PARALLEL_VECTORS "LinearAlgebra::distributed::Vector >" "LinearAlgebra::distributed::Vector >" ) - SET(DEAL_II_EXPAND_COMPLEX_LA_PARALLEL_BLOCK_VECTORS + set(DEAL_II_EXPAND_COMPLEX_LA_PARALLEL_BLOCK_VECTORS "LinearAlgebra::distributed::BlockVector >" "LinearAlgebra::distributed::BlockVector >" ) -ENDIF() +endif() diff --git a/cmake/configure/configure_50_gmsh.cmake b/cmake/configure/configure_50_gmsh.cmake index e4764802a3..53f93ea485 100644 --- a/cmake/configure/configure_50_gmsh.cmake +++ b/cmake/configure/configure_50_gmsh.cmake @@ -17,5 +17,5 @@ # Configuration for the gmsh executable: # -CONFIGURE_FEATURE(GMSH) -SET(DEAL_II_GMSH_WITH_API ${GMSH_WITH_API}) +configure_feature(GMSH) +set(DEAL_II_GMSH_WITH_API ${GMSH_WITH_API}) diff --git a/cmake/configure/configure_50_gsl.cmake b/cmake/configure/configure_50_gsl.cmake index d7b31b9b09..90d219746c 100644 --- a/cmake/configure/configure_50_gsl.cmake +++ b/cmake/configure/configure_50_gsl.cmake @@ -17,4 +17,4 @@ # Configuration for the GSL library: # -CONFIGURE_FEATURE(GSL) +configure_feature(GSL) diff --git a/cmake/configure/configure_50_hdf5.cmake b/cmake/configure/configure_50_hdf5.cmake index 7d2b39cab3..e4475a661d 100644 --- a/cmake/configure/configure_50_hdf5.cmake +++ b/cmake/configure/configure_50_hdf5.cmake @@ -17,28 +17,28 @@ # Configuration for the hdf5 library: # -SET(FEATURE_HDF5_DEPENDS MPI) +set(FEATURE_HDF5_DEPENDS MPI) -MACRO(FEATURE_HDF5_FIND_EXTERNAL var) - FIND_PACKAGE(HDF5) +macro(FEATURE_HDF5_FIND_EXTERNAL var) + find_package(HDF5) - IF(HDF5_FOUND) - SET(${var} TRUE) + if(HDF5_FOUND) + set(${var} TRUE) - IF(NOT HDF5_IS_PARALLEL) - MESSAGE(STATUS "Insufficient hdf5 installation found: " + if(NOT HDF5_IS_PARALLEL) + message(STATUS "Insufficient hdf5 installation found: " "hdf5 has to be configured with MPI support." ) - SET(HDF5_ADDITIONAL_ERROR_STRING + set(HDF5_ADDITIONAL_ERROR_STRING "Insufficient hdf5 installation found!\n" "hdf5 has to be configured with MPI support.\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - CHECK_MPI_INTERFACE(HDF5 ${var}) - ENDIF() -ENDMACRO() + check_mpi_interface(HDF5 ${var}) + endif() +endmacro() -CONFIGURE_FEATURE(HDF5) +configure_feature(HDF5) diff --git a/cmake/configure/configure_50_muparser.cmake b/cmake/configure/configure_50_muparser.cmake index 00bb3ded33..22a95f895f 100644 --- a/cmake/configure/configure_50_muparser.cmake +++ b/cmake/configure/configure_50_muparser.cmake @@ -17,9 +17,9 @@ # Configuration for the MUPARSER library: # -MACRO(FEATURE_MUPARSER_CONFIGURE_BUNDLED) - SET(MUPARSER_BUNDLED_INCLUDE_DIRS ${MUPARSER_FOLDER}/include) -ENDMACRO() +macro(FEATURE_MUPARSER_CONFIGURE_BUNDLED) + set(MUPARSER_BUNDLED_INCLUDE_DIRS ${MUPARSER_FOLDER}/include) +endmacro() -CONFIGURE_FEATURE(MUPARSER) +configure_feature(MUPARSER) diff --git a/cmake/configure/configure_50_opencascade.cmake b/cmake/configure/configure_50_opencascade.cmake index 7f37d9d049..7095746f20 100644 --- a/cmake/configure/configure_50_opencascade.cmake +++ b/cmake/configure/configure_50_opencascade.cmake @@ -17,4 +17,4 @@ # Configuration for the OpenCASCADE library: # -CONFIGURE_FEATURE(OPENCASCADE) +configure_feature(OPENCASCADE) diff --git a/cmake/configure/configure_50_p4est.cmake b/cmake/configure/configure_50_p4est.cmake index e29c1d53c5..abaee83158 100644 --- a/cmake/configure/configure_50_p4est.cmake +++ b/cmake/configure/configure_50_p4est.cmake @@ -17,68 +17,68 @@ # Configuration for the p4est and sc libraries: # -SET(FEATURE_P4EST_DEPENDS MPI) +set(FEATURE_P4EST_DEPENDS MPI) -MACRO(FEATURE_P4EST_FIND_EXTERNAL var) - FIND_PACKAGE(P4EST) +macro(FEATURE_P4EST_FIND_EXTERNAL var) + find_package(P4EST) - IF(P4EST_FOUND) - SET(${var} TRUE) + if(P4EST_FOUND) + set(${var} TRUE) # # We require at least version 2.0 # - SET(_version_required 2.0) - IF(P4EST_VERSION VERSION_LESS ${_version_required}) - MESSAGE(STATUS "Insufficient p4est installation found: " + set(_version_required 2.0) + if(P4EST_VERSION VERSION_LESS ${_version_required}) + message(STATUS "Insufficient p4est installation found: " "At least version ${_version_required} is required." ) - SET(P4EST_ADDITIONAL_ERROR_STRING + set(P4EST_ADDITIONAL_ERROR_STRING "Insufficient p4est installation found!\n" "At least version ${_version_required} is required.\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Check whether p4est supports mpi: # - IF(NOT P4EST_WITH_MPI) - MESSAGE(STATUS "Insufficient p4est installation found: " + if(NOT P4EST_WITH_MPI) + message(STATUS "Insufficient p4est installation found: " "p4est has to be configured with MPI enabled." ) - SET(P4EST_ADDITIONAL_ERROR_STRING + set(P4EST_ADDITIONAL_ERROR_STRING ${P4EST_ADDITIONAL_ERROR_STRING} "Insufficient p4est installation found!\n" "p4est has to be configured with MPI enabled.\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() # # Check whether p4est is built against zlib: # - IF(NOT P4EST_WITH_ZLIB) - MESSAGE(STATUS "Insufficient p4est installation found: " + if(NOT P4EST_WITH_ZLIB) + message(STATUS "Insufficient p4est installation found: " "p4est has to be configured with enabled zlib support." ) - SET(P4EST_ADDITIONAL_ERROR_STRING + set(P4EST_ADDITIONAL_ERROR_STRING ${P4EST_ADDITIONAL_ERROR_STRING} "Insufficient p4est installation found!\n" "p4est has to be configured with enabled zlib support.\n" ) - SET(${var} FALSE) - ENDIF() + set(${var} FALSE) + endif() - CHECK_MPI_INTERFACE(P4EST ${var}) - ENDIF() -ENDMACRO() + check_mpi_interface(P4EST ${var}) + endif() +endmacro() -MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL) - SET(DEAL_II_P4EST_WITH_VTK_BINARY ${P4EST_WITH_VTK_BINARY}) - SET(DEAL_II_P4EST_WITH_SEARCH_LOCAL ${P4EST_WITH_SEARCH_LOCAL}) -ENDMACRO() +macro(FEATURE_P4EST_CONFIGURE_EXTERNAL) + set(DEAL_II_P4EST_WITH_VTK_BINARY ${P4EST_WITH_VTK_BINARY}) + set(DEAL_II_P4EST_WITH_SEARCH_LOCAL ${P4EST_WITH_SEARCH_LOCAL}) +endmacro() -CONFIGURE_FEATURE(P4EST) +configure_feature(P4EST) diff --git a/cmake/configure/configure_50_scalapack.cmake b/cmake/configure/configure_50_scalapack.cmake index 9f91262788..2e09aea955 100644 --- a/cmake/configure/configure_50_scalapack.cmake +++ b/cmake/configure/configure_50_scalapack.cmake @@ -17,19 +17,19 @@ # Configuration for the SCALAPACK library: # -SET(FEATURE_SCALAPACK_DEPENDS MPI LAPACK) +set(FEATURE_SCALAPACK_DEPENDS MPI LAPACK) -MACRO(FEATURE_SCALAPACK_FIND_EXTERNAL var) - FIND_PACKAGE(SCALAPACK) +macro(FEATURE_SCALAPACK_FIND_EXTERNAL var) + find_package(SCALAPACK) - IF(SCALAPACK_FOUND) - SET(${var} TRUE) - CHECK_MPI_INTERFACE(SCALAPACK ${var}) + if(SCALAPACK_FOUND) + set(${var} TRUE) + check_mpi_interface(SCALAPACK ${var}) - IF (${var}) - CLEAR_CMAKE_REQUIRED() - SET(CMAKE_REQUIRED_LIBRARIES ${SCALAPACK_LIBRARIES} ${LAPACK_LIBRARIES}) + if (${var}) + clear_cmake_required() + set(CMAKE_REQUIRED_LIBRARIES ${SCALAPACK_LIBRARIES} ${LAPACK_LIBRARIES}) CHECK_C_SOURCE_COMPILES(" void pdsyevr_(); void pssyevr_(); @@ -39,13 +39,13 @@ MACRO(FEATURE_SCALAPACK_FIND_EXTERNAL var) return 0; }" DEAL_II_SCALAPACK_HAS_PDSYEVR_PSSYEVR) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(NOT DEAL_II_SCALAPACK_HAS_PDSYEVR_PSSYEVR) - MESSAGE(STATUS "Could not find a sufficient SCALAPACK installation: " + if(NOT DEAL_II_SCALAPACK_HAS_PDSYEVR_PSSYEVR) + message(STATUS "Could not find a sufficient SCALAPACK installation: " "The required symbols pdsyevr_ and pssyevr_ were not found." ) - SET(SCALAPACK_ADDITIONAL_ERROR_STRING + set(SCALAPACK_ADDITIONAL_ERROR_STRING ${SCALAPACK_ADDITIONAL_ERROR_STRING} "Could not find a sufficient SCALAPACK installation: \n" "SCALAPACK symbol check for pdsyevr_ and pssyevr_ failed! " @@ -54,10 +54,10 @@ MACRO(FEATURE_SCALAPACK_FIND_EXTERNAL var) " CMakeFiles/CMakeError.log\n" "for further information.\n" ) - SET(${var} FALSE) - ENDIF() - ENDIF() - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() + endif() + endif() +endmacro() -CONFIGURE_FEATURE(SCALAPACK) +configure_feature(SCALAPACK) diff --git a/cmake/configure/configure_50_slepc.cmake b/cmake/configure/configure_50_slepc.cmake index 9f607f8506..940a15153d 100644 --- a/cmake/configure/configure_50_slepc.cmake +++ b/cmake/configure/configure_50_slepc.cmake @@ -17,41 +17,41 @@ # Configuration for the SLEPC library: # -SET(FEATURE_SLEPC_DEPENDS PETSC) +set(FEATURE_SLEPC_DEPENDS PETSC) -MACRO(FEATURE_SLEPC_FIND_EXTERNAL var) - FIND_PACKAGE(SLEPC) +macro(FEATURE_SLEPC_FIND_EXTERNAL var) + find_package(SLEPC) - IF(SLEPC_FOUND) + if(SLEPC_FOUND) # # Check whether SLEPc and PETSc are compatible according to # SLEPc's rules: This is equivalent to asking if the VERSION_MAJOR # and VERSION_MINOR of PETSc and SLEPc are # equivalent; and where VERSION_SUBMINORs are allowed to differ. # - IF( ("${SLEPC_VERSION_MAJOR}" STREQUAL "${PETSC_VERSION_MAJOR}") + if( ("${SLEPC_VERSION_MAJOR}" STREQUAL "${PETSC_VERSION_MAJOR}") AND ("${SLEPC_VERSION_MINOR}" STREQUAL "${PETSC_VERSION_MINOR}")) - SET(${var} TRUE) - ELSE() + set(${var} TRUE) + else() - MESSAGE(STATUS "Could not find a sufficient SLEPc installation: " + message(STATUS "Could not find a sufficient SLEPc installation: " "The SLEPc library must have the same version as the PETSc library." ) - SET(SLEPC_ADDITIONAL_ERROR_STRING + set(SLEPC_ADDITIONAL_ERROR_STRING "Could not find a sufficient SLEPc installation: " "The SLEPc library must have the same version as the PETSc library.\n" ) - SET(${var} FALSE) - ENDIF() - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() + endif() +endmacro() -MACRO(FEATURE_SLEPC_ERROR_MESSAGE) - MESSAGE(FATAL_ERROR "\n" +macro(FEATURE_SLEPC_ERROR_MESSAGE) + message(FATAL_ERROR "\n" "Could not find the SLEPc library!\n" ${SLEPC_ADDITIONAL_ERROR_STRING} "Please ensure that the SLEPc library version 3.0.0 or newer is installed on your computer\n" @@ -66,7 +66,7 @@ MACRO(FEATURE_SLEPC_ERROR_MESSAGE) " $ cmake -DSLEPC_DIR=\"...\"\n" "or set the relevant variables by hand in ccmake.\n\n" ) -ENDMACRO() +endmacro() -CONFIGURE_FEATURE(SLEPC) +configure_feature(SLEPC) diff --git a/cmake/configure/configure_50_sundials.cmake b/cmake/configure/configure_50_sundials.cmake index fa22c76ef9..34a5a9350b 100644 --- a/cmake/configure/configure_50_sundials.cmake +++ b/cmake/configure/configure_50_sundials.cmake @@ -17,34 +17,34 @@ # Configuration for the SUNDIALS library: # -MACRO(FEATURE_SUNDIALS_FIND_EXTERNAL var) - FIND_PACKAGE(SUNDIALS) +macro(FEATURE_SUNDIALS_FIND_EXTERNAL var) + find_package(SUNDIALS) - IF(SUNDIALS_FOUND) - SET(${var} TRUE) + if(SUNDIALS_FOUND) + set(${var} TRUE) # # We require at least sundials 5.4.0 # - SET(_version_required 5.4.0) - IF(SUNDIALS_VERSION VERSION_LESS ${_version_required}) - MESSAGE(STATUS "Could not find a sufficient Sundials installation: " + set(_version_required 5.4.0) + if(SUNDIALS_VERSION VERSION_LESS ${_version_required}) + message(STATUS "Could not find a sufficient Sundials installation: " "deal.II requires at least version ${_version_required}, " "but version ${SUNDIALS_VERSION} was found." ) - SET(SUNDIALS_ADDITIONAL_ERROR_STRING + set(SUNDIALS_ADDITIONAL_ERROR_STRING ${SUNDIALS_ADDITIONAL_ERROR_STRING} "The SUNDIALS installation (found at \"${SUNDIALS_DIR}\")\n" "with version ${SUNDIALS_VERSION} is too old.\n" "deal.II requires at least version ${_version_required}.\n\n" ) - SET(${var} FALSE) - ENDIF() - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() + endif() +endmacro() -MACRO(FEATURE_SUNDIALS_CONFIGURE_EXTERNAL) - SET(DEAL_II_SUNDIALS_WITH_IDAS ${SUNDIALS_WITH_IDAS}) -ENDMACRO() +macro(FEATURE_SUNDIALS_CONFIGURE_EXTERNAL) + set(DEAL_II_SUNDIALS_WITH_IDAS ${SUNDIALS_WITH_IDAS}) +endmacro() -CONFIGURE_FEATURE(SUNDIALS) +configure_feature(SUNDIALS) diff --git a/cmake/configure/configure_50_symengine.cmake b/cmake/configure/configure_50_symengine.cmake index 9a061c8b13..f02b30069d 100644 --- a/cmake/configure/configure_50_symengine.cmake +++ b/cmake/configure/configure_50_symengine.cmake @@ -18,46 +18,46 @@ # -MACRO(FEATURE_SYMENGINE_FIND_EXTERNAL var) - FIND_PACKAGE(SYMENGINE) +macro(FEATURE_SYMENGINE_FIND_EXTERNAL var) + find_package(SYMENGINE) - IF(SYMENGINE_FOUND) - SET(${var} TRUE) + if(SYMENGINE_FOUND) + set(${var} TRUE) # # We require at least version 0.6 of the symengine library: # - SET(_version_required "0.6") + set(_version_required "0.6") - IF(SYMENGINE_VERSION VERSION_LESS ${_version_required}) - MESSAGE(STATUS "Insufficient SymEngine installation found: " + if(SYMENGINE_VERSION VERSION_LESS ${_version_required}) + message(STATUS "Insufficient SymEngine installation found: " "At least version ${_version_required} is required " "but version ${SYMENGINE_VERSION} was found." ) - SET(SYMENGINE_ADDITIONAL_ERROR_STRING + set(SYMENGINE_ADDITIONAL_ERROR_STRING "Insufficient SymEngine installation found!\n" "At least version ${_version_required} is required " "but version ${SYMENGINE_VERSION} was found.\n" ) - SET(${var} FALSE) - ENDIF() - ENDIF() -ENDMACRO() + set(${var} FALSE) + endif() + endif() +endmacro() -MACRO(FEATURE_SYMENGINE_CONFIGURE_EXTERNAL) - SET(DEAL_II_SYMENGINE_WITH_LLVM ${SYMENGINE_WITH_LLVM}) +macro(FEATURE_SYMENGINE_CONFIGURE_EXTERNAL) + set(DEAL_II_SYMENGINE_WITH_LLVM ${SYMENGINE_WITH_LLVM}) - IF(DEAL_II_SYMENGINE_WITH_LLVM) - MESSAGE(STATUS "Configured with SymEngine LLVM capabilities.") - ENDIF() + if(DEAL_II_SYMENGINE_WITH_LLVM) + message(STATUS "Configured with SymEngine LLVM capabilities.") + endif() # # Overwrite the compiler flags imported from SymEngine # - SET(SYMENGINE_CXX_FLAGS) - SET(SYMENGINE_CXX_FLAGS_DEBUG) - SET(SYMENGINE_CXX_FLAGS_RELEASE) -ENDMACRO() + set(SYMENGINE_CXX_FLAGS) + set(SYMENGINE_CXX_FLAGS_DEBUG) + set(SYMENGINE_CXX_FLAGS_RELEASE) +endmacro() -CONFIGURE_FEATURE(SYMENGINE) +configure_feature(SYMENGINE) diff --git a/cmake/configure/configure_50_vectorization.cmake b/cmake/configure/configure_50_vectorization.cmake index eafb3329d2..6e2d0abe4c 100644 --- a/cmake/configure/configure_50_vectorization.cmake +++ b/cmake/configure/configure_50_vectorization.cmake @@ -18,23 +18,23 @@ # -SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED "VectorizedArray" "VectorizedArray") -SET(DEAL_II_EXPAND_FLOAT_VECTORIZED "VectorizedArray") +set(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED "VectorizedArray" "VectorizedArray") +set(DEAL_II_EXPAND_FLOAT_VECTORIZED "VectorizedArray") -IF(${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 0) - SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED +if(${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 0) + set(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED "${DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED}" "VectorizedArray" "VectorizedArray") - SET(DEAL_II_EXPAND_FLOAT_VECTORIZED "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray") -ENDIF() + set(DEAL_II_EXPAND_FLOAT_VECTORIZED "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray") +endif() -IF((${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 128)) - SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED +if((${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 128)) + set(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED "${DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED}" "VectorizedArray" "VectorizedArray") - SET(DEAL_II_EXPAND_FLOAT_VECTORIZED "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray") -ENDIF() + set(DEAL_II_EXPAND_FLOAT_VECTORIZED "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray") +endif() -IF((${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 256)) - SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED +if((${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 256)) + set(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED "${DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED}" "VectorizedArray" "VectorizedArray") - SET(DEAL_II_EXPAND_FLOAT_VECTORIZED "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray") -ENDIF() + set(DEAL_II_EXPAND_FLOAT_VECTORIZED "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray") +endif() diff --git a/cmake/macros/macro_add_flags.cmake b/cmake/macros/macro_add_flags.cmake index 54069daed5..20548e4ec6 100644 --- a/cmake/macros/macro_add_flags.cmake +++ b/cmake/macros/macro_add_flags.cmake @@ -18,14 +18,14 @@ # string "${variable}" # # Usage: -# ADD_FLAGS(variable flags) +# add_flags(variable flags) # -MACRO(ADD_FLAGS _variable _flags) - STRING(STRIP "${_flags}" _flags_stripped) - IF(NOT "${_flags_stripped}" STREQUAL "") - SET(${_variable} "${${_variable}} ${_flags}") - STRING(STRIP "${${_variable}}" ${_variable}) - ENDIF() -ENDMACRO() +macro(ADD_FLAGS _variable _flags) + string(STRIP "${_flags}" _flags_stripped) + if(NOT "${_flags_stripped}" STREQUAL "") + set(${_variable} "${${_variable}} ${_flags}") + string(STRIP "${${_variable}}" ${_variable}) + endif() +endmacro() diff --git a/cmake/macros/macro_check_compiler_setup.cmake b/cmake/macros/macro_check_compiler_setup.cmake index 59d7e9dceb..a39b2df093 100644 --- a/cmake/macros/macro_check_compiler_setup.cmake +++ b/cmake/macros/macro_check_compiler_setup.cmake @@ -15,7 +15,7 @@ # # Usage: -# CHECK_COMPILER_SETUP("compiler flag string" "linker flag string" _var +# check_compiler_setup("compiler flag string" "linker flag string" _var # [libraries] # ) # @@ -25,37 +25,37 @@ # ${_var} is set to true, otherwise it is set to false. # -MACRO(CHECK_COMPILER_SETUP _compiler_flags_unstr _linker_flags_unstr _var) +macro(CHECK_COMPILER_SETUP _compiler_flags_unstr _linker_flags_unstr _var) # # Strip leading and trailing whitespace to make CMake 2.8.8 happy # - STRING(STRIP "${_compiler_flags_unstr}" _compiler_flags) - STRING(STRIP "${_linker_flags_unstr}" _linker_flags) + string(STRIP "${_compiler_flags_unstr}" _compiler_flags) + string(STRIP "${_linker_flags_unstr}" _linker_flags) # # Rerun this test if flags have changed: # - IF(NOT "${_compiler_flags}" STREQUAL "${CACHED_${_var}_compiler_flags}" + if(NOT "${_compiler_flags}" STREQUAL "${CACHED_${_var}_compiler_flags}" OR NOT "${_linker_flags}" STREQUAL "${CACHED_${_var}_linker_flags}" OR NOT "${ARGN}" STREQUAL "${CACHED_${_var}_ARGN}") - UNSET(${_var} CACHE) - ENDIF() + unset(${_var} CACHE) + endif() - SET(CACHED_${_var}_compiler_flags "${_compiler_flags}" + set(CACHED_${_var}_compiler_flags "${_compiler_flags}" CACHE INTERNAL "" FORCE ) - SET(CACHED_${_var}_linker_flags "${_linker_flags}" + set(CACHED_${_var}_linker_flags "${_linker_flags}" CACHE INTERNAL "" FORCE ) - SET(CACHED_${_var}_ARGN "${ARGN}" CACHE INTERNAL "" FORCE) + set(CACHED_${_var}_ARGN "${ARGN}" CACHE INTERNAL "" FORCE) - SET(CMAKE_REQUIRED_FLAGS "${_compiler_flags} ${_linker_flags}") - SET(CMAKE_REQUIRED_LIBRARIES ${ARGN}) + set(CMAKE_REQUIRED_FLAGS "${_compiler_flags} ${_linker_flags}") + set(CMAKE_REQUIRED_LIBRARIES ${ARGN}) CHECK_CXX_SOURCE_COMPILES("int main(){ return 0; }" ${_var}) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(${_var}) - SET(${_var} TRUE CACHE INTERNAL "") - ENDIF() -ENDMACRO() + if(${_var}) + set(${_var} TRUE CACHE INTERNAL "") + endif() +endmacro() diff --git a/cmake/macros/macro_check_cxx_compiler_bug.cmake b/cmake/macros/macro_check_cxx_compiler_bug.cmake index 37fd56ba52..0c84d317f5 100644 --- a/cmake/macros/macro_check_cxx_compiler_bug.cmake +++ b/cmake/macros/macro_check_cxx_compiler_bug.cmake @@ -17,30 +17,30 @@ # Check for a compiler bug. # # Usage: -# CHECK_CXX_COMPILER_BUG(source var), +# check_cxx_compiler_bug(source var), # # where source is a snipped of source code and var is a variable that will # be set to true if the source could not be compiled and linked successfully. # (This just inverts the logic of CHECK_CXX_SOURCE_COMPILES.) # -MACRO(CHECK_CXX_COMPILER_BUG _source _var) - IF(NOT DEFINED ${_var}_OK) +macro(CHECK_CXX_COMPILER_BUG _source _var) + if(NOT DEFINED ${_var}_OK) CHECK_CXX_SOURCE_COMPILES( "${_source}" ${_var}_OK ) - IF(${_var}_OK) - MESSAGE(STATUS "Test successful, do not define ${_var}") - ELSE() - MESSAGE(STATUS "Test unsuccessful, define ${_var}") - ENDIF() - ENDIF() + if(${_var}_OK) + message(STATUS "Test successful, do not define ${_var}") + else() + message(STATUS "Test unsuccessful, define ${_var}") + endif() + endif() - IF(${_var}_OK) - SET(${_var}) - ELSE() - SET(${_var} TRUE) - ENDIF() -ENDMACRO() + if(${_var}_OK) + set(${_var}) + else() + set(${_var} TRUE) + endif() +endmacro() diff --git a/cmake/macros/macro_check_mpi_interface.cmake b/cmake/macros/macro_check_mpi_interface.cmake index 5108660c9f..bb8641ec8e 100644 --- a/cmake/macros/macro_check_mpi_interface.cmake +++ b/cmake/macros/macro_check_mpi_interface.cmake @@ -18,43 +18,43 @@ # one deal.II picked up # # Usage: -# CHECK_MPI_INTERFACE(_feature _var), +# check_mpi_interface(_feature _var), # -MACRO(CHECK_MPI_INTERFACE _feature _var) - IF(DEAL_II_WITH_MPI AND MPI_LIBRARIES) +macro(CHECK_MPI_INTERFACE _feature _var) + if(DEAL_II_WITH_MPI AND MPI_LIBRARIES) - SET(_nope FALSE) + set(_nope FALSE) - FOREACH(_library ${${_feature}_LIBRARIES}) - IF( _library MATCHES "/libmpi\\.(a|so)[^/]*$") + foreach(_library ${${_feature}_LIBRARIES}) + if( _library MATCHES "/libmpi\\.(a|so)[^/]*$") - GET_FILENAME_COMPONENT(_file1 ${_library} REALPATH) + get_filename_component(_file1 ${_library} REALPATH) - SET(_not_found TRUE) - FOREACH(_mpi_library ${MPI_LIBRARIES}) - GET_FILENAME_COMPONENT(_file2 ${_mpi_library} REALPATH) - IF("${_file1}" STREQUAL "${_file2}") - SET(_not_found FALSE) - BREAK() - ENDIF() - ENDFOREACH() + set(_not_found TRUE) + foreach(_mpi_library ${MPI_LIBRARIES}) + get_filename_component(_file2 ${_mpi_library} REALPATH) + if("${_file1}" STREQUAL "${_file2}") + set(_not_found FALSE) + break() + endif() + endforeach() - IF(_not_found) - SET(_nope TRUE) - SET(_spurious_library ${_library}) - BREAK() - ENDIF() - ENDIF() - ENDFOREACH() + if(_not_found) + set(_nope TRUE) + set(_spurious_library ${_library}) + break() + endif() + endif() + endforeach() - IF(_nope) - MESSAGE(STATUS "Could not find a sufficient ${_feature} installation: " + if(_nope) + message(STATUS "Could not find a sufficient ${_feature} installation: " "${_feature} is compiled against a different MPI library than the one " "deal.II picked up." ) - TO_STRING(_str ${MPI_LIBRARIES}) - SET(${_feature}_ADDITIONAL_ERROR_STRING + to_string(_str ${MPI_LIBRARIES}) + set(${_feature}_ADDITIONAL_ERROR_STRING ${${_feature}_ADDITIONAL_ERROR_STRING} "Could not find a sufficient ${_feature} installation:\n" "${_feature} has to be compiled against the same MPI library as deal.II " @@ -63,8 +63,8 @@ MACRO(CHECK_MPI_INTERFACE _feature _var) "which is not listed in MPI_LIBRARIES:\n" " MPI_LIBRARIES = \"${_str}\"\n" ) - SET(${_var} FALSE) - ENDIF() - ENDIF() -ENDMACRO() + set(${_var} FALSE) + endif() + endif() +endmacro() diff --git a/cmake/macros/macro_clear_cmake_required.cmake b/cmake/macros/macro_clear_cmake_required.cmake index 959fa5ba88..bafbf463e6 100644 --- a/cmake/macros/macro_clear_cmake_required.cmake +++ b/cmake/macros/macro_clear_cmake_required.cmake @@ -20,9 +20,9 @@ # CLEAR_CMAKE_REQUIRED_FLAGS # -MACRO(CLEAR_CMAKE_REQUIRED) - SET(CMAKE_REQUIRED_FLAGS) - SET(CMAKE_REQUIRED_INCLUDES) - SET(CMAKE_REQUIRED_LIBRARIES) -ENDMACRO() +macro(CLEAR_CMAKE_REQUIRED) + set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) +endmacro() diff --git a/cmake/macros/macro_clear_feature.cmake b/cmake/macros/macro_clear_feature.cmake index b71f6b00ea..94bf551a39 100644 --- a/cmake/macros/macro_clear_feature.cmake +++ b/cmake/macros/macro_clear_feature.cmake @@ -18,17 +18,17 @@ # all individual FEATURE_* configuration variables for a given feature. # # Usage: -# CLEAR_FEATURE(feature) +# clear_feature(feature) # # and all other suffixes defined in DEAL_II_LIST_SUFFIXES and # DEAL_II_STRING_SUFFIXES to the corresponding DEAL_II_* variables # -MACRO(CLEAR_FEATURE _feature) - FOREACH(_var ${DEAL_II_LIST_SUFFIXES}) +macro(CLEAR_FEATURE _feature) + foreach(_var ${DEAL_II_LIST_SUFFIXES}) unset(${_feature}_${_var}) - ENDFOREACH() - FOREACH(_var ${DEAL_II_STRING_SUFFIXES}) + endforeach() + foreach(_var ${DEAL_II_STRING_SUFFIXES}) unset(${_feature}_${_var}) - ENDFOREACH() -ENDMACRO() + endforeach() +endmacro() diff --git a/cmake/macros/macro_configure_feature.cmake b/cmake/macros/macro_configure_feature.cmake index 9283f0f257..62a807186b 100644 --- a/cmake/macros/macro_configure_feature.cmake +++ b/cmake/macros/macro_configure_feature.cmake @@ -17,7 +17,7 @@ # This macro is used for the feature configuration in deal.II # # Usage: -# CONFIGURE_FEATURE(feature) +# configure_feature(feature) # # # This macro uses the following optional variables and macros: @@ -48,13 +48,13 @@ # fulfilled. In this case all necessary variables for # FEATURE_${feature}_CONFIGURE_EXTERNAL must be set. Otherwise # var should remain unset. -# If not defined, FIND_PACKAGE(${feature}) is called. +# If not defined, find_package(${feature}) is called. # # FEATURE_${feature}_CONFIGURE_EXTERNAL() (macro) # which should setup all necessary configuration for the feature with # external dependencies. # -# FEATURE_${feature}_ERROR_MESSAGE() (macro) +# FEATURE_${feature}_ERROR_message() (macro) # which should print a meaningful error message (with FATAL_ERROR) for # the case that no usable library was found. # If not defined, a suitable default error message will be printed. @@ -71,45 +71,45 @@ # # A small macro to set the DEAL_II_WITH_${_feature} variables: # -MACRO(SET_CACHED_OPTION _str _value) - STRING(TOLOWER "${_str}" _str_lower) - SET(DEAL_II_WITH_${_str} +macro(SET_CACHED_OPTION _str _value) + string(TOLOWER "${_str}" _str_lower) + set(DEAL_II_WITH_${_str} ${_value} CACHE BOOL "Build deal.II with support for ${_str_lower}." FORCE) -ENDMACRO() +endmacro() # # A small macro to post a default error message: # -MACRO(FEATURE_ERROR_MESSAGE _feature) - STRING(TOLOWER ${_feature} _feature_lowercase) +macro(FEATURE_ERROR_MESSAGE _feature) + string(TOLOWER ${_feature} _feature_lowercase) - IF(DEFINED ${_feature}_DIR) - SET(_hint_snippet " + if(DEFINED ${_feature}_DIR) + set(_hint_snippet " $ ${_feature}_DIR=\"...\" cmake <...> $ cmake -D${_feature}_DIR=\"...\" <...> or set the relevant variables by hand in ccmake." ) - ELSE() - SET(_hint_snippet + else() + set(_hint_snippet " or set the relevant variables by hand in ccmake." ) - ENDIF() + endif() - IF(FEATURE_${_feature}_HAVE_BUNDLED) - SET(_bundled_snippet + if(FEATURE_${_feature}_HAVE_BUNDLED) + set(_bundled_snippet "\nAlternatively you may choose to compile the bundled library of " "${_feature_lowercase} by setting DEAL_II_ALLOW_BUNDLED=on or " "DEAL_II_FORCE_BUNDLED_${_feature}=on.\n" ) - ELSE() - SET(_bundled_snippet "\n") - ENDIF() + else() + set(_bundled_snippet "\n") + endif() - MESSAGE(FATAL_ERROR "\n" + message(FATAL_ERROR "\n" "Could not find the ${_feature_lowercase} library!\n" ${${_feature}_ADDITIONAL_ERROR_STRING} "Please ensure that a suitable ${_feature_lowercase} library is installed on your computer.\n" @@ -117,18 +117,18 @@ or set the relevant variables by hand in ccmake." "for autodetection,${_hint_snippet}" ${_bundled_snippet} ) -ENDMACRO() +endmacro() # # Default macro for finding an external library: # -MACRO(FEATURE_FIND_EXTERNAL _feature _var) - FIND_PACKAGE(${_feature}) - IF(${_feature}_FOUND) - SET(${_var} TRUE) - ENDIF() -ENDMACRO() +macro(FEATURE_FIND_EXTERNAL _feature _var) + find_package(${_feature}) + if(${_feature}_FOUND) + set(${_var} TRUE) + endif() +endmacro() ######################################################################## @@ -137,12 +137,12 @@ ENDMACRO() # # ######################################################################## -MACRO(CONFIGURE_FEATURE _feature) +macro(CONFIGURE_FEATURE _feature) # # Register the feature in the DEAL_II_FEATURES list # - LIST(APPEND DEAL_II_FEATURES ${_feature}) + list(APPEND DEAL_II_FEATURES ${_feature}) # # This script is arcane black magic. But at least for the better good: We @@ -156,137 +156,137 @@ MACRO(CONFIGURE_FEATURE _feature) # depends on feature A, configure_A.cmake has to be included before # configure_B.cmake: # - FOREACH(_dependency + foreach(_dependency ${FEATURE_${_feature}_AFTER} ${FEATURE_${_feature}_DEPENDS} ) - IF(NOT FEATURE_${_dependency}_PROCESSED) - MESSAGE(FATAL_ERROR "\n" + if(NOT FEATURE_${_dependency}_PROCESSED) + message(FATAL_ERROR "\n" "Internal build system error: The configuration of " "DEAL_II_WITH_${_feature} depends on " - "DEAL_II_WITH_${_dependency}, but CONFIGURE_FEATURE(${_feature}) " - "was called before CONFIGURE_FEATURE(${_dependency}).\n\n" + "DEAL_II_WITH_${_dependency}, but configure_feature(${_feature}) " + "was called before configure_feature(${_dependency}).\n\n" ) - ENDIF() - ENDFOREACH() + endif() + endforeach() # # Obey the user overrides: # - IF( (NOT DEAL_II_ALLOW_AUTODETECTION) AND + if( (NOT DEAL_II_ALLOW_AUTODETECTION) AND (NOT DEFINED DEAL_II_WITH_${_feature}) ) - PURGE_FEATURE(${_feature}) - SET_CACHED_OPTION(${_feature} OFF) - ENDIF() + purge_feature(${_feature}) + set_cached_option(${_feature} OFF) + endif() # # Only try to configure ${_feature} if we have to, i.e. # DEAL_II_WITH_${_feature} is set to true or not set at all. # - IF((NOT DEFINED DEAL_II_WITH_${_feature}) OR + if((NOT DEFINED DEAL_II_WITH_${_feature}) OR DEAL_II_WITH_${_feature}) # # Are all dependencies fulfilled? # - SET(_dependencies_ok TRUE) - FOREACH(_dependency ${FEATURE_${_feature}_DEPENDS}) - IF(NOT DEAL_II_WITH_${_dependency}) - IF(DEAL_II_WITH_${_feature}) - MESSAGE(FATAL_ERROR "\n" + set(_dependencies_ok TRUE) + foreach(_dependency ${FEATURE_${_feature}_DEPENDS}) + if(NOT DEAL_II_WITH_${_dependency}) + if(DEAL_II_WITH_${_feature}) + message(FATAL_ERROR "\n" "DEAL_II_WITH_${_feature} has unmet configuration requirements: " "DEAL_II_WITH_${_dependency} has to be set to \"ON\".\n\n" ) - ELSE() - MESSAGE(STATUS + else() + message(STATUS "DEAL_II_WITH_${_feature} has unmet configuration requirements: " "DEAL_II_WITH_${_dependency} has to be set to \"ON\"." ) - PURGE_FEATURE(${_feature}) - SET_CACHED_OPTION(${_feature} OFF) - ENDIF() - SET(_dependencies_ok FALSE) - ENDIF() - ENDFOREACH() - - IF(_dependencies_ok) - IF(DEAL_II_FORCE_BUNDLED_${_feature}) + purge_feature(${_feature}) + set_cached_option(${_feature} OFF) + endif() + set(_dependencies_ok FALSE) + endif() + endforeach() + + if(_dependencies_ok) + if(DEAL_II_FORCE_BUNDLED_${_feature}) # # First case: DEAL_II_FORCE_BUNDLED_${_feature} is defined: # - PURGE_FEATURE(${_feature}) + purge_feature(${_feature}) - IF(FEATURE_${_feature}_HAVE_BUNDLED) - EVALUATE_EXPRESSION("FEATURE_${_feature}_CONFIGURE_BUNDLED()") - MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") - SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) - SET_CACHED_OPTION(${_feature} ON) - ELSE() - MESSAGE(FATAL_ERROR "\n" + if(FEATURE_${_feature}_HAVE_BUNDLED) + evaluate_expression("FEATURE_${_feature}_CONFIGURE_BUNDLED()") + message(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") + set(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) + set_cached_option(${_feature} ON) + else() + message(FATAL_ERROR "\n" "Internal build system error: DEAL_II_FORCE_BUNDLED_${_feature} " "defined, but FEATURE_${_feature}_HAVE_BUNDLED not present.\n" ) - ENDIF() + endif() - ELSE(DEAL_II_FORCE_BUNDLED_${_feature}) + else(DEAL_II_FORCE_BUNDLED_${_feature}) # # Second case: We are allowed to search for an external library # - IF(COMMAND FEATURE_${_feature}_FIND_EXTERNAL) - EVALUATE_EXPRESSION("FEATURE_${_feature}_FIND_EXTERNAL(FEATURE_${_feature}_EXTERNAL_FOUND)") - ELSE() - FEATURE_FIND_EXTERNAL(${_feature} FEATURE_${_feature}_EXTERNAL_FOUND) - ENDIF() - - IF(FEATURE_${_feature}_EXTERNAL_FOUND) - IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL) - EVALUATE_EXPRESSION("FEATURE_${_feature}_CONFIGURE_EXTERNAL()") - ENDIF() - - MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.") - SET(FEATURE_${_feature}_EXTERNAL_CONFIGURED TRUE) - SET_CACHED_OPTION(${_feature} ON) - - ELSE(FEATURE_${_feature}_EXTERNAL_FOUND) - - PURGE_FEATURE(${_feature}) - - MESSAGE(STATUS "DEAL_II_WITH_${_feature} has unmet external dependencies.") - - IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED) - EVALUATE_EXPRESSION("FEATURE_${_feature}_CONFIGURE_BUNDLED()") - - MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") - SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) - SET_CACHED_OPTION(${_feature} ON) - - ELSE() - IF(DEAL_II_WITH_${_feature}) - IF(COMMAND FEATURE_${_feature}_ERROR_MESSAGE) - EVALUATE_EXPRESSION("FEATURE_${_feature}_ERROR_MESSAGE()") - ELSE() - FEATURE_ERROR_MESSAGE(${_feature}) - ENDIF() - ELSE() - SET_CACHED_OPTION(${_feature} OFF) - ENDIF() - ENDIF() - - ENDIF(FEATURE_${_feature}_EXTERNAL_FOUND) - - ENDIF() - ENDIF() - ELSE() + if(COMMAND FEATURE_${_feature}_FIND_EXTERNAL) + evaluate_expression("FEATURE_${_feature}_FIND_EXTERNAL(FEATURE_${_feature}_EXTERNAL_FOUND)") + else() + feature_find_external(${_feature} FEATURE_${_feature}_EXTERNAL_FOUND) + endif() + + if(FEATURE_${_feature}_EXTERNAL_FOUND) + if(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL) + evaluate_expression("FEATURE_${_feature}_CONFIGURE_EXTERNAL()") + endif() + + message(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.") + set(FEATURE_${_feature}_EXTERNAL_CONFIGURED TRUE) + set_cached_option(${_feature} ON) + + else(FEATURE_${_feature}_EXTERNAL_FOUND) + + purge_feature(${_feature}) + + message(STATUS "DEAL_II_WITH_${_feature} has unmet external dependencies.") + + if(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED) + evaluate_expression("FEATURE_${_feature}_CONFIGURE_BUNDLED()") + + message(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.") + set(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE) + set_cached_option(${_feature} ON) + + else() + if(DEAL_II_WITH_${_feature}) + if(COMMAND FEATURE_${_feature}_ERROR_MESSAGE) + evaluate_expression("FEATURE_${_feature}_ERROR_message()") + else() + feature_error_message(${_feature}) + endif() + else() + set_cached_option(${_feature} OFF) + endif() + endif() + + endif(FEATURE_${_feature}_EXTERNAL_FOUND) + + endif() + endif() + else() # # DEAL_II_WITH_${_feature} is defined and set to OFF, promote it to # cache nevertheless: # - MESSAGE(STATUS "DEAL_II_WITH_${_feature} is set to off.") - PURGE_FEATURE(${_feature}) - SET_CACHED_OPTION(${_feature} OFF) - ENDIF() + message(STATUS "DEAL_II_WITH_${_feature} is set to off.") + purge_feature(${_feature}) + set_cached_option(${_feature} OFF) + endif() - SET(FEATURE_${_feature}_PROCESSED TRUE) + set(FEATURE_${_feature}_PROCESSED TRUE) -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_add_definitions.cmake b/cmake/macros/macro_deal_ii_add_definitions.cmake index 5f52ab018b..1cf7565cfe 100644 --- a/cmake/macros/macro_deal_ii_add_definitions.cmake +++ b/cmake/macros/macro_deal_ii_add_definitions.cmake @@ -15,18 +15,18 @@ # # A small wrapper around -# SET_TARGET_PROPERTY(... PROPERTIES COMPILE_DEFINITIONS ...) +# SET_TARget_property(... PROPERTIES COMPILE_DEFINITIONS ...) # to _add_ compile definitions to every target we have specified. # -MACRO(DEAL_II_ADD_DEFINITIONS _name) +macro(DEAL_II_ADD_DEFINITIONS _name) - FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) + foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - SET_PROPERTY(TARGET ${_name}_${_build_lowercase} + set_property(TARGET ${_name}_${_build_lowercase} APPEND PROPERTY COMPILE_DEFINITIONS "${ARGN}" ) - ENDFOREACH() + endforeach() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_add_library.cmake b/cmake/macros/macro_deal_ii_add_library.cmake index 002c6e607e..6341b03b8a 100644 --- a/cmake/macros/macro_deal_ii_add_library.cmake +++ b/cmake/macros/macro_deal_ii_add_library.cmake @@ -27,43 +27,43 @@ # DEAL_II_DEFINITIONS # -MACRO(DEAL_II_ADD_LIBRARY _library) +macro(DEAL_II_ADD_LIBRARY _library) - FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) + foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - ADD_LIBRARY(${_library}_${_build_lowercase} + add_library(${_library}_${_build_lowercase} ${ARGN} ) - SET_TARGET_PROPERTIES(${_library}_${_build_lowercase} PROPERTIES + set_target_properties(${_library}_${_build_lowercase} PROPERTIES LINKER_LANGUAGE "CXX" ) - IF(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + if(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - SET_TARGET_PROPERTIES(${_library}_${_build_lowercase} PROPERTIES + set_target_properties(${_library}_${_build_lowercase} PROPERTIES COMPILE_FLAGS "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}" ) - ELSE() + else() - SET(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}") - SEPARATE_ARGUMENTS(_flags) - TARGET_COMPILE_OPTIONS(${_library}_${_build_lowercase} PUBLIC + set(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}") + separate_arguments(_flags) + target_compile_options(${_library}_${_build_lowercase} PUBLIC $<$:${_flags}> ) - TARGET_COMPILE_DEFINITIONS(${_library}_${_build_lowercase} + target_compile_definitions(${_library}_${_build_lowercase} PUBLIC ${DEAL_II_DEFINITIONS} ${DEAL_II_DEFINITIONS_${_build}} ) - ENDIF() + endif() - SET_PROPERTY(GLOBAL APPEND PROPERTY DEAL_II_OBJECTS_${_build} + set_property(GLOBAL APPEND PROPERTY DEAL_II_OBJECTS_${_build} "$" ) - ENDFOREACH() + endforeach() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 43bc117f73..98b54a594f 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -100,44 +100,44 @@ # * "heavy": compute node, >=32 physical cores, >=128GB RAM # # Usage: -# DEAL_II_ADD_TEST(category test_name comparison_file) +# deal_ii_add_test(category test_name comparison_file) # -FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) +function(DEAL_II_ADD_TEST _category _test_name _comparison_file) - IF(NOT TARGET compile_test_executables) - ADD_CUSTOM_TARGET(compile_test_executables) - ENDIF() + if(NOT TARGET compile_test_executables) + add_custom_target(compile_test_executables) + endif() - IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) - MESSAGE(FATAL_ERROR + if(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) + message(FATAL_ERROR "\nDEAL_II_ADD_TEST can only be called in external (test sub-) projects after " "the inclusion of deal.IIConfig.cmake. It is not intended for " "internal use.\n\n" ) - ENDIF() + endif() - GET_FILENAME_COMPONENT(_file ${_comparison_file} NAME) + get_filename_component(_file ${_comparison_file} NAME) # # Determine valid build configurations for this test: # - SET(_configuration) - IF(_file MATCHES "\\.debug\\.") - SET(_configuration DEBUG) - ELSEIF(_file MATCHES "\\.release\\.") - SET(_configuration RELEASE) - ENDIF() + set(_configuration) + if(_file MATCHES "\\.debug\\.") + set(_configuration DEBUG) + elseif(_file MATCHES "\\.release\\.") + set(_configuration RELEASE) + endif() # # Determine whether the test should be run with mpirun: # - STRING(REGEX MATCH "mpirun=([0-9]+|max)" _n_cpu ${_file}) - IF("${_n_cpu}" STREQUAL "") - SET(_n_cpu 0) # 0 indicates that no mpirun should be used - ELSE() - STRING(REGEX REPLACE "^mpirun=([0-9]+|max)$" "\\1" _n_cpu ${_n_cpu}) - ENDIF() + string(REGEX MATCH "mpirun=([0-9]+|max)" _n_cpu ${_file}) + if("${_n_cpu}" STREQUAL "") + set(_n_cpu 0) # 0 indicates that no mpirun should be used + else() + string(REGEX REPLACE "^mpirun=([0-9]+|max)$" "\\1" _n_cpu ${_n_cpu}) + endif() # # If we encounter the special string "mpirun=max" set the number of MPI @@ -145,32 +145,32 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) # limit has been specified, i.e., TEST_MPI_RANK_LIMIT is 0, skip defining # the test. # - IF("${_n_cpu}" STREQUAL "max") - IF(TEST_MPI_RANK_LIMIT EQUAL 0) - RETURN() - ENDIF() - SET(_n_cpu "${TEST_MPI_RANK_LIMIT}") - ENDIF() + if("${_n_cpu}" STREQUAL "max") + if(TEST_MPI_RANK_LIMIT EQUAL 0) + return() + endif() + set(_n_cpu "${TEST_MPI_RANK_LIMIT}") + endif() # # If the number of MPI ranks specified for the test via .mpirun=N. # exceeds the limit ${TEST_MPI_RANK_LIMIT}, skip defining the test # - IF(TEST_MPI_RANK_LIMIT GREATER 0 AND _n_cpu GREATER TEST_MPI_RANK_LIMIT) - RETURN() - ENDIF() + if(TEST_MPI_RANK_LIMIT GREATER 0 AND _n_cpu GREATER TEST_MPI_RANK_LIMIT) + return() + endif() # # Determine whether the test declaration specifies a thread pool size via # threads=N: # - STRING(REGEX MATCH "threads=([0-9]+|max)" _n_threads ${_file}) - IF("${_n_threads}" STREQUAL "") - SET(_n_threads 0) # 0 indicates that the default thread pool size + string(REGEX MATCH "threads=([0-9]+|max)" _n_threads ${_file}) + if("${_n_threads}" STREQUAL "") + set(_n_threads 0) # 0 indicates that the default thread pool size # should be used (currently set to 3 in tests.h) - ELSE() - STRING(REGEX REPLACE "^threads=([0-9]+|max)$" "\\1" _n_threads ${_n_threads}) - ENDIF() + else() + string(REGEX REPLACE "^threads=([0-9]+|max)$" "\\1" _n_threads ${_n_threads}) + endif() # # If we encounter the special string "threads=max" set the number of @@ -178,47 +178,47 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) # If no limit has been specified, i.e., TEST_THREAD_LIMIT is 0, skip # defining the test. # - IF("${_n_threads}" STREQUAL "max") - IF(TEST_THREAD_LIMIT EQUAL 0) - RETURN() - ENDIF() - SET(_n_threads "${TEST_THREAD_LIMIT}") - ENDIF() + if("${_n_threads}" STREQUAL "max") + if(TEST_THREAD_LIMIT EQUAL 0) + return() + endif() + set(_n_threads "${TEST_THREAD_LIMIT}") + endif() # # If the number of threads specified for the test via .threads=N. exceeds # the limit ${TEST_THREAD_LIMIT}, skip defining the test # - IF(TEST_THREAD_LIMIT GREATER 0 AND _n_threads GREATER TEST_THREAD_LIMIT) - RETURN() - ENDIF() + if(TEST_THREAD_LIMIT GREATER 0 AND _n_threads GREATER TEST_THREAD_LIMIT) + return() + endif() # # Determine the expected build stage of this test: # - STRING(REGEX MATCH "expect=([a-z]*)" _expect ${_file}) - IF("${_expect}" STREQUAL "") - SET(_expect "PASSED") - ELSE() - STRING(REGEX REPLACE "^expect=([a-z]*)$" "\\1" _expect ${_expect}) - STRING(TOUPPER ${_expect} _expect) - ENDIF() + string(REGEX MATCH "expect=([a-z]*)" _expect ${_file}) + if("${_expect}" STREQUAL "") + set(_expect "PASSED") + else() + string(REGEX REPLACE "^expect=([a-z]*)$" "\\1" _expect ${_expect}) + string(TOUPPER ${_expect} _expect) + endif() # # Determine whether the .run_only keyword is present: # - SET(_run_only FALSE) - IF(_file MATCHES "\\.run_only$") - SET(_run_only TRUE) - ENDIF() + set(_run_only FALSE) + if(_file MATCHES "\\.run_only$") + set(_run_only TRUE) + endif() # # Determine whether the .exclusive. keyword is present: # - SET(_exclusive FALSE) - IF(_file MATCHES "\\.exclusive\\.") - SET(_exclusive TRUE) - ENDIF() + set(_exclusive FALSE) + if(_file MATCHES "\\.exclusive\\.") + set(_exclusive TRUE) + endif() # # Determine for which build types a test should be defined. @@ -226,42 +226,42 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) # Every deal.II build type (given by the list DEAL_II_BUILD_TYPES) that # is a (case insensitive) substring of CMAKE_BUILD_TYPE: # - IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - SET(_build_types DEBUG) - ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "Release") - SET(_build_types RELEASE) - ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") - SET(_build_types DEBUG RELEASE) - ELSE() - MESSAGE(FATAL_ERROR + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set(_build_types DEBUG) + elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + set(_build_types RELEASE) + elseif("${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease") + set(_build_types DEBUG RELEASE) + else() + message(FATAL_ERROR "\nDEAL_II_ADD_TEST requires CMAKE_BUILD_TYPE to be set to " "\"Debug\", \"Release\", or \"DebugRelease\"\n\n" ) - ENDIF() + endif() - FOREACH(_build ${_build_types}) - LIST(FIND DEAL_II_BUILD_TYPES ${_build} _match) - IF("${_match}" STREQUAL "-1") - MESSAGE(FATAL_ERROR + foreach(_build ${_build_types}) + list(FIND DEAL_II_BUILD_TYPES ${_build} _match) + if("${_match}" STREQUAL "-1") + message(FATAL_ERROR "\nDEAL_II_ADD_TEST cannot set up a test with CMAKE_BUILD_TYPE " "\"${CMAKE_BUILD_TYPE}\". deal.II was build with CMAKE_BUILD_TYPE " "\"${DEAL_II_BUILD_TYPE}\"\n\n" ) - ENDIF() - ENDFOREACH() + endif() + endforeach() - IF(NOT TESTING_ENVIRONMENT MATCHES "^(light|medium|heavy)$") - MESSAGE(FATAL_ERROR + if(NOT TESTING_ENVIRONMENT MATCHES "^(light|medium|heavy)$") + message(FATAL_ERROR "The TESTING_ENVIRONMENT variable must be set to either \"light\"," " \"medium\", or \"heavy\"." ) - ENDIF() + endif() # # Determine source or parameter file: # - FILE(GLOB _source_file + file(GLOB _source_file "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.c[cu]" "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.prm" "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.prm.in" @@ -269,85 +269,85 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.json.in" ) - LIST(LENGTH _source_file _number) - IF(NOT _number EQUAL 1) - IF(_number EQUAL 0) - MESSAGE(FATAL_ERROR "\n${_comparison_file}:\n" + list(LENGTH _source_file _number) + if(NOT _number EQUAL 1) + if(_number EQUAL 0) + message(FATAL_ERROR "\n${_comparison_file}:\n" "A comparison file (ending in .output or .run-only) has been " "picked up but no suitable source file or parameter file was " "found. Please provide exactly one of the following.\n" "A source file \"${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.c[cu]\",\n" "or a parameter file \"${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.(prm|json)[.in]\".\n" ) - ELSE() - STRING(REPLACE ";" "\n" _source_file "${_source_file}") - MESSAGE(FATAL_ERROR "\n${_comparison_file}:\n" + else() + string(REPLACE ";" "\n" _source_file "${_source_file}") + message(FATAL_ERROR "\n${_comparison_file}:\n" "A comparison file (ending in .output or .run-only) has been " "picked up with multiple suitable source files or parameter files:\n" "${_source_file}\n" "There must be exactly one source or parameter file.\n" ) - ENDIF() - ENDIF() + endif() + endif() # # Run CONFIGURE_FILE on every parameter file ending in "in" # - IF("${_source_file}" MATCHES ".in$") - SET(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - STRING(REGEX MATCH "(json|prm).in$" _suffix "${_source_file}") - STRING(REPLACE ".in" "" _suffix "${_suffix}") - CONFIGURE_FILE( + if("${_source_file}" MATCHES ".in$") + set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + string(REGEX MATCH "(json|prm).in$" _suffix "${_source_file}") + string(REPLACE ".in" "" _suffix "${_suffix}") + configure_file( "${_source_file}" "${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_suffix}" @ONLY ) - SET(_source_file "${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_suffix}") - ENDIF() + set(_source_file "${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_suffix}") + endif() - FOREACH(_build ${_build_types}) + foreach(_build ${_build_types}) # # Obey "debug" and "release" keywords in the output file: # - ITEM_MATCHES(_match "${_build}" ${_configuration}) - IF(_match OR "${_configuration}" STREQUAL "") - STRING(TOLOWER ${_build} _build_lowercase) + item_matches(_match "${_build}" ${_configuration}) + if(_match OR "${_configuration}" STREQUAL "") + string(TOLOWER ${_build} _build_lowercase) - SET(_target ${_category}.${_test_name}.${_build_lowercase}) # target name - SET(_target_short ${_test_name}.${_build_lowercase}) # short target name - SET(_run_args "$") # the command to issue + set(_target ${_category}.${_test_name}.${_build_lowercase}) # target name + set(_target_short ${_test_name}.${_build_lowercase}) # short target name + set(_run_args "$") # the command to issue # # If the variable ${category_test_RUNARGS_PREFIX) is nonempty prepend # it to the command line of the test: # if(NOT "${${_category}_${_test_name}_RUNARGS_PREFIX}" STREQUAL "") - SET(_run_args + set(_run_args ${${_category}_${_test_name}_RUNARGS_PREFIX} "${_run_args}") - ENDIF() + endif() # # Override target and run command for parameter file variants: # - IF("${_source_file}" MATCHES "(prm|json)$") - IF(NOT "${TEST_TARGET_${_build}}" STREQUAL "") - SET(_target ${TEST_TARGET_${_build}}) - ELSEIF(NOT "${TEST_TARGET}" STREQUAL "") - SET(_target ${TEST_TARGET}) - ELSE() - MESSAGE(FATAL_ERROR "\n${_comparison_file}:\n" + if("${_source_file}" MATCHES "(prm|json)$") + if(NOT "${TEST_TARGET_${_build}}" STREQUAL "") + set(_target ${TEST_TARGET_${_build}}) + elseif(NOT "${TEST_TARGET}" STREQUAL "") + set(_target ${TEST_TARGET}) + else() + message(FATAL_ERROR "\n${_comparison_file}:\n" "A parameter file \"${_test_name}.(prm|json)(|.in)\" has been " "found, but neither \"\${TEST_TARGET}\", nor " "\"\${TEST_TARGET_${_build}}\" have been defined.\n" ) - ENDIF() - SET(_target_short ${_target}) - SET(_run_args + endif() + set(_target_short ${_target}) + set(_run_args "$" "${_source_file}" ) - ENDIF() + endif() # # If _n_cpu or _n_threads are larger than zero we have to accomodate @@ -360,96 +360,96 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) # "mpirun_0-threads_0". # - SET(_test_target ${_category}.${_test_name}) # diff target name - SET(_test_full ${_category}/${_test_name}) # full test name - SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}) # directory to run the test in + set(_test_target ${_category}.${_test_name}) # diff target name + set(_test_full ${_category}/${_test_name}) # full test name + set(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}) # directory to run the test in - IF(NOT "${_n_cpu}" STREQUAL "0") - STRING(APPEND _test_target ".mpirun${_n_cpu}") - STRING(APPEND _test_full ".mpirun=${_n_cpu}") - STRING(APPEND _test_directory "/mpirun=${_n_cpu}") - ENDIF() + if(NOT "${_n_cpu}" STREQUAL "0") + string(APPEND _test_target ".mpirun${_n_cpu}") + string(APPEND _test_full ".mpirun=${_n_cpu}") + string(APPEND _test_directory "/mpirun=${_n_cpu}") + endif() - IF(NOT "${_n_threads}" STREQUAL "0") - STRING(APPEND _test_target ".threads${_n_threads}") - STRING(APPEND _test_full ".threads=${_n_threads}") - STRING(APPEND _test_directory "/threads=${_n_threads}") - ENDIF() + if(NOT "${_n_threads}" STREQUAL "0") + string(APPEND _test_target ".threads${_n_threads}") + string(APPEND _test_full ".threads=${_n_threads}") + string(APPEND _test_directory "/threads=${_n_threads}") + endif() - STRING(APPEND _test_target ".${_build_lowercase}.test") - STRING(APPEND _test_full ".${_build_lowercase}") + string(APPEND _test_target ".${_build_lowercase}.test") + string(APPEND _test_full ".${_build_lowercase}") # # Test variants with ".mpirun=[...]." have to be executed via mpirun # (or whatever ${DEAL_II_MPIEXEC} is set to). # - IF(NOT "${_n_cpu}" STREQUAL "0") - SET(_run_args + if(NOT "${_n_cpu}" STREQUAL "0") + set(_run_args "${DEAL_II_MPIEXEC}" ${DEAL_II_MPIEXEC_NUMPROC_FLAG} ${_n_cpu} ${DEAL_II_MPIEXEC_PREFLAGS} ${_run_args} ${DEAL_II_MPIEXEC_POSTFLAGS} ) - ENDIF() + endif() - FILE(MAKE_DIRECTORY ${_test_directory}) + file(MAKE_DIRECTORY ${_test_directory}) # # Add an executable (for the first type of tests) and set up compile # definitions and the full link interface. Only add the target once. # - IF(NOT TARGET ${_target}) + if(NOT TARGET ${_target}) # # Add a "guard file" rule: The purpose of interrupt_guard.cc is to # force a complete rerun of this test (BUILD, RUN and DIFF stage) # if interrupt_guard.cc is removed by run_test.cmake due to an # interruption. # - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc ) - ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL + add_executable(${_target} EXCLUDE_FROM_ALL ${_generated_files} ${_source_file} ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc ) - ADD_DEPENDENCIES(compile_test_executables ${_target}) + add_dependencies(compile_test_executables ${_target}) - SET_TARGET_PROPERTIES(${_target} PROPERTIES OUTPUT_NAME ${_target_short}) + set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_target_short}) - DEAL_II_SETUP_TARGET(${_target} ${_build}) - TARGET_LINK_LIBRARIES(${_target} + deal_ii_setup_target(${_target} ${_build}) + target_link_libraries(${_target} ${TEST_LIBRARIES} ${TEST_LIBRARIES_${_build}} ) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" TESTING_ENVIRONMENT=${TESTING_ENVIRONMENT} ) - IF(ENABLE_PERFORMANCE_TESTS) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + if(ENABLE_PERFORMANCE_TESTS) + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ENABLE_PERFORMANCE_TESTS ) - ENDIF() + endif() - SET_PROPERTY(TARGET ${_target} PROPERTY + set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_target_short}" ) - ENDIF() + endif() # # Add a top level target to run and compare the test: # - ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/output + add_custom_command(OUTPUT ${_test_directory}/output COMMAND TEST_N_THREADS=${_n_threads} sh ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh run "${_test_full}" ${_run_args} @@ -464,8 +464,8 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) VERBATIM ) - IF(_run_only) - ADD_CUSTOM_TARGET(${_test_target} + if(_run_only) + add_custom_target(${_test_target} COMMAND echo "${_test_full}: BUILD successful." COMMAND echo "${_test_full}: RUN successful." COMMAND echo "${_test_full}: DIFF skipped." @@ -473,11 +473,11 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) DEPENDS ${_test_directory}/output ) - ELSE() + else() - FILE(GLOB _comparison_files ${_comparison_file} ${_comparison_file}.*) + file(GLOB _comparison_files ${_comparison_file} ${_comparison_file}.*) - ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff + add_custom_command(OUTPUT ${_test_directory}/diff COMMAND sh ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh diff "${_test_full}" "${NUMDIFF_EXECUTABLE}" "${_comparison_file}" ${_run_args} @@ -489,7 +489,7 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) VERBATIM ) - ADD_CUSTOM_TARGET(${_test_target} + add_custom_target(${_test_target} COMMAND echo "${_test_full}: BUILD successful." COMMAND echo "${_test_full}: RUN successful." COMMAND echo "${_test_full}: DIFF successful." @@ -497,13 +497,13 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) DEPENDS ${_test_directory}/diff ) - ENDIF() + endif() # # And finally define the test: # - ADD_TEST(NAME ${_test_full} + add_test(NAME ${_test_full} COMMAND ${CMAKE_COMMAND} -DTRGT=${_test_target} -DTEST=${_test_full} @@ -513,19 +513,19 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake WORKING_DIRECTORY ${_test_directory} ) - SET_TESTS_PROPERTIES(${_test_full} PROPERTIES + set_tests_properties(${_test_full} PROPERTIES LABEL "${_category}" TIMEOUT ${TEST_TIME_LIMIT} ) - IF(_exclusive) + if(_exclusive) # # Ensure that the test is not executed concurrently with any other # tests. # - SET_TESTS_PROPERTIES(${_test_full} PROPERTIES RUN_SERIAL TRUE) + set_tests_properties(${_test_full} PROPERTIES RUN_SERIAL TRUE) - ELSEIF(NOT ENABLE_PERFORMANCE_TESTS) + elseif(NOT ENABLE_PERFORMANCE_TESTS) # # Limit concurrency of mpi tests. We can only set concurrency for # the entire test, which includes the compiling and linking stages @@ -534,28 +534,28 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) # just choose to model an "average" concurrency as one half of the # number of MPI jobs. # - IF(_n_cpu GREATER 2) - MATH(EXPR _slots "${_n_cpu} / 2") - SET_TESTS_PROPERTIES(${_test_full} PROPERTIES PROCESSORS ${_slots}) - ENDIF() + if(_n_cpu GREATER 2) + math(EXPR _slots "${_n_cpu} / 2") + set_tests_properties(${_test_full} PROPERTIES PROCESSORS ${_slots}) + endif() - ELSE() + else() # # In case ENABLE_PERFORMANCE_TESTS is set we limit the concurrency # of performance tests to the number of specified mpi ranks times # the number of specified threads. # - SET(_slots 1) - IF(_n_cpu GREATER 0) - MATH(EXPR _slots "${_slots} * ${_n_cpu}") - ENDIF() - IF(_n_threads GREATER 0) - MATH(EXPR _slots "${_slots} * ${_n_threads}") - ENDIF() - SET_TESTS_PROPERTIES(${_test_full} PROPERTIES PROCESSORS ${_slots}) - ENDIF() - - IF(NOT "${_n_cpu}${_n_threads}" STREQUAL "00") + set(_slots 1) + if(_n_cpu GREATER 0) + math(EXPR _slots "${_slots} * ${_n_cpu}") + endif() + if(_n_threads GREATER 0) + math(EXPR _slots "${_slots} * ${_n_threads}") + endif() + set_tests_properties(${_test_full} PROPERTIES PROCESSORS ${_slots}) + endif() + + if(NOT "${_n_cpu}${_n_threads}" STREQUAL "00") # # Running multiple variants in parallel triggers a race condition # where the same (not yet existent) executable is built @@ -564,14 +564,14 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) # Luckily CMake has a mechanism to force a test to be run after # another has finished (and both are scheduled): # - IF(DEFINED TEST_DEPENDENCIES_${_target}) - SET_TESTS_PROPERTIES(${_test_full} PROPERTIES + if(DEFINED TEST_DEPENDENCIES_${_target}) + set_tests_properties(${_test_full} PROPERTIES DEPENDS ${TEST_DEPENDENCIES_${_target}} ) - ENDIF() - SET(TEST_DEPENDENCIES_${_target} ${_test_full} PARENT_SCOPE) - ENDIF() + endif() + set(TEST_DEPENDENCIES_${_target} ${_test_full} PARENT_SCOPE) + endif() - ENDIF() - ENDFOREACH() -ENDFUNCTION() + endif() + endforeach() +endfunction() diff --git a/cmake/macros/macro_deal_ii_find_file.cmake b/cmake/macros/macro_deal_ii_find_file.cmake index 7c35cea82b..f400e381f7 100644 --- a/cmake/macros/macro_deal_ii_find_file.cmake +++ b/cmake/macros/macro_deal_ii_find_file.cmake @@ -17,17 +17,17 @@ # A small wrapper around FIND_FILE to be a bit more verbose # -MACRO(DEAL_II_FIND_FILE _file_name) +macro(DEAL_II_FIND_FILE _file_name) # Save a string representation of the arguments before cmake's # FIND_FILE gets its hands on it. - TO_STRING(_str ${ARGN}) + to_string(_str ${ARGN}) - FIND_FILE(${_file_name} ${ARGN}) + find_file(${_file_name} ${ARGN}) - IF(${_file_name} MATCHES "-NOTFOUND") - MESSAGE(STATUS "${_file_name} not found! The call was:") - MESSAGE(STATUS " FIND_FILE(${_file_name} ${_str})") - ELSE() - MESSAGE(STATUS "Found ${_file_name}") - ENDIF() -ENDMACRO() + if(${_file_name} MATCHES "-NOTFOUND") + message(STATUS "${_file_name} not found! The call was:") + message(STATUS " find_file(${_file_name} ${_str})") + else() + message(STATUS "Found ${_file_name}") + endif() +endmacro() diff --git a/cmake/macros/macro_deal_ii_find_library.cmake b/cmake/macros/macro_deal_ii_find_library.cmake index edeeb02883..1df6611c57 100644 --- a/cmake/macros/macro_deal_ii_find_library.cmake +++ b/cmake/macros/macro_deal_ii_find_library.cmake @@ -17,17 +17,17 @@ # A small wrapper around FIND_LIBRARY to be a bit more verbose # -MACRO(DEAL_II_FIND_LIBRARY _library_name) +macro(DEAL_II_FIND_LIBRARY _library_name) # Save a string representation of the arguments before cmake's # FIND_FILE gets its hands on it. - TO_STRING(_str ${ARGN}) + to_string(_str ${ARGN}) - FIND_LIBRARY(${_library_name} ${ARGN}) + find_library(${_library_name} ${ARGN}) - IF(${_library_name} MATCHES "-NOTFOUND") - MESSAGE(STATUS "${_library_name} not found! The call was:") - MESSAGE(STATUS " FIND_LIBRARY(${_library_name} ${_str})") - ELSE() - MESSAGE(STATUS "Found ${_library_name}") - ENDIF() -ENDMACRO() + if(${_library_name} MATCHES "-NOTFOUND") + message(STATUS "${_library_name} not found! The call was:") + message(STATUS " find_library(${_library_name} ${_str})") + else() + message(STATUS "Found ${_library_name}") + endif() +endmacro() diff --git a/cmake/macros/macro_deal_ii_find_path.cmake b/cmake/macros/macro_deal_ii_find_path.cmake index f56113ed1c..ce7977b447 100644 --- a/cmake/macros/macro_deal_ii_find_path.cmake +++ b/cmake/macros/macro_deal_ii_find_path.cmake @@ -17,17 +17,17 @@ # A small wrapper around FIND_FILE to be a bit more verbose # -MACRO(DEAL_II_FIND_PATH _path_name) +macro(DEAL_II_FIND_PATH _path_name) # Save a string representation of the arguments before cmake's # FIND_PATH gets its hands on it. - TO_STRING(_str ${ARGN}) + to_string(_str ${ARGN}) - FIND_PATH(${_path_name} ${ARGN}) + find_path(${_path_name} ${ARGN}) - IF(${_path_name} MATCHES "-NOTFOUND") - MESSAGE(STATUS "${_path_name} not found! The call was:") - MESSAGE(STATUS " FIND_PATH(${_path_name} ${_str})") - ELSE() - MESSAGE(STATUS "Found ${_path_name}") - ENDIF() -ENDMACRO() + if(${_path_name} MATCHES "-NOTFOUND") + message(STATUS "${_path_name} not found! The call was:") + message(STATUS " find_path(${_path_name} ${_str})") + else() + message(STATUS "Found ${_path_name}") + endif() +endmacro() diff --git a/cmake/macros/macro_deal_ii_find_program.cmake b/cmake/macros/macro_deal_ii_find_program.cmake index 797e7b6ab4..362a10bec3 100644 --- a/cmake/macros/macro_deal_ii_find_program.cmake +++ b/cmake/macros/macro_deal_ii_find_program.cmake @@ -17,17 +17,17 @@ # A small wrapper around FIND_PROGRAM to be a bit more verbose # -MACRO(DEAL_II_FIND_PROGRAM _file_name) +macro(DEAL_II_FIND_PROGRAM _file_name) # Save a string representation of the arguments before cmake's # FIND_PROGRAM gets its hands on it. - TO_STRING(_str ${ARGN}) + to_string(_str ${ARGN}) - FIND_PROGRAM(${_file_name} ${ARGN}) + find_program(${_file_name} ${ARGN}) - IF(${_file_name} MATCHES "-NOTFOUND") - MESSAGE(STATUS "${_file_name} not found! The call was:") - MESSAGE(STATUS " FIND_PROGRAM(${_file_name} ${_str})") - ELSE() - MESSAGE(STATUS "Found ${_file_name}") - ENDIF() -ENDMACRO() + if(${_file_name} MATCHES "-NOTFOUND") + message(STATUS "${_file_name} not found! The call was:") + message(STATUS " find_program(${_file_name} ${_str})") + else() + message(STATUS "Found ${_file_name}") + endif() +endmacro() diff --git a/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake b/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake index 37c4356d02..be3a102c0d 100644 --- a/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake +++ b/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake @@ -18,51 +18,51 @@ # part of the deal.II library. # # Usage: -# DEAL_II_INITIALIZE_CACHED_VARIABLES() +# deal_ii_initialize_cached_variables() # # This sets some cached variables to the values used for compiling the # deal.II library. # -# This macro has to be called before PROJECT()! +# This macro has to be called before project()! # -MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES) +macro(DEAL_II_INITIALIZE_CACHED_VARIABLES) - IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) - MESSAGE(FATAL_ERROR + if(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) + message(FATAL_ERROR "\nDEAL_II_INITIALIZE_CACHED_VARIABLES can only be called in external " "projects after the inclusion of deal.IIConfig.cmake. It is not " "intended for internal use.\n\n" ) - ENDIF() + endif() # # Set build type according to available libraries # - IF(DEAL_II_BUILD_TYPE MATCHES "Debug") - SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING + if(DEAL_II_BUILD_TYPE MATCHES "Debug") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug, Release" ) - ELSE() - SET(CMAKE_BUILD_TYPE "Release" CACHE STRING + else() + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug, Release" ) - ENDIF() + endif() # # Reset build type if unsupported, i.e. if it is not Debug, Release, or # DebugRelease, or if the library doesn't support it # - IF( NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|DebugRelease)$" + if( NOT "${CMAKE_BUILD_TYPE}" MATCHES "^(Debug|Release|DebugRelease)$" OR NOT "${DEAL_II_BUILD_TYPE}" MATCHES "${CMAKE_BUILD_TYPE}" ) - IF("${DEAL_II_BUILD_TYPE}" STREQUAL "DebugRelease") - SET(_new_build_type "Debug") - ELSE() - SET(_new_build_type "${DEAL_II_BUILD_TYPE}") - ENDIF() + if("${DEAL_II_BUILD_TYPE}" STREQUAL "DebugRelease") + set(_new_build_type "Debug") + else() + set(_new_build_type "${DEAL_II_BUILD_TYPE}") + endif() - MESSAGE( + message( "### # # WARNING: @@ -74,27 +74,27 @@ MACRO(DEAL_II_INITIALIZE_CACHED_VARIABLES) # ###" ) - SET(CMAKE_BUILD_TYPE "${_new_build_type}" CACHE STRING + set(CMAKE_BUILD_TYPE "${_new_build_type}" CACHE STRING "Choose the type of build, options are: Debug, Release" FORCE ) - ENDIF() + endif() - SET(CMAKE_CXX_COMPILER ${DEAL_II_CXX_COMPILER} CACHE STRING + set(CMAKE_CXX_COMPILER ${DEAL_II_CXX_COMPILER} CACHE STRING "CXX Compiler.") - SET(CMAKE_CXX_FLAGS "" CACHE STRING + set(CMAKE_CXX_FLAGS "" CACHE STRING "Flags used by the compiler during all build types." ) - SET(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING + set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Flags used by the compiler during debug builds." ) - SET(CMAKE_CXX_FLAGS_RELEASE "" CACHE STRING + set(CMAKE_CXX_FLAGS_RELEASE "" CACHE STRING "Flags used by the compiler during release builds." ) - MARK_AS_ADVANCED(CMAKE_INSTALL_PREFIX) + mark_as_advanced(CMAKE_INSTALL_PREFIX) -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_insource_setup_target.cmake b/cmake/macros/macro_deal_ii_insource_setup_target.cmake index 7819afdc00..a847b82f22 100644 --- a/cmake/macros/macro_deal_ii_insource_setup_target.cmake +++ b/cmake/macros/macro_deal_ii_insource_setup_target.cmake @@ -17,56 +17,56 @@ # This file provides an insource version of the DEAL_II_SETUP_TARGET macro. # # Usage: -# DEAL_II_INSOURCE_SETUP_TARGET(target build) +# deal_ii_insource_setup_target(target build) # # This appends necessary include directories, linker flags, compile # definitions and the deal.II library link interface to the given target. # # -MACRO(DEAL_II_INSOURCE_SETUP_TARGET _target _build) +macro(DEAL_II_INSOURCE_SETUP_TARGET _target _build) - SET_TARGET_PROPERTIES(${_target} PROPERTIES + set_target_properties(${_target} PROPERTIES LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" LINKER_LANGUAGE "CXX" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) - TARGET_INCLUDE_DIRECTORIES(${_target} + target_include_directories(${_target} PRIVATE "${CMAKE_BINARY_DIR}/include" "${CMAKE_SOURCE_DIR}/include" ${DEAL_II_BUNDLED_INCLUDE_DIRS} ) - TARGET_INCLUDE_DIRECTORIES(${_target} SYSTEM PRIVATE ${DEAL_II_INCLUDE_DIRS}) + target_include_directories(${_target} SYSTEM PRIVATE ${DEAL_II_INCLUDE_DIRS}) - IF(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - SET_PROPERTY(TARGET ${_target} APPEND_STRING PROPERTY + if(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set_property(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" ) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_${_build}}" ) - ELSE() + else() - SET(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}") - SEPARATE_ARGUMENTS(_flags) - TARGET_COMPILE_OPTIONS(${_target} PUBLIC + set(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}") + separate_arguments(_flags) + target_compile_options(${_target} PUBLIC $<$:${_flags}> ) - TARGET_COMPILE_DEFINITIONS(${_target} + target_compile_definitions(${_target} PUBLIC ${DEAL_II_DEFINITIONS} ${DEAL_II_DEFINITIONS_${_build}} ) - ENDIF() + endif() -GET_PROPERTY(_type TARGET ${_target} PROPERTY TYPE) -IF(NOT "${_type}" STREQUAL "OBJECT_LIBRARY") - TARGET_LINK_LIBRARIES(${_target} +get_property(_type TARGET ${_target} PROPERTY TYPE) +if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY") + target_link_libraries(${_target} ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX} ) -ENDIF() +endif() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_invoke_autopilot.cmake b/cmake/macros/macro_deal_ii_invoke_autopilot.cmake index e2b99f6912..0701866727 100644 --- a/cmake/macros/macro_deal_ii_invoke_autopilot.cmake +++ b/cmake/macros/macro_deal_ii_invoke_autopilot.cmake @@ -18,7 +18,7 @@ # part of the deal.II library. # # Usage: -# DEAL_II_INVOKE_AUTOPILOT() +# deal_ii_invoke_autopilot() # # where it is assumed that the following variables are defined: # @@ -35,66 +35,66 @@ # empty # -MACRO(DEAL_II_INVOKE_AUTOPILOT) +macro(DEAL_II_INVOKE_AUTOPILOT) # Generator specific values: - IF(CMAKE_GENERATOR MATCHES "Ninja") - SET(_make_command "$ ninja") - ELSE() - SET(_make_command " $ make") - ENDIF() + if(CMAKE_GENERATOR MATCHES "Ninja") + set(_make_command "$ ninja") + else() + set(_make_command " $ make") + endif() set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) # Define and setup a compilation target: - ADD_EXECUTABLE(${TARGET} ${TARGET_SRC}) - DEAL_II_SETUP_TARGET(${TARGET}) + add_executable(${TARGET} ${TARGET_SRC}) + deal_ii_setup_target(${TARGET}) - MESSAGE(STATUS "Autopilot invoked") + message(STATUS "Autopilot invoked") # Define a custom target to easily run the program: - IF(NOT DEFINED TARGET_RUN) - SET(TARGET_RUN ${TARGET}) - ENDIF() + if(NOT DEFINED TARGET_RUN) + set(TARGET_RUN ${TARGET}) + endif() - IF(CMAKE_SYSTEM_NAME MATCHES "(CYGWIN|Windows)") + if(CMAKE_SYSTEM_NAME MATCHES "(CYGWIN|Windows)") # # Hack for Cygwin and Windows targets: Export PATH to point to the # dynamic library. # - SET(_delim ":") - IF(CMAKE_SYSTEM_NAME MATCHES "Windows") - SET(_delim ";") - ENDIF() - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake - "SET(ENV{PATH} \"${CMAKE_CURRENT_BINARY_DIR}${_delim}${DEAL_II_PATH}/${DEAL_II_EXECUTABLE_RELDIR}${_delim}\$ENV{PATH}\")\n" - "EXECUTE_PROCESS(COMMAND ${CMAKE_BUILD_TYPE}\\\\${TARGET_RUN}\n" + set(_delim ":") + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(_delim ";") + endif() + file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake + "set(ENV{PATH} \"${CMAKE_CURRENT_BINARY_DIR}${_delim}${DEAL_II_PATH}/${DEAL_II_EXECUTABLE_RELDIR}${_delim}\$ENV{PATH}\")\n" + "execute_process(COMMAND ${CMAKE_BUILD_TYPE}\\\\${TARGET_RUN}\n" " RESULT_VARIABLE _return_value\n" " )\n" - "IF(NOT \"\${_return_value}\" STREQUAL \"0\")\n" - " MESSAGE(SEND_ERROR \"\nProgram terminated with exit code: \${_return_value}\")\n" - "ENDIF()\n" + "if(NOT \"\${_return_value}\" STREQUAL \"0\")\n" + " message(SEND_ERROR \"\nProgram terminated with exit code: \${_return_value}\")\n" + "endif()\n" ) - SET(_command + set(_command ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake ) - ELSE() + else() - SET(_command ${TARGET_RUN}) - ENDIF() + set(_command ${TARGET_RUN}) + endif() - IF(NOT "${TARGET_RUN}" STREQUAL "") - ADD_CUSTOM_TARGET(run + if(NOT "${TARGET_RUN}" STREQUAL "") + add_custom_target(run COMMAND ${_command} DEPENDS ${TARGET} COMMENT "Run ${TARGET} with ${CMAKE_BUILD_TYPE} configuration" ) - SET(_run_targets + set(_run_targets "# ${_make_command} run - to (compile, link and) run the program\n" ) - ENDIF() + endif() # @@ -103,21 +103,21 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) # tasks that need networking. # - IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - IF(DEFINED OSX_CERTIFICATE_NAME) - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + if(DEFINED OSX_CERTIFICATE_NAME) + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed COMMAND codesign -f -s ${OSX_CERTIFICATE_NAME} ${TARGET} COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed COMMENT "Digitally signing ${TARGET}" DEPENDS ${TARGET} VERBATIM ) - ADD_CUSTOM_TARGET(sign ALL + add_custom_target(sign ALL DEPENDS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${TARGET}.signed ) - ADD_DEPENDENCIES(run sign) - ELSE() - ADD_CUSTOM_TARGET(sign + add_dependencies(run sign) + else() + add_custom_target(sign COMMAND ${CMAKE_COMMAND} -E echo '' && ${CMAKE_COMMAND} -E echo '***************************************************************************' @@ -127,19 +127,19 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) && ${CMAKE_COMMAND} -E echo '' COMMENT "Digitally signing ${TARGET}" ) - ENDIF() + endif() - SET(_run_targets + set(_run_targets "${_run_targets}#\n# ${_make_command} sign - to sign the executable with the supplied OSX developer key\n" ) - ENDIF() + endif() # # Define custom targets to easily switch the build type: # - IF(${DEAL_II_BUILD_TYPE} MATCHES "Debug") - ADD_CUSTOM_TARGET(debug + if(${DEAL_II_BUILD_TYPE} MATCHES "Debug") + add_custom_target(debug COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E echo "***" COMMAND ${CMAKE_COMMAND} -E echo "*** Switched to Debug mode. Now recompile with: ${_make_command}" @@ -147,10 +147,10 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) COMMENT "Switching CMAKE_BUILD_TYPE to Debug" VERBATIM ) - ENDIF() + endif() - IF(${DEAL_II_BUILD_TYPE} MATCHES "Release") - ADD_CUSTOM_TARGET(release + if(${DEAL_II_BUILD_TYPE} MATCHES "Release") + add_custom_target(release COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E echo "***" COMMAND ${CMAKE_COMMAND} -E echo "*** Switched to Release mode. Now recompile with: ${_make_command}" @@ -158,31 +158,31 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) COMMENT "Switching CMAKE_BUILD_TYPE to Release" VERBATIM ) - ENDIF() + endif() # # Only mention release and debug targets if it is actually possible to # switch between them: # - IF(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease") - SET(_switch_targets + if(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease") + set(_switch_targets "# ${_make_command} debug - to switch the build type to 'Debug' # ${_make_command} release - to switch the build type to 'Release'\n" ) - ENDIF() + endif() # And another custom target to clean up all files generated by the program: - IF("${CLEAN_UP_FILES}" STREQUAL "") - SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2) - ENDIF() - ADD_CUSTOM_TARGET(runclean + if("${CLEAN_UP_FILES}" STREQUAL "") + set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2) + endif() + add_custom_target(runclean COMMAND ${CMAKE_COMMAND} -E remove ${CLEAN_UP_FILES} COMMENT "runclean invoked" ) # Define a distclean target to remove every generated file: - ADD_CUSTOM_TARGET(distclean + add_custom_target(distclean COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target runclean COMMAND ${CMAKE_COMMAND} -E remove_directory CMakeFiles @@ -193,18 +193,18 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) ) # Define a strip-comments target: - FIND_PACKAGE(Perl QUIET) - IF(PERL_FOUND) - ADD_CUSTOM_TARGET(strip_comments + find_package(Perl QUIET) + if(PERL_FOUND) + add_custom_target(strip_comments COMMAND ${PERL_EXECUTABLE} -pi -e 's\#^[ \\t]*//.*\\n\#\#g;' ${TARGET_SRC} COMMENT "strip comments" ) - ENDIF() + endif() # Print out some usage information to file: - FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake -"MESSAGE( + file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake +"message( \"### # # Project ${TARGET} set up with ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} found at @@ -217,20 +217,20 @@ MACRO(DEAL_II_INVOKE_AUTOPILOT) ${_run_targets}# ${_switch_targets}# ") - IF(NOT CMAKE_GENERATOR MATCHES "Ninja") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake + if(NOT CMAKE_GENERATOR MATCHES "Ninja") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake "# ${_make_command} edit_cache - to change (cached) configuration variables # and rerun the configure and generate phases of CMake # ") - ENDIF() - IF(PERL_FOUND) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake + endif() + if(PERL_FOUND) + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake "# ${_make_command} strip_comments - to strip the source files in this # directory off their comments; this is irreversible ") - ENDIF() - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake + endif() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake "# ${_make_command} clean - to remove the generated executable as well as # all intermediate compilation files # ${_make_command} runclean - to remove all output generated by the program @@ -244,17 +244,17 @@ ${_switch_targets}# ###\")" ) - ADD_CUSTOM_TARGET(info + add_custom_target(info COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake ) # Print this message once: - IF(NOT USAGE_PRINTED) - INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake) - SET(USAGE_PRINTED TRUE CACHE INTERNAL "") - ELSE() - MESSAGE(STATUS "Run ${_make_command} info to print a detailed help message") - ENDIF() + if(NOT USAGE_PRINTED) + include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake) + set(USAGE_PRINTED TRUE CACHE INTERNAL "") + else() + message(STATUS "Run ${_make_command} info to print a detailed help message") + endif() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_package_handle.cmake b/cmake/macros/macro_deal_ii_package_handle.cmake index 51407566e8..bef44babc5 100644 --- a/cmake/macros/macro_deal_ii_package_handle.cmake +++ b/cmake/macros/macro_deal_ii_package_handle.cmake @@ -14,7 +14,7 @@ ## --------------------------------------------------------------------- # -# DEAL_II_PACKAGE_HANDLE( +# deal_ii_package_handle( # { {(REQUIRED|OPTIONAL) }} # [CLEAR ] # ) @@ -25,7 +25,7 @@ # # Its usage is best explained with an example: # -# DEAL_II_PACKAGE_HANDLE(PETSC +# deal_ii_package_handle(PETSC # LIBRARIES # REQUIRED PETSC_LIBRARY # OPTIONAL _petsc_libraries @@ -45,27 +45,27 @@ # search. # -MACRO(DEAL_II_PACKAGE_HANDLE _feature) +macro(DEAL_II_PACKAGE_HANDLE _feature) - IF(DEFINED ${_feature}_VERSION) - MESSAGE(STATUS " ${_feature}_VERSION: ${${_feature}_VERSION}") - ENDIF() + if(DEFINED ${_feature}_VERSION) + message(STATUS " ${_feature}_VERSION: ${${_feature}_VERSION}") + endif() # # Respect a possible ${_feature}_FOUND variable that is set to a truth # value. We need this for modern™ MPI detection where CMake's # FindMPI.cmake might only set MPI_FOUND to true and nothing else. # - IF(NOT DEFINED ${_feature}_FOUND) - SET(${_feature}_FOUND TRUE) - ENDIF() + if(NOT DEFINED ${_feature}_FOUND) + set(${_feature}_FOUND TRUE) + endif() # # Clear temporary variables # - FOREACH(_suffix ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES}) + foreach(_suffix ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES}) set(_temp_${_suffix} "") - ENDFOREACH() + endforeach() # # State variables for parsing keywords and arguments. We store the @@ -73,98 +73,98 @@ MACRO(DEAL_II_PACKAGE_HANDLE _feature) # whether we encountered an "OPTIONAL" or "REQUIRED" keyword in # ${_required} # - SET(_current_suffix "") - SET(_required TRUE) + set(_current_suffix "") + set(_required TRUE) # # A temporary list accumulating all variables that should be "cleared" # when the feature gets disabled. # - SET(_clear_variables_list "") + set(_clear_variables_list "") - FOREACH(_arg ${ARGN}) - IF(("${_arg}" IN_LIST DEAL_II_LIST_SUFFIXES) OR + foreach(_arg ${ARGN}) + if(("${_arg}" IN_LIST DEAL_II_LIST_SUFFIXES) OR ("${_arg}" IN_LIST DEAL_II_STRING_SUFFIXES) OR ("${_arg}" STREQUAL "CLEAR")) # # We encountered a new keyword. # - SET(_current_suffix "${_arg}") + set(_current_suffix "${_arg}") - ELSEIF("${_arg}" STREQUAL "REQUIRED") - SET(_required TRUE) + elseif("${_arg}" STREQUAL "REQUIRED") + set(_required TRUE) - ELSEIF("${_arg}" STREQUAL "OPTIONAL") - SET(_required FALSE) + elseif("${_arg}" STREQUAL "OPTIONAL") + set(_required FALSE) - ELSEIF(_arg MATCHES "^(optimized|debug|general)$" + elseif(_arg MATCHES "^(optimized|debug|general)$" AND "${_current_suffix}" STREQUAL "LIBRARIES") - LIST(APPEND _temp_${_current_suffix} ${_arg}) + list(APPEND _temp_${_current_suffix} ${_arg}) - ELSE() - IF ("${_current_suffix}" STREQUAL "") - MESSAGE(FATAL_ERROR + else() + if ("${_current_suffix}" STREQUAL "") + message(FATAL_ERROR "Internal configuration error: the second " "argument to DEAL_II_PACKAGE_HANDLE must be a keyword" ) - ENDIF() + endif() - MARK_AS_ADVANCED(${_arg}) + mark_as_advanced(${_arg}) - IF("${_current_suffix}" STREQUAL "CLEAR") - IF(NOT _arg MATCHES "^(optimized|debug|general)$") - LIST(APPEND _clear_variables_list ${_arg}) - ENDIF() + if("${_current_suffix}" STREQUAL "CLEAR") + if(NOT _arg MATCHES "^(optimized|debug|general)$") + list(APPEND _clear_variables_list ${_arg}) + endif() - ELSE() + else() - IF("${${_arg}}" MATCHES "^\\s*$" OR "${${_arg}}" MATCHES "-NOTFOUND") - IF(_required) - IF("${${_arg}}" MATCHES "^\\s*$") - MESSAGE(STATUS + if("${${_arg}}" MATCHES "^\\s*$" OR "${${_arg}}" MATCHES "-NOTFOUND") + if(_required) + if("${${_arg}}" MATCHES "^\\s*$") + message(STATUS " ${_feature}_${_current_suffix}: *** Required variable \"${_arg}\" empty ***" ) - ELSE() - MESSAGE(STATUS + else() + message(STATUS " ${_feature}_${_current_suffix}: *** Required variable \"${_arg}\" set to NOTFOUND ***" ) - ENDIF() - SET(${_feature}_FOUND FALSE) - ENDIF() - ELSE() - LIST(APPEND _temp_${_current_suffix} ${${_arg}}) - ENDIF() - ENDIF() - ENDIF() - ENDFOREACH() - - SET(${_feature}_CLEAR_VARIABLES ${_clear} CACHE INTERNAL "") - - IF(${_feature}_FOUND) + endif() + set(${_feature}_FOUND FALSE) + endif() + else() + list(APPEND _temp_${_current_suffix} ${${_arg}}) + endif() + endif() + endif() + endforeach() + + set(${_feature}_CLEAR_VARIABLES ${_clear} CACHE INTERNAL "") + + if(${_feature}_FOUND) # # Deduplicate and stringify entries: # - FOREACH(_suffix ${DEAL_II_LIST_SUFFIXES}) - IF(_suffix MATCHES "INCLUDE_DIRS$") - REMOVE_DUPLICATES(_temp_${_suffix}) - ELSE() - REMOVE_DUPLICATES(_temp_${_suffix} REVERSE) - ENDIF() - ENDFOREACH() - FOREACH(_suffix ${_DEAL_II_STRING_SUFFIXES}) - TO_STRING(_temp_${_suffix} ${_temp_${_suffix}}) - ENDFOREACH() + foreach(_suffix ${DEAL_II_LIST_SUFFIXES}) + if(_suffix MATCHES "INCLUDE_DIRS$") + remove_duplicates(_temp_${_suffix}) + else() + remove_duplicates(_temp_${_suffix} REVERSE) + endif() + endforeach() + foreach(_suffix ${_DEAL_II_STRING_SUFFIXES}) + 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 "") + 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() + message(STATUS " ${_feature}_${_suffix}: ${${_feature}_${_suffix}}") + endif() + endforeach() # # Remove certain system libraries from the link interface. This is @@ -172,20 +172,20 @@ MACRO(DEAL_II_PACKAGE_HANDLE _feature) # we always set up threading by linking against libpthread.so if # necessary). # - FOREACH(_suffix LIBRARIES LIBRARIES_DEBUG LIBRARIES_RELEASE) - IF(NOT "${${_feature}_${_suffix}}" STREQUAL "") - LIST(REMOVE_ITEM ${_feature}_${_suffix} + foreach(_suffix LIBRARIES LIBRARIES_DEBUG LIBRARIES_RELEASE) + if(NOT "${${_feature}_${_suffix}}" STREQUAL "") + list(REMOVE_ITEM ${_feature}_${_suffix} "pthread" "-pthread" "-lpthread" "c" "-lc" ) - ENDIF() - ENDFOREACH() + endif() + endforeach() - MESSAGE(STATUS "Found ${_feature}") + message(STATUS "Found ${_feature}") - MARK_AS_ADVANCED(${_feature}_DIR ${_feature}_ARCH) + mark_as_advanced(${_feature}_DIR ${_feature}_ARCH) - ELSE() + else() - MESSAGE(STATUS "Could NOT find ${_feature}") - ENDIF() -ENDMACRO() + message(STATUS "Could NOT find ${_feature}") + endif() +endmacro() diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index c322129234..5815f2fa6f 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -70,102 +70,102 @@ # specified with NUMDIFF_DIR. # # Usage: -# DEAL_II_PICKUP_TESTS() +# deal_ii_pickup_tests() # # # Two very small macros that are used below: # -MACRO(SET_IF_EMPTY _variable) - IF("${${_variable}}" STREQUAL "") - SET(${_variable} ${ARGN}) - ENDIF() -ENDMACRO() +macro(SET_IF_EMPTY _variable) + if("${${_variable}}" STREQUAL "") + set(${_variable} ${ARGN}) + endif() +endmacro() -MACRO(ITEM_MATCHES _var _regex) - SET(${_var}) - FOREACH (_item ${ARGN}) - IF("${_item}" MATCHES ${_regex}) - SET(${_var} TRUE) - BREAK() - ENDIF() - ENDFOREACH() -ENDMACRO() +macro(ITEM_MATCHES _var _regex) + set(${_var}) + foreach (_item ${ARGN}) + if("${_item}" MATCHES ${_regex}) + set(${_var} TRUE) + break() + endif() + endforeach() +endmacro() -MACRO(DEAL_II_PICKUP_TESTS) +macro(DEAL_II_PICKUP_TESTS) - IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) - MESSAGE(FATAL_ERROR + if(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) + message(FATAL_ERROR "\nDEAL_II_PICKUP_TESTS can only be called in external (test sub-) " "projects after the inclusion of deal.IIConfig.cmake. It is not " "intended for internal use.\n\n" ) - ENDIF() + endif() # # Necessary external interpreters and programs: # - IF(${DEAL_II_WITH_MPI}) - IF("${DEAL_II_MPIEXEC}" STREQUAL "" OR + if(${DEAL_II_WITH_MPI}) + if("${DEAL_II_MPIEXEC}" STREQUAL "" OR "${DEAL_II_MPIEXEC}" STREQUAL "MPIEXEC_EXECUTABLE-NOTFOUND") - MESSAGE(FATAL_ERROR "Could not find an MPI launcher program, which is required " + message(FATAL_ERROR "Could not find an MPI launcher program, which is required " "for running the testsuite. Please explicitly specify MPIEXEC_EXECUTABLE to CMake " "as a full path to the MPI launcher program.") - ENDIF() - ENDIF() + endif() + endif() - FIND_PACKAGE(Perl REQUIRED) + find_package(Perl REQUIRED) - FIND_PROGRAM(NUMDIFF_EXECUTABLE + find_program(NUMDIFF_EXECUTABLE NAMES numdiff HINTS ${NUMDIFF_DIR} PATH_SUFFIXES bin ) - MARK_AS_ADVANCED(NUMDIFF_EXECUTABLE) + mark_as_advanced(NUMDIFF_EXECUTABLE) - IF( "${NUMDIFF_EXECUTABLE}" MATCHES "NUMDIFF_EXECUTABLE-NOTFOUND") - MESSAGE(FATAL_ERROR + if( "${NUMDIFF_EXECUTABLE}" MATCHES "NUMDIFF_EXECUTABLE-NOTFOUND") + message(FATAL_ERROR "Could not find numdiff, which is required for running the testsuite.\n" "Please specify NUMDIFF_DIR to a location containing the binary." ) - ENDIF() + endif() # # Check that numdiff can run and terminate successfully: # - EXECUTE_PROCESS(COMMAND ${NUMDIFF_EXECUTABLE} "-v" + execute_process(COMMAND ${NUMDIFF_EXECUTABLE} "-v" TIMEOUT 4 # seconds OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE _diff_program_status ) - IF(NOT "${_diff_program_status}" STREQUAL "0") - MESSAGE(FATAL_ERROR + if(NOT "${_diff_program_status}" STREQUAL "0") + message(FATAL_ERROR "\nThe command \"${NUMDIFF_EXECUTABLE} -v\" did not run correctly: it " "either failed to exit after a few seconds or returned a nonzero exit " "code. The test suite cannot be set up without this program, so please " "reinstall it and then run the test suite setup command again.\n") - ENDIF() + endif() # # Also check that numdiff is not a symlink to diff by running a relative # tolerance test. # - STRING(FIND "${NUMDIFF_EXECUTABLE}" "numdiff" _found_numdiff_binary) - IF(NOT "${_found_numdiff_binary}" STREQUAL "-1") - STRING(RANDOM _suffix) - SET(_first_test_file_name + string(FIND "${NUMDIFF_EXECUTABLE}" "numdiff" _found_numdiff_binary) + if(NOT "${_found_numdiff_binary}" STREQUAL "-1") + string(RANDOM _suffix) + set(_first_test_file_name "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/numdiff-test-${_suffix}-1.txt") - SET(_second_test_file_name + set(_second_test_file_name "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/numdiff-test-${_suffix}-2.txt") - FILE(WRITE "${_first_test_file_name}" "0.99999999998\n2.0\n1.0\n") - FILE(WRITE "${_second_test_file_name}" "1.00000000001\n2.0\n1.0\n") + file(WRITE "${_first_test_file_name}" "0.99999999998\n2.0\n1.0\n") + file(WRITE "${_second_test_file_name}" "1.00000000001\n2.0\n1.0\n") - EXECUTE_PROCESS(COMMAND ${NUMDIFF_EXECUTABLE} + execute_process(COMMAND ${NUMDIFF_EXECUTABLE} "-r" "1.0e-8" "--" "${_first_test_file_name}" "${_second_test_file_name}" TIMEOUT 4 # seconds OUTPUT_QUIET @@ -176,61 +176,61 @@ MACRO(DEAL_II_PICKUP_TESTS) # # Tidy up: # - FILE(REMOVE ${_first_test_file_name}) - FILE(REMOVE ${_second_test_file_name}) + file(REMOVE ${_first_test_file_name}) + file(REMOVE ${_second_test_file_name}) - IF(NOT "${_numdiff_tolerance_test_status}" STREQUAL "0") - MESSAGE(FATAL_ERROR + if(NOT "${_numdiff_tolerance_test_status}" STREQUAL "0") + message(FATAL_ERROR "\nThe detected numdiff executable was not able to pass a simple " "relative tolerance test. This usually means that either numdiff " "was misconfigured or that it is a symbolic link to diff. " "The test suite needs numdiff to work correctly: please reinstall " "numdiff and run the test suite configuration again.\n") - ENDIF() - ENDIF() + endif() + endif() # # Set various limits: # - SET_IF_EMPTY(TEST_TIME_LIMIT "$ENV{TEST_TIME_LIMIT}") - SET_IF_EMPTY(TEST_TIME_LIMIT 600) + set_if_empty(TEST_TIME_LIMIT "$ENV{TEST_TIME_LIMIT}") + set_if_empty(TEST_TIME_LIMIT 600) - SET_IF_EMPTY(TEST_MPI_RANK_LIMIT "$ENV{TEST_MPI_RANK_LIMIT}") - SET_IF_EMPTY(TEST_MPI_RANK_LIMIT 0) + set_if_empty(TEST_MPI_RANK_LIMIT "$ENV{TEST_MPI_RANK_LIMIT}") + set_if_empty(TEST_MPI_RANK_LIMIT 0) - SET_IF_EMPTY(TEST_THREAD_LIMIT "$ENV{TEST_THREAD_LIMIT}") - SET_IF_EMPTY(TEST_THREAD_LIMIT 0) + set_if_empty(TEST_THREAD_LIMIT "$ENV{TEST_THREAD_LIMIT}") + set_if_empty(TEST_THREAD_LIMIT 0) # # Other variables: # - SET_IF_EMPTY(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}") + set_if_empty(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}") - SET_IF_EMPTY(ENABLE_PERFORMANCE_TESTS "$ENV{ENABLE_PERFORMANCE_TESTS}") + set_if_empty(ENABLE_PERFORMANCE_TESTS "$ENV{ENABLE_PERFORMANCE_TESTS}") - SET_IF_EMPTY(TESTING_ENVIRONMENT "$ENV{TESTING_ENVIRONMENT}") - SET_IF_EMPTY(TESTING_ENVIRONMENT "light") + set_if_empty(TESTING_ENVIRONMENT "$ENV{TESTING_ENVIRONMENT}") + set_if_empty(TESTING_ENVIRONMENT "light") # # ... and finally pick up tests: # - ENABLE_TESTING() + enable_testing() - IF("${ARGN}" STREQUAL "") - GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME) - ELSE() - SET(_category "${ARGN}") - ENDIF() + if("${ARGN}" STREQUAL "") + get_filename_component(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME) + else() + set(_category "${ARGN}") + endif() - SET(DEAL_II_SOURCE_DIR) # avoid a bogus warning + set(DEAL_II_SOURCE_DIR) # avoid a bogus warning - FILE(GLOB _tests "*.output" "*.run_only") - FOREACH(_test ${_tests}) - SET(_comparison ${_test}) - GET_FILENAME_COMPONENT(_test ${_test} NAME) + file(GLOB _tests "*.output" "*.run_only") + foreach(_test ${_tests}) + set(_comparison ${_test}) + get_filename_component(_test ${_test} NAME) # # Respect TEST_PICKUP_REGEX: @@ -240,85 +240,85 @@ MACRO(DEAL_II_PICKUP_TESTS) # Only retain the base name of the test, i.e., remove everything after # (and including) the first period ("."): # - STRING(REGEX REPLACE "\\..*$" "" _regex_name "${_category}/${_test}") - IF( NOT ("${TEST_PICKUP_REGEX}" STREQUAL "" OR + string(REGEX REPLACE "\\..*$" "" _regex_name "${_category}/${_test}") + if( NOT ("${TEST_PICKUP_REGEX}" STREQUAL "" OR "${_regex_name}" MATCHES "${TEST_PICKUP_REGEX}" )) - CONTINUE() # next test - ENDIF() + continue() # next test + endif() # Disable tests using mpirun if MPI is not enabled - STRING(REGEX MATCH "mpirun=" _matches ${_test}) - IF (_matches AND NOT DEAL_II_WITH_MPI) - CONTINUE() # next test - ENDIF() + string(REGEX MATCH "mpirun=" _matches ${_test}) + if (_matches AND NOT DEAL_II_WITH_MPI) + continue() # next test + endif() # # Query configuration and check whether we support it. Otherwise # skip the test. # - SET(_op_regex "=|\\.geq\\.|\\.leq\\.|\\.ge\\.|\\.le\\.") + set(_op_regex "=|\\.geq\\.|\\.leq\\.|\\.ge\\.|\\.le\\.") - STRING(REGEX MATCHALL + string(REGEX MATCHALL "with_([0-9]|[a-z]|_)*(${_op_regex})(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)" _matches ${_test} ) - SET(_skip_test FALSE) - FOREACH(_match ${_matches}) + set(_skip_test FALSE) + foreach(_match ${_matches}) # # Extract feature name, comparison operator, (a possible) boolean and # (a possible) version number from the feature constraint: # - STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(${_op_regex}).*" "\\1" _feature ${_match}) - STRING(TOUPPER ${_feature} _feature) - STRING(REGEX MATCH "(${_op_regex})" _operator ${_match}) - STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(${_op_regex}).*$" "\\3" _operator ${_match}) - STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match}) - STRING(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match}) + string(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(${_op_regex}).*" "\\1" _feature ${_match}) + string(TOUPPER ${_feature} _feature) + string(REGEX MATCH "(${_op_regex})" _operator ${_match}) + string(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(${_op_regex}).*$" "\\3" _operator ${_match}) + string(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match}) + string(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match}) # # We support two variables: DEAL_II_WITH_ and DEAL_II_ # - SET(_variable "DEAL_II_WITH_${_feature}") - IF(NOT DEFINED ${_variable}) - SET(_variable "DEAL_II_${_feature}") - IF(NOT DEFINED ${_variable}) + set(_variable "DEAL_II_WITH_${_feature}") + if(NOT DEFINED ${_variable}) + set(_variable "DEAL_II_${_feature}") + if(NOT DEFINED ${_variable}) # # If a variable is undefined, assume that we cannot configure a # given test # - SET(_skip_test TRUE) - CONTINUE() # drop out of "FOREACH(_match ${_matches})" - ENDIF() - ENDIF() + set(_skip_test TRUE) + continue() # drop out of "foreach(_match ${_matches})" + endif() + endif() # # First process simple yes/no feature constraints: # - IF(NOT "${_boolean}" STREQUAL "") - IF(NOT "${_operator}" STREQUAL "=") - MESSAGE(FATAL_ERROR " + if(NOT "${_boolean}" STREQUAL "") + if(NOT "${_operator}" STREQUAL "=") + message(FATAL_ERROR " Invalid syntax in constraint \"${_match}\" in file \"${_comparison}\": Comparison operator \"=\" expected for boolean match.\n" ) - ENDIF() + endif() # This is why I hate CMake :-/ - IF( (${_variable} AND NOT ${_boolean}) OR + if( (${_variable} AND NOT ${_boolean}) OR (NOT ${_variable} AND ${_boolean}) ) - SET(_skip_test TRUE) - CONTINUE() # drop out of "FOREACH(_match ${_matches})" - ENDIF() - ENDIF() + set(_skip_test TRUE) + continue() # drop out of "foreach(_match ${_matches})" + endif() + endif() # # Process version constraints: # - IF(NOT "${_version}" STREQUAL "") + if(NOT "${_version}" STREQUAL "") - IF( ( NOT ${DEAL_II_WITH_${_feature}} ) OR + if( ( NOT ${DEAL_II_WITH_${_feature}} ) OR ( "${_operator}" STREQUAL "=" AND NOT "${DEAL_II_${_feature}_VERSION}" VERSION_EQUAL "${_version}" ) OR ( "${_operator}" STREQUAL ".ge." AND @@ -329,22 +329,22 @@ Comparison operator \"=\" expected for boolean match.\n" "${DEAL_II_${_feature}_VERSION}" VERSION_LESS "${_version}" ) OR ( "${_operator}" STREQUAL ".leq." AND "${DEAL_II_${_feature}_VERSION}" VERSION_GREATER "${_version}" ) ) - SET(_skip_test TRUE) - CONTINUE() # drop out of "FOREACH(_match ${_matches})" - ENDIF() - ENDIF() - ENDFOREACH() + set(_skip_test TRUE) + continue() # drop out of "foreach(_match ${_matches})" + endif() + endif() + endforeach() - IF(_skip_test) - CONTINUE() # next test - ENDIF() + if(_skip_test) + continue() # next test + endif() # # We've made it all the way to here, which means that we actually # want to define the test # - STRING(REGEX REPLACE "\\..*" "" _test ${_test}) - DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison}) + string(REGEX REPLACE "\\..*" "" _test ${_test}) + deal_ii_add_test(${_category} ${_test} ${_comparison}) - ENDFOREACH() -ENDMACRO() + endforeach() +endmacro() diff --git a/cmake/macros/macro_deal_ii_query_git_information.cmake b/cmake/macros/macro_deal_ii_query_git_information.cmake index 11ab27193b..11139e602b 100644 --- a/cmake/macros/macro_deal_ii_query_git_information.cmake +++ b/cmake/macros/macro_deal_ii_query_git_information.cmake @@ -18,8 +18,8 @@ # part of the deal.II library. # # Usage: -# DEAL_II_QUERY_GIT_INFORMATION() -# DEAL_II_QUERY_GIT_INFORMATION("CUSTOM_PREFIX") +# deal_ii_query_git_information() +# deal_ii_query_git_information("CUSTOM_PREFIX") # # This will try to gather information about current branch, as well as # short and long revision. If ${CMAKE_SOURCE_DIR} is the root of a git @@ -40,39 +40,39 @@ # PREFIX_GIT_TIMESTAMP # -MACRO(DEAL_II_QUERY_GIT_INFORMATION) +macro(DEAL_II_QUERY_GIT_INFORMATION) - MESSAGE(STATUS "Query git repository information.") + message(STATUS "Query git repository information.") # Set prefix. - SET(_prefix "") - IF(NOT "${ARGN}" STREQUAL "") - SET(_prefix "${ARGN}_") - ENDIF() + set(_prefix "") + if(NOT "${ARGN}" STREQUAL "") + set(_prefix "${ARGN}_") + endif() - FIND_PACKAGE(Git) + find_package(Git) # # Only run the following if we have git and the source directory seems to # be under version control. # - IF(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD) + if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD) # # Bogus configure_file calls to trigger a reconfigure, and thus an # update of branch and commit information every time HEAD has changed. # - CONFIGURE_FILE( + configure_file( ${CMAKE_SOURCE_DIR}/.git/HEAD ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/HEAD ) - FILE(STRINGS ${CMAKE_SOURCE_DIR}/.git/HEAD _head_ref LIMIT_COUNT 1) - STRING(REPLACE "ref: " "" _head_ref ${_head_ref}) - IF(EXISTS ${CMAKE_SOURCE_DIR}/.git/${_head_ref}) - CONFIGURE_FILE( + file(STRINGS ${CMAKE_SOURCE_DIR}/.git/HEAD _head_ref LIMIT_COUNT 1) + string(REPLACE "ref: " "" _head_ref ${_head_ref}) + if(EXISTS ${CMAKE_SOURCE_DIR}/.git/${_head_ref}) + configure_file( ${CMAKE_SOURCE_DIR}/.git/${_head_ref} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/HEAD_REF ) - ENDIF() + endif() # # Query for revision: @@ -84,72 +84,72 @@ MACRO(DEAL_II_QUERY_GIT_INFORMATION) # # --date=iso-strict has been introduced in git 2.2 (released Dec 2014) - SET(_date_format) - IF(NOT ${GIT_VERSION_STRING} VERSION_LESS 2.2) - SET(_date_format "--date=iso-strict") - ENDIF() + set(_date_format) + if(NOT ${GIT_VERSION_STRING} VERSION_LESS 2.2) + set(_date_format "--date=iso-strict") + endif() - EXECUTE_PROCESS( + execute_process( COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"revision=%H, shortrev=%h, date=%cd" ${_date_format} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE _info RESULT_VARIABLE _result OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(${_result} EQUAL 0) - STRING(REGEX REPLACE "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" + if(${_result} EQUAL 0) + string(REGEX REPLACE "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" "\\1" ${_prefix}GIT_REVISION "${_info}") - STRING(REGEX REPLACE "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" + string(REGEX REPLACE "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" "\\2" ${_prefix}GIT_SHORTREV "${_info}") - STRING(REGEX REPLACE "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" + string(REGEX REPLACE "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" "\\3" ${_prefix}GIT_TIMESTAMP "${_info}") # # Replace "T" by a space in order to have the same output as # $ date --rfc-3339=seconds" # - STRING(REPLACE "T" " " ${_prefix}GIT_TIMESTAMP "${${_prefix}GIT_TIMESTAMP}") - ENDIF() + string(REPLACE "T" " " ${_prefix}GIT_TIMESTAMP "${${_prefix}GIT_TIMESTAMP}") + endif() # # Query for branch: # - EXECUTE_PROCESS( + execute_process( COMMAND ${GIT_EXECUTABLE} symbolic-ref HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE _branch RESULT_VARIABLE _result OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(${_result} EQUAL 0) - STRING(REGEX REPLACE "refs/heads/" "" ${_prefix}GIT_BRANCH "${_branch}") - ENDIF() + if(${_result} EQUAL 0) + string(REGEX REPLACE "refs/heads/" "" ${_prefix}GIT_BRANCH "${_branch}") + endif() # # Query for tag: # - SET(_script "") - IF(EXISTS ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) - SET(_script ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) - ELSEIF(EXISTS ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) - SET(_script ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) - ENDIF() - IF(NOT "${_script}" STREQUAL "") - EXECUTE_PROCESS( + set(_script "") + if(EXISTS ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) + set(_script ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) + elseif(EXISTS ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) + set(_script ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh) + endif() + if(NOT "${_script}" STREQUAL "") + execute_process( COMMAND ${_script} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE _tag RESULT_VARIABLE _result OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(${_result} EQUAL 0) - SET(${_prefix}GIT_TAG ${_tag}) - ENDIF() - ELSE() - MESSAGE(STATUS "Could not locate get_latest_tag.sh. " ${_prefix}GIT_TAG " will not be set.") - ENDIF() + if(${_result} EQUAL 0) + set(${_prefix}GIT_TAG ${_tag}) + endif() + else() + message(STATUS "Could not locate get_latest_tag.sh. " ${_prefix}GIT_TAG " will not be set.") + endif() - ENDIF() + endif() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_deal_ii_setup_target.cmake b/cmake/macros/macro_deal_ii_setup_target.cmake index ac2eda2902..a1efb2de3e 100644 --- a/cmake/macros/macro_deal_ii_setup_target.cmake +++ b/cmake/macros/macro_deal_ii_setup_target.cmake @@ -18,8 +18,8 @@ # part of the deal.II library. # # Usage: -# DEAL_II_SETUP_TARGET(target) -# DEAL_II_SETUP_TARGET(target DEBUG|RELEASE) +# deal_ii_setup_target(target) +# deal_ii_setup_target(target DEBUG|RELEASE) # # This appends necessary include directories, linker flags, compile flags # and compile definitions and the deal.II library link interface to the @@ -50,108 +50,108 @@ # FATAL_ERROR. # -MACRO(DEAL_II_SETUP_TARGET _target) +macro(DEAL_II_SETUP_TARGET _target) - IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) - MESSAGE(FATAL_ERROR + if(NOT DEAL_II_PROJECT_CONFIG_INCLUDED) + message(FATAL_ERROR "\nDEAL_II_SETUP_TARGET can only be called in external projects after " "the inclusion of deal.IIConfig.cmake. It is not intended for " "internal use.\n\n" ) - ENDIF() + endif() - IF(NOT DEAL_II_TARGET_CONFIG_INCLUDED) - INCLUDE(${DEAL_II_TARGET_CONFIG}) - SET(DEAL_II_TARGET_CONFIG_INCLUDED TRUE) - ENDIF() + if(NOT DEAL_II_TARGET_CONFIG_INCLUDED) + include(${DEAL_II_TARGET_CONFIG}) + set(DEAL_II_TARGET_CONFIG_INCLUDED TRUE) + endif() # # Set build type with the help of the specified keyword, or # CMAKE_BUILD_TYPE: # - IF("${ARGN}" MATCHES "^(DEBUG|RELEASE)$") - SET(_build "${ARGN}") - ELSEIF("${ARGN}" STREQUAL "") - IF(CMAKE_BUILD_TYPE STREQUAL "Debug") - SET(_build "DEBUG") - ELSEIF(CMAKE_BUILD_TYPE STREQUAL "Release") - SET(_build "RELEASE") - ELSE() - MESSAGE(FATAL_ERROR + if("${ARGN}" MATCHES "^(DEBUG|RELEASE)$") + set(_build "${ARGN}") + elseif("${ARGN}" STREQUAL "") + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(_build "DEBUG") + elseif(CMAKE_BUILD_TYPE STREQUAL "Release") + set(_build "RELEASE") + else() + message(FATAL_ERROR "\nDEAL_II_SETUP_TARGET cannot determine DEBUG, or RELEASE flavor " "for target. CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" is neither " "equal to \"Debug\", nor \"Release\"\n" "Set CMAKE_BUILD_TYPE accordingly, or use an explicit annotation: " - " DEAL_II_SETUP_TARGET( DEBUG|RELEASE)\n\n" + " deal_ii_setup_target( DEBUG|RELEASE)\n\n" ) - ENDIF() - ELSE() - MESSAGE(FATAL_ERROR + endif() + else() + message(FATAL_ERROR "\nDEAL_II_SETUP_TARGET called with invalid second argument. " "Valid arguments are (empty), DEBUG, or RELEASE\n\n" ) - ENDIF() + endif() # # We can only append DEBUG link flags and compile definitions if deal.II # was built with the Debug or DebugRelease build type. So test for this: # - IF("${_build}" STREQUAL "DEBUG" AND NOT DEAL_II_BUILD_TYPE MATCHES "Debug") - SET(_build "RELEASE") - ENDIF() + if("${_build}" STREQUAL "DEBUG" AND NOT DEAL_II_BUILD_TYPE MATCHES "Debug") + set(_build "RELEASE") + endif() - IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + if(CMAKE_CXX_COMPILER_ID MATCHES "Intel") # Intel (at least up to 19.0.5) confuses an external TBB installation with # our selected one if we use -Isystem includes. Work around this by using # normal includes. # See https://github.com/dealii/dealii/issues/8374 for details. - TARGET_INCLUDE_DIRECTORIES(${_target} PRIVATE ${DEAL_II_INCLUDE_DIRS}) - ELSE() - TARGET_INCLUDE_DIRECTORIES(${_target} SYSTEM PRIVATE ${DEAL_II_INCLUDE_DIRS}) - ENDIF() + target_include_directories(${_target} PRIVATE ${DEAL_II_INCLUDE_DIRS}) + else() + target_include_directories(${_target} SYSTEM PRIVATE ${DEAL_II_INCLUDE_DIRS}) + endif() - SET_PROPERTY(TARGET ${_target} APPEND_STRING PROPERTY + set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS " ${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" ) - IF(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - SET_PROPERTY(TARGET ${_target} APPEND_STRING PROPERTY + if(CMAKE_VERSION VERSION_LESS 3.9 OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set_property(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}" ) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS "${DEAL_II_USER_DEFINITIONS};${DEAL_II_USER_DEFINITIONS_${_build}}" ) - ELSE() + else() - SET(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}") - SEPARATE_ARGUMENTS(_flags) - TARGET_COMPILE_OPTIONS(${_target} PUBLIC + set(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}") + separate_arguments(_flags) + target_compile_options(${_target} PUBLIC $<$:${_flags}> ) - TARGET_COMPILE_DEFINITIONS(${_target} + target_compile_definitions(${_target} PUBLIC ${DEAL_II_USER_DEFINITIONS} ${DEAL_II_USER_DEFINITIONS_${_build}} ) - ENDIF() + endif() # # Set up the link interface: # - GET_PROPERTY(_type TARGET ${_target} PROPERTY TYPE) - IF(NOT "${_type}" STREQUAL "OBJECT_LIBRARY") - TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET_${_build}}) - ENDIF() + get_property(_type TARGET ${_target} PROPERTY TYPE) + if(NOT "${_type}" STREQUAL "OBJECT_LIBRARY") + target_link_libraries(${_target} ${DEAL_II_TARGET_${_build}}) + endif() # # If DEAL_II_STATIC_EXECUTABLE is set, switch the final link type to # static: # - IF(DEAL_II_STATIC_EXECUTABLE) - SET_PROPERTY(TARGET ${_target} PROPERTY + if(DEAL_II_STATIC_EXECUTABLE) + set_property(TARGET ${_target} PROPERTY LINK_SEARCH_END_STATIC TRUE ) - ENDIF() + endif() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_decorate_with_stars.cmake b/cmake/macros/macro_decorate_with_stars.cmake index 8fb0d76557..11ff62a1bb 100644 --- a/cmake/macros/macro_decorate_with_stars.cmake +++ b/cmake/macros/macro_decorate_with_stars.cmake @@ -27,24 +27,24 @@ # in such a box then decorate it with just two stars at the beginning. # # Usage: -# DECORATE_WITH_STARS(message decorated_message) +# decorate_with_stars(message decorated_message) # # -MACRO(DECORATE_WITH_STARS _message _decorated_message) - STRING(LENGTH ${_message} _message_length) - SET(_line_length 75) - MATH(EXPR _unpadded_line_length "${_line_length} - 6") +macro(DECORATE_WITH_STARS _message _decorated_message) + string(LENGTH ${_message} _message_length) + set(_line_length 75) + math(EXPR _unpadded_line_length "${_line_length} - 6") - IF(${_message_length} LESS ${_unpadded_line_length}) - MATH(EXPR _left_pad_size "(${_unpadded_line_length} - ${_message_length} + 1)/2") - MATH(EXPR _right_pad_size "(${_unpadded_line_length} - ${_message_length})/2") + if(${_message_length} LESS ${_unpadded_line_length}) + math(EXPR _left_pad_size "(${_unpadded_line_length} - ${_message_length} + 1)/2") + math(EXPR _right_pad_size "(${_unpadded_line_length} - ${_message_length})/2") # Unfortunately, it looks like taking substrings is the only way to pad # strings with run time dependent length. - SET(_pad_strings_values " ") - STRING(SUBSTRING "${_pad_strings_values}" 0 "${_left_pad_size}" _left_pad) - STRING(SUBSTRING "${_pad_strings_values}" 0 "${_right_pad_size}" _right_pad) - SET(${_decorated_message} "** ${_left_pad}${_message}${_right_pad} **") - ELSE() - SET(${_decorated_message} "** ${_message}") - ENDIF() -ENDMACRO() + set(_pad_strings_values " ") + string(SUBSTRING "${_pad_strings_values}" 0 "${_left_pad_size}" _left_pad) + string(SUBSTRING "${_pad_strings_values}" 0 "${_right_pad_size}" _right_pad) + set(${_decorated_message} "** ${_left_pad}${_message}${_right_pad} **") + else() + set(${_decorated_message} "** ${_message}") + endif() +endmacro() diff --git a/cmake/macros/macro_enable_if_links.cmake b/cmake/macros/macro_enable_if_links.cmake index ca6087bb49..071592dba5 100644 --- a/cmake/macros/macro_enable_if_links.cmake +++ b/cmake/macros/macro_enable_if_links.cmake @@ -19,25 +19,25 @@ # If so, add it to variable. # # Usage: -# ENABLE_IF_LINKS(variable flag) +# enable_if_links(variable flag) # -MACRO(ENABLE_IF_LINKS _variable _flag) +macro(ENABLE_IF_LINKS _variable _flag) # keep on top to avoid cluttering the _flag and _flag_stripped variables - ENABLE_IF_SUPPORTED(CMAKE_REQUIRED_FLAGS "-Werror") + enable_if_supported(CMAKE_REQUIRED_FLAGS "-Werror") - STRING(STRIP "${_flag}" _flag_stripped) - IF(NOT "${_flag_stripped}" STREQUAL "") - STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") - STRING(REGEX REPLACE "\[-+,\]" "_" _flag_name "${_flag_name}") + string(STRIP "${_flag}" _flag_stripped) + if(NOT "${_flag_stripped}" STREQUAL "") + string(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") + string(REGEX REPLACE "\[-+,\]" "_" _flag_name "${_flag_name}") - LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${_flag_stripped}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${_flag_stripped}") CHECK_CXX_SOURCE_COMPILES("int main(){}" DEAL_II_HAVE_LINKER_FLAG_${_flag_name}) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(DEAL_II_HAVE_LINKER_FLAG_${_flag_name}) - SET(${_variable} "${${_variable}} ${_flag_stripped}") - STRING(STRIP "${${_variable}}" ${_variable}) - ENDIF() - ENDIF() -ENDMACRO() + if(DEAL_II_HAVE_LINKER_FLAG_${_flag_name}) + set(${_variable} "${${_variable}} ${_flag_stripped}") + string(STRIP "${${_variable}}" ${_variable}) + endif() + endif() +endmacro() diff --git a/cmake/macros/macro_enable_if_supported.cmake b/cmake/macros/macro_enable_if_supported.cmake index 92bbf60dc0..964f6d5e80 100644 --- a/cmake/macros/macro_enable_if_supported.cmake +++ b/cmake/macros/macro_enable_if_supported.cmake @@ -18,11 +18,11 @@ # If so, add it to 'variable'. # # Usage: -# ENABLE_IF_SUPPORTED(variable flag) +# enable_if_supported(variable flag) # -MACRO(ENABLE_IF_SUPPORTED _variable _flag) - STRING(STRIP "${_flag}" _flag_stripped) +macro(ENABLE_IF_SUPPORTED _variable _flag) + string(STRIP "${_flag}" _flag_stripped) # # Gcc does not emit a warning if testing -Wno-... flags which leads to @@ -31,21 +31,21 @@ MACRO(ENABLE_IF_SUPPORTED _variable _flag) # compilation unit. # Therefore we invert the test for -Wno-... flags: # - SET(_flag_sanitized "${_flag_stripped}") - IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - STRING(REPLACE "-Wno-" "-W" _flag_sanitized "${_flag_stripped}") - ENDIF() + set(_flag_sanitized "${_flag_stripped}") + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + string(REPLACE "-Wno-" "-W" _flag_sanitized "${_flag_stripped}") + endif() - IF(NOT "${_flag_stripped}" STREQUAL "") - STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") - STRING(REGEX REPLACE "\[-+,\]" "_" _flag_name "${_flag_name}") + if(NOT "${_flag_stripped}" STREQUAL "") + string(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") + string(REGEX REPLACE "\[-+,\]" "_" _flag_name "${_flag_name}") CHECK_CXX_COMPILER_FLAG("${_flag_sanitized}" DEAL_II_HAVE_FLAG_${_flag_name}) - IF(DEAL_II_HAVE_FLAG_${_flag_name}) - SET(${_variable} "${${_variable}} ${_flag_stripped}") - STRING(STRIP "${${_variable}}" ${_variable}) - ENDIF() - ENDIF() -ENDMACRO() + if(DEAL_II_HAVE_FLAG_${_flag_name}) + set(${_variable} "${${_variable}} ${_flag_stripped}") + string(STRIP "${${_variable}}" ${_variable}) + endif() + endif() +endmacro() diff --git a/cmake/macros/macro_enable_language_optional.cmake b/cmake/macros/macro_enable_language_optional.cmake index ecac32317f..ec7ee5aed3 100644 --- a/cmake/macros/macro_enable_language_optional.cmake +++ b/cmake/macros/macro_enable_language_optional.cmake @@ -16,43 +16,43 @@ # # Test whether a usable language compiler is available and if yes, call -# ENABLE_LANGUAGE(language) +# enable_language(language) # # This works around a severe bug [1] in # -# ENABLE_LANGUAGE(Fortran OPTIONAL) +# enable_language(Fortran OPTIONAL) # # [1] http://public.kitware.com/Bug/view.php?id=9220 # # Usage: -# ENABLE_LANGUAGE_OPTIONAL(language) +# enable_language_optional(language) # # where language is either C or Fortran # -MACRO(ENABLE_LANGUAGE_OPTIONAL _language) - IF(NOT ${_language}_CHECKED) +macro(ENABLE_LANGUAGE_OPTIONAL _language) + if(NOT ${_language}_CHECKED) # # Run this check exactly once: # - SET(${_language}_CHECKED TRUE CACHE INTERNAL "" FORCE) + set(${_language}_CHECKED TRUE CACHE INTERNAL "" FORCE) - SET(_tmp ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/${_language}_test) + set(_tmp ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/${_language}_test) file(REMOVE ${_tmp}) - IF(DEFINED CMAKE_${_language}_COMPILER) - SET(_hint "-DCMAKE_${_language}_COMPILER=${CMAKE_${_language}_COMPILER}") - ENDIF() + if(DEFINED CMAKE_${_language}_COMPILER) + set(_hint "-DCMAKE_${_language}_COMPILER=${CMAKE_${_language}_COMPILER}") + endif() - FILE(WRITE ${_tmp}/CMakeLists.txt - "PROJECT(foobar ${_language})" + file(WRITE ${_tmp}/CMakeLists.txt + "project(foobar ${_language})" ) - IF(NOT "${CMAKE_TOOLCHAIN_FILE}" STREQUAL "") - LIST(APPEND _hint "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") - ENDIF() + if(NOT "${CMAKE_TOOLCHAIN_FILE}" STREQUAL "") + list(APPEND _hint "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") + endif() - EXECUTE_PROCESS( + execute_process( COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_hint} . WORKING_DIRECTORY ${_tmp} RESULT_VARIABLE _result @@ -60,19 +60,19 @@ MACRO(ENABLE_LANGUAGE_OPTIONAL _language) ERROR_QUIET ) - IF("${_result}" STREQUAL "0") - SET(DEAL_II_${_language}_COMPILER_WORKS TRUE CACHE INTERNAL "" FORCE) - ENABLE_LANGUAGE(${_language}) - ELSE() - MESSAGE(STATUS "No working ${_language} compiler found, disabling ${_language}") - SET(DEAL_II_${_language}_COMPILER_WORKS FALSE CACHE INTERNAL "" FORCE) - ENDIF() - ELSE() + if("${_result}" STREQUAL "0") + set(DEAL_II_${_language}_COMPILER_WORKS TRUE CACHE INTERNAL "" FORCE) + enable_language(${_language}) + else() + message(STATUS "No working ${_language} compiler found, disabling ${_language}") + set(DEAL_II_${_language}_COMPILER_WORKS FALSE CACHE INTERNAL "" FORCE) + endif() + else() # # Enable the language depending on the cached result from a former run: # - IF(${DEAL_II_${_language}_COMPILER_WORKS}) - ENABLE_LANGUAGE(${_language}) - ENDIF() - ENDIF() -ENDMACRO() + if(${DEAL_II_${_language}_COMPILER_WORKS}) + enable_language(${_language}) + endif() + endif() +endmacro() diff --git a/cmake/macros/macro_evaluate_expression.cmake b/cmake/macros/macro_evaluate_expression.cmake index 6f441d2c3b..d4fa59537f 100644 --- a/cmake/macros/macro_evaluate_expression.cmake +++ b/cmake/macros/macro_evaluate_expression.cmake @@ -19,13 +19,13 @@ # # USAGE: # -# EVALUATE_EXPRESSION("") +# evaluate_expression("") # -MACRO(EVALUATE_EXPRESSION _the_expression) - SET(_tmp_name +macro(EVALUATE_EXPRESSION _the_expression) + set(_tmp_name "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/evaluate_expression.tmp" ) - FILE(WRITE ${_tmp_name} "${_the_expression}") - INCLUDE("${_tmp_name}") -ENDMACRO() + file(WRITE ${_tmp_name} "${_the_expression}") + include("${_tmp_name}") +endmacro() diff --git a/cmake/macros/macro_expand_instantiations.cmake b/cmake/macros/macro_expand_instantiations.cmake index a852fd4129..ff23726ffa 100644 --- a/cmake/macros/macro_expand_instantiations.cmake +++ b/cmake/macros/macro_expand_instantiations.cmake @@ -32,23 +32,23 @@ # a list of inst.in files that will be expanded # -MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files) +macro(EXPAND_INSTANTIATIONS _target _inst_in_files) - FOREACH (_inst_in_file ${_inst_in_files}) - STRING(REGEX REPLACE "\\.in$" "" _inst_file "${_inst_in_file}" ) + foreach (_inst_in_file ${_inst_in_files}) + string(REGEX REPLACE "\\.in$" "" _inst_file "${_inst_in_file}" ) - IF(NOT CMAKE_CROSSCOMPILING) - SET(_command expand_instantiations_exe) - SET(_dependency expand_instantiations_exe) - ELSE() - SET(_command expand_instantiations) - SET(_dependency) - ENDIF() + if(NOT CMAKE_CROSSCOMPILING) + set(_command expand_instantiations_exe) + set(_dependency expand_instantiations_exe) + else() + set(_command expand_instantiations) + set(_dependency) + endif() # create a .inst.tmp file first and only move to the correct name if the # first call succeeds. Otherwise we might be generating an incomplete # .inst file - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} DEPENDS ${_dependency} ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/template-arguments @@ -63,34 +63,34 @@ MACRO(EXPAND_INSTANTIATIONS _target _inst_in_files) ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} ) - LIST(APPEND _inst_targets ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}) - ENDFOREACH() + list(APPEND _inst_targets ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}) + endforeach() # # Define a custom target that depends on the generation of all inst.in # files. # - ADD_CUSTOM_TARGET(${_target}_inst ALL DEPENDS ${_inst_targets}) + add_custom_target(${_target}_inst ALL DEPENDS ${_inst_targets}) # # Provide a way to generate all .inst files with a custom target. # - ADD_DEPENDENCIES(expand_all_instantiations ${_target}_inst) + add_dependencies(expand_all_instantiations ${_target}_inst) # # Add a dependency to all target.${build_type} so that target.inst is # fully generated before target will be processed. # - FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) + foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - ADD_DEPENDENCIES(${_target}_${_build_lowercase} ${_target}_inst) + add_dependencies(${_target}_${_build_lowercase} ${_target}_inst) - IF(TARGET ${_target}_${_build_lowercase}_cuda) - ADD_DEPENDENCIES(${_target}_${_build_lowercase}_cuda ${_target}_inst) - ENDIF() + if(TARGET ${_target}_${_build_lowercase}_cuda) + add_dependencies(${_target}_${_build_lowercase}_cuda ${_target}_inst) + endif() - ENDFOREACH() + endforeach() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_filter_system_libraries.cmake b/cmake/macros/macro_filter_system_libraries.cmake index 2c0b3a8165..753eddcb06 100644 --- a/cmake/macros/macro_filter_system_libraries.cmake +++ b/cmake/macros/macro_filter_system_libraries.cmake @@ -19,24 +19,24 @@ # variables # # Usage: -# FILTER_SYSTEM_LIBRARIES(feature) +# filter_system_libraries(feature) # -MACRO(FILTER_SYSTEM_LIBRARIES _feature) - FOREACH(_variable +macro(FILTER_SYSTEM_LIBRARIES _feature) + foreach(_variable ${_feature}_LIBRARIES ${_feature}_LIBRARIES_DEBUG ${_feature}_LIBRARIES_RELEASE ) - IF(DEFINED ${_variable}) - SET(_tmp_${_variable} ${${_variable}}) - SET(${_variable} "") - FOREACH(_lib ${_tmp_${_variable}}) - IF(_lib MATCHES "lib(bfd|c|dl|gfortran|iberty|m|nsl|opcodes|pthread|quadmath|rt)\\.(a|so)$") + if(DEFINED ${_variable}) + set(_tmp_${_variable} ${${_variable}}) + set(${_variable} "") + foreach(_lib ${_tmp_${_variable}}) + if(_lib MATCHES "lib(bfd|c|dl|gfortran|iberty|m|nsl|opcodes|pthread|quadmath|rt)\\.(a|so)$") string(REGEX REPLACE ".*lib([a-z]+).so$" "\\1" _lib ${_lib}) - ENDIF() - LIST(APPEND ${_variable} ${_lib}) - ENDFOREACH() - ENDIF() - ENDFOREACH() -ENDMACRO() + endif() + list(APPEND ${_variable} ${_lib}) + endforeach() + endif() + endforeach() +endmacro() diff --git a/cmake/macros/macro_find_system_library.cmake b/cmake/macros/macro_find_system_library.cmake index caa73ede62..155f189dd0 100644 --- a/cmake/macros/macro_find_system_library.cmake +++ b/cmake/macros/macro_find_system_library.cmake @@ -18,33 +18,33 @@ # purely via "-l" instead of selecting a full library path.. # # USAGE: -# FIND_SYSTEM_LIBRARY(variable NAMES [list of possible names]) +# find_system_library(variable NAMES [list of possible names]) # -MACRO(FIND_SYSTEM_LIBRARY) - SET(_argn ${ARGN}) - LIST(GET _argn 0 _variable) - LIST(REMOVE_AT _argn 0 1) +macro(FIND_SYSTEM_LIBRARY) + set(_argn ${ARGN}) + list(GET _argn 0 _variable) + list(REMOVE_AT _argn 0 1) - IF(NOT DEFINED ${_variable}) - FOREACH(_arg ${_argn}) - LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${_arg}") + if(NOT DEFINED ${_variable}) + foreach(_arg ${_argn}) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${_arg}") CHECK_CXX_SOURCE_COMPILES("int main(){}" ${_variable}) - RESET_CMAKE_REQUIRED() + reset_cmake_required() - IF(${_variable}) - UNSET(${_variable} CACHE) - SET(${_variable} ${_arg} CACHE STRING "A system library.") - SET(${_variable} ${_arg}) - MARK_AS_ADVANCED(${_variable}) - BREAK() - ELSE() - UNSET(${_variable} CACHE) - ENDIF() - ENDFOREACH() + if(${_variable}) + unset(${_variable} CACHE) + set(${_variable} ${_arg} CACHE STRING "A system library.") + set(${_variable} ${_arg}) + mark_as_advanced(${_variable}) + break() + else() + unset(${_variable} CACHE) + endif() + endforeach() - IF(NOT ${_variable}) - SET(${_variable} "${_variable}-NOTFOUND") - ENDIF() - ENDIF() -ENDMACRO() + if(NOT ${_variable}) + set(${_variable} "${_variable}-NOTFOUND") + endif() + endif() +endmacro() diff --git a/cmake/macros/macro_item_matches.cmake b/cmake/macros/macro_item_matches.cmake index 1f2d312ce2..5b92cc5062 100644 --- a/cmake/macros/macro_item_matches.cmake +++ b/cmake/macros/macro_item_matches.cmake @@ -17,18 +17,18 @@ # A small macro to test whether a given list contains an element. # # Usage: -# ITEM_MATCHES(var regex list) +# item_matches(var regex list) # # var is set to true if list contains an item that matches regex. # -MACRO(ITEM_MATCHES _var _regex) - SET(${_var}) - FOREACH (_item ${ARGN}) - IF("${_item}" MATCHES ${_regex}) - SET(${_var} TRUE) - BREAK() - ENDIF() - ENDFOREACH() -ENDMACRO() +macro(ITEM_MATCHES _var _regex) + set(${_var}) + foreach (_item ${ARGN}) + if("${_item}" MATCHES ${_regex}) + set(${_var} TRUE) + break() + endif() + endforeach() +endmacro() diff --git a/cmake/macros/macro_purge_feature.cmake b/cmake/macros/macro_purge_feature.cmake index 86e18300f8..90079f9443 100644 --- a/cmake/macros/macro_purge_feature.cmake +++ b/cmake/macros/macro_purge_feature.cmake @@ -17,31 +17,31 @@ # Remove all cached and non cached variables associated with a feature. # # Usage: -# PURGE_FEATURE(feature) +# purge_feature(feature) # -MACRO(PURGE_FEATURE _feature) +macro(PURGE_FEATURE _feature) # # uncached: # - FOREACH(_var ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES}) - IF(NOT _var MATCHES BUNDLED) - SET(${_feature}_${_var}) - ENDIF() - ENDFOREACH() + foreach(_var ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES}) + if(NOT _var MATCHES BUNDLED) + set(${_feature}_${_var}) + endif() + endforeach() - UNSET(${_feature}_FOUND) - UNSET(${_feature}_VERSION) + unset(${_feature}_FOUND) + unset(${_feature}_VERSION) # # cached: # - FOREACH(_var ${${_feature}_CLEAR_VARIABLES}) - SET(${_var}) - UNSET(${_var} CACHE) - ENDFOREACH() + foreach(_var ${${_feature}_CLEAR_VARIABLES}) + set(${_var}) + unset(${_var} CACHE) + endforeach() - UNSET(${_feature}_CLEAR_VARIABLES CACHE) + unset(${_feature}_CLEAR_VARIABLES CACHE) - MARK_AS_ADVANCED(CLEAR ${_feature}_DIR ${_feature}_ARCH) -ENDMACRO() + mark_as_advanced(CLEAR ${_feature}_DIR ${_feature}_ARCH) +endmacro() diff --git a/cmake/macros/macro_register_feature.cmake b/cmake/macros/macro_register_feature.cmake index 47c23e6b22..f42d00eda2 100644 --- a/cmake/macros/macro_register_feature.cmake +++ b/cmake/macros/macro_register_feature.cmake @@ -19,7 +19,7 @@ # DEAL_II_* variables # # Usage: -# REGISTER_FEATURE(feature) +# register_feature(feature) # # This macro will add # @@ -29,9 +29,9 @@ # DEAL_II_STRING_SUFFIXES to the corresponding DEAL_II_* variables # -MACRO(REGISTER_FEATURE _feature) +macro(REGISTER_FEATURE _feature) - IF(DEFINED ${_feature}_LIBRARIES) + if(DEFINED ${_feature}_LIBRARIES) # # Add ${_feature}_LIBRARIES to # DEAL_II_LIBRARIES @@ -39,34 +39,34 @@ MACRO(REGISTER_FEATURE _feature) # DEAL_II_LIBRARIES_RELEASE # depending on the "optimized", "debug" or "general" keyword # - SET(_toggle "general") - FOREACH(_tmp ${${_feature}_LIBRARIES}) - IF( "${_tmp}" STREQUAL "debug" OR + set(_toggle "general") + foreach(_tmp ${${_feature}_LIBRARIES}) + if( "${_tmp}" STREQUAL "debug" OR "${_tmp}" STREQUAL "optimized" OR "${_tmp}" STREQUAL "general" ) - SET(_toggle "${_tmp}") - ELSE() - IF("${_toggle}" STREQUAL "general") - LIST(APPEND DEAL_II_LIBRARIES ${_tmp}) - ELSEIF("${_toggle}" STREQUAL "debug") - LIST(APPEND DEAL_II_LIBRARIES_DEBUG ${_tmp}) - ELSEIF("${_toggle}" STREQUAL "optimized") - LIST(APPEND DEAL_II_LIBRARIES_RELEASE ${_tmp}) - ENDIF() - ENDIF() - ENDFOREACH() - ENDIF() + set(_toggle "${_tmp}") + else() + if("${_toggle}" STREQUAL "general") + list(APPEND DEAL_II_LIBRARIES ${_tmp}) + elseif("${_toggle}" STREQUAL "debug") + list(APPEND DEAL_II_LIBRARIES_DEBUG ${_tmp}) + elseif("${_toggle}" STREQUAL "optimized") + list(APPEND DEAL_II_LIBRARIES_RELEASE ${_tmp}) + endif() + endif() + endforeach() + endif() - FOREACH(_var ${DEAL_II_LIST_SUFFIXES}) - IF(NOT "${_var}" STREQUAL "LIBRARIES" AND DEFINED ${_feature}_${_var}) - LIST(APPEND DEAL_II_${_var} ${${_feature}_${_var}}) - ENDIF() - ENDFOREACH() + foreach(_var ${DEAL_II_LIST_SUFFIXES}) + if(NOT "${_var}" STREQUAL "LIBRARIES" AND DEFINED ${_feature}_${_var}) + list(APPEND DEAL_II_${_var} ${${_feature}_${_var}}) + endif() + endforeach() - FOREACH(_var ${DEAL_II_STRING_SUFFIXES}) - IF(DEFINED ${_feature}_${_var}) - ADD_FLAGS(DEAL_II_${_var} "${${_feature}_${_var}}") - ENDIF() - ENDFOREACH() + foreach(_var ${DEAL_II_STRING_SUFFIXES}) + if(DEFINED ${_feature}_${_var}) + add_flags(DEAL_II_${_var} "${${_feature}_${_var}}") + endif() + endforeach() -ENDMACRO() +endmacro() diff --git a/cmake/macros/macro_remove_duplicates.cmake b/cmake/macros/macro_remove_duplicates.cmake index 575f5e7938..096ffe1b33 100644 --- a/cmake/macros/macro_remove_duplicates.cmake +++ b/cmake/macros/macro_remove_duplicates.cmake @@ -18,17 +18,17 @@ # order, keeping the rightmost element # # Usage: -# REMOVE_DUPLICATES(list [REVERSE]) +# remove_duplicates(list [REVERSE]) # -MACRO(REMOVE_DUPLICATES _list) - IF(NOT "${${_list}}" STREQUAL "") - IF("${ARGN}" STREQUAL "REVERSE") - LIST(REVERSE ${_list}) - ENDIF() - LIST(REMOVE_DUPLICATES ${_list}) - IF("${ARGN}" STREQUAL "REVERSE") - LIST(REVERSE ${_list}) - ENDIF() - ENDIF() -ENDMACRO() +macro(REMOVE_DUPLICATES _list) + if(NOT "${${_list}}" STREQUAL "") + if("${ARGN}" STREQUAL "REVERSE") + list(REVERSE ${_list}) + endif() + list(REMOVE_DUPLICATES ${_list}) + if("${ARGN}" STREQUAL "REVERSE") + list(REVERSE ${_list}) + endif() + endif() +endmacro() diff --git a/cmake/macros/macro_replace_flag.cmake b/cmake/macros/macro_replace_flag.cmake index 4446dcce69..9157c0f602 100644 --- a/cmake/macros/macro_replace_flag.cmake +++ b/cmake/macros/macro_replace_flag.cmake @@ -18,19 +18,19 @@ # variable. # # Usage: -# REPLACE_FLAG(variable flag replacement) +# replace_flag(variable flag replacement) # -MACRO(REPLACE_FLAG _variable _flag _replacement) - STRING(STRIP "${_replacement}" _replacement_stripped) - STRING(REPLACE " " " " ${_variable} "${${_variable}}") - SET(${_variable} " ${${_variable}} ") - STRING(REPLACE " " " " _flag2 "${_flag}") - IF(NOT "${_replacement_stripped}" STREQUAL "") - STRING(REPLACE " ${_flag2} " " ${_replacement_stripped} " ${_variable} "${${_variable}}") - ELSE() - STRING(REPLACE " ${_flag2} " " " ${_variable} "${${_variable}}") - ENDIF() - STRING(REPLACE " " " " ${_variable} "${${_variable}}") - STRING(STRIP "${${_variable}}" ${_variable}) -ENDMACRO() +macro(REPLACE_FLAG _variable _flag _replacement) + string(STRIP "${_replacement}" _replacement_stripped) + string(REPLACE " " " " ${_variable} "${${_variable}}") + set(${_variable} " ${${_variable}} ") + string(REPLACE " " " " _flag2 "${_flag}") + if(NOT "${_replacement_stripped}" STREQUAL "") + string(REPLACE " ${_flag2} " " ${_replacement_stripped} " ${_variable} "${${_variable}}") + else() + string(REPLACE " ${_flag2} " " " ${_variable} "${${_variable}}") + endif() + string(REPLACE " " " " ${_variable} "${${_variable}}") + string(STRIP "${${_variable}}" ${_variable}) +endmacro() diff --git a/cmake/macros/macro_reset_cmake_required.cmake b/cmake/macros/macro_reset_cmake_required.cmake index a9829cbdb1..de98a049c0 100644 --- a/cmake/macros/macro_reset_cmake_required.cmake +++ b/cmake/macros/macro_reset_cmake_required.cmake @@ -21,9 +21,9 @@ # RESET_CMAKE_REQUIRED_FLAGS # -MACRO(RESET_CMAKE_REQUIRED) - SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED}) - SET(CMAKE_REQUIRED_INCLUDES) - SET(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED}) -ENDMACRO() +macro(RESET_CMAKE_REQUIRED) + set(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED}) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED}) +endmacro() diff --git a/cmake/macros/macro_set_if_empty.cmake b/cmake/macros/macro_set_if_empty.cmake index fcd4d3b077..4e537267bd 100644 --- a/cmake/macros/macro_set_if_empty.cmake +++ b/cmake/macros/macro_set_if_empty.cmake @@ -16,8 +16,8 @@ # # If 'variable' is empty it will be set to 'value' # -MACRO(SET_IF_EMPTY _variable) - IF("${${_variable}}" STREQUAL "") - SET(${_variable} ${ARGN}) - ENDIF() -ENDMACRO() +macro(SET_IF_EMPTY _variable) + if("${${_variable}}" STREQUAL "") + set(${_variable} ${ARGN}) + endif() +endmacro() diff --git a/cmake/macros/macro_setup_source_list.cmake b/cmake/macros/macro_setup_source_list.cmake index 71e4cd2a02..df4ad1862d 100644 --- a/cmake/macros/macro_setup_source_list.cmake +++ b/cmake/macros/macro_setup_source_list.cmake @@ -15,7 +15,7 @@ # # Usage: -# SETUP_SOURCE_LIST("${_list_of_unity_source_files}" +# setup_source_list("${_list_of_unity_source_files}" # "${_list_of_non_unity_source_files}" # _includes_per_unity_file # _source_files) @@ -25,18 +25,18 @@ # otherwise, if DEAL_II_UNITY_BUILD=OFF, then all source files are added to the # variable _source_files. # -MACRO(SETUP_SOURCE_LIST _unity_include_src _separate_src _n_includes_per_unity_file _output_src) - IF(DEAL_II_UNITY_BUILD) - SETUP_UNITY_TARGET("${_unity_include_src}" ${_n_includes_per_unity_file} ${_output_src}) - SET(${_output_src} +macro(SETUP_SOURCE_LIST _unity_include_src _separate_src _n_includes_per_unity_file _output_src) + if(DEAL_II_UNITY_BUILD) + setup_unity_target("${_unity_include_src}" ${_n_includes_per_unity_file} ${_output_src}) + set(${_output_src} ${${_output_src}} ${_separate_src} ) - ELSE() - SET(${_output_src} + else() + set(${_output_src} ${${_output_src}} ${_unity_include_src} ${_separate_src} ) - ENDIF() -ENDMACRO() + endif() +endmacro() diff --git a/cmake/macros/macro_setup_unity_target.cmake b/cmake/macros/macro_setup_unity_target.cmake index 3b4e47d791..debf37c99f 100644 --- a/cmake/macros/macro_setup_unity_target.cmake +++ b/cmake/macros/macro_setup_unity_target.cmake @@ -15,55 +15,55 @@ # # Usage: -# SETUP_UNITY_TARGET("${_list_of_unity_source_files}" _includes_per_unity_file _output_src) +# setup_unity_target("${_list_of_unity_source_files}" _includes_per_unity_file _output_src) # # This macro sets up some number of unity build targets given a list of files # and the number of files to be included per unity file. It generates the unity # build files and appends their names to _output_src. # -MACRO(SETUP_UNITY_TARGET _unity_include_src _n_includes_per_unity_file _output_src) +macro(SETUP_UNITY_TARGET _unity_include_src _n_includes_per_unity_file _output_src) # # The unity build files need access to the original source files: # - INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}) + include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}) - SET(_file_index 0) - FOREACH(_unity_file ${_unity_include_src}) - MATH(EXPR _unity_prefix_index "${_file_index} / ${_n_includes_per_unity_file}") + set(_file_index 0) + foreach(_unity_file ${_unity_include_src}) + math(EXPR _unity_prefix_index "${_file_index} / ${_n_includes_per_unity_file}") # # Get around the fact that CMake does not support nested lists by generating # a file name and then storing that file name in a list (which we will # uniquify later) # - SET(_unity_prefix "unity_${_unity_prefix_index}") - LIST(APPEND _unity_prefixes ${_unity_prefix}) - LIST(APPEND ${_unity_prefix} ${_unity_file}) + set(_unity_prefix "unity_${_unity_prefix_index}") + list(APPEND _unity_prefixes ${_unity_prefix}) + list(APPEND ${_unity_prefix} ${_unity_file}) - MATH(EXPR _file_index "${_file_index} + 1") - ENDFOREACH() + math(EXPR _file_index "${_file_index} + 1") + endforeach() - LIST(REMOVE_DUPLICATES _unity_prefixes) + list(REMOVE_DUPLICATES _unity_prefixes) - FOREACH(_unity_prefix ${_unity_prefixes}) - SET(_unity_file_name "${CMAKE_CURRENT_BINARY_DIR}/${_unity_prefix}.cc") - SET(_tmp_unity_file_name "${CMAKE_CURRENT_BINARY_DIR}/${_unity_prefix}_tmp.cc") + foreach(_unity_prefix ${_unity_prefixes}) + set(_unity_file_name "${CMAKE_CURRENT_BINARY_DIR}/${_unity_prefix}.cc") + set(_tmp_unity_file_name "${CMAKE_CURRENT_BINARY_DIR}/${_unity_prefix}_tmp.cc") # # Note the CMake weirdness: _output_src is actually a string containing the # variable name since we are in a macro... # - SET(${_output_src} + set(${_output_src} ${${_output_src}} ${_unity_file_name} ) - FILE(WRITE "${_tmp_unity_file_name}" + file(WRITE "${_tmp_unity_file_name}" "// This file was automatically generated by the deal.II CMake configuration as // part of the unity build subsystem. Please do not edit this file directly; // instead, make appropriate changes to the relevant CMakeLists.txt file.\n\n" ) - FOREACH(_unity_file ${${_unity_prefix}}) - FILE(APPEND "${_tmp_unity_file_name}" "#include \"${_unity_file}\"\n") - ENDFOREACH() + foreach(_unity_file ${${_unity_prefix}}) + file(APPEND "${_tmp_unity_file_name}" "#include \"${_unity_file}\"\n") + endforeach() # # CMake regenerates all unity files as part of the configuration process, @@ -71,6 +71,6 @@ MACRO(SETUP_UNITY_TARGET _unity_include_src _n_includes_per_unity_file _output_s # using the CONFIGURE_FILE command, which won't update the time stamp unless # the content has changed. # - CONFIGURE_FILE(${_tmp_unity_file_name} ${_unity_file_name} COPYONLY) - ENDFOREACH() -ENDMACRO() + configure_file(${_tmp_unity_file_name} ${_unity_file_name} COPYONLY) + endforeach() +endmacro() diff --git a/cmake/macros/macro_strip_flag.cmake b/cmake/macros/macro_strip_flag.cmake index a55b7b7a15..92b1681558 100644 --- a/cmake/macros/macro_strip_flag.cmake +++ b/cmake/macros/macro_strip_flag.cmake @@ -17,15 +17,15 @@ # Remove all occurrences of "${flag}" in the string variable. # # Usage: -# STRIP_FLAG(variable flag) +# strip_flag(variable flag) # -MACRO(STRIP_FLAG _variable _flag) - STRING(REPLACE " " " " ${_variable} "${${_variable}}") - SET(${_variable} " ${${_variable}} ") - STRING(REPLACE " " " " _flag2 "${_flag}") - STRING(REPLACE " ${_flag2} " " " ${_variable} "${${_variable}}") - STRING(REPLACE " " " " ${_variable} "${${_variable}}") - STRING(STRIP "${${_variable}}" ${_variable}) -ENDMACRO() +macro(STRIP_FLAG _variable _flag) + string(REPLACE " " " " ${_variable} "${${_variable}}") + set(${_variable} " ${${_variable}} ") + string(REPLACE " " " " _flag2 "${_flag}") + string(REPLACE " ${_flag2} " " " ${_variable} "${${_variable}}") + string(REPLACE " " " " ${_variable} "${${_variable}}") + string(STRIP "${${_variable}}" ${_variable}) +endmacro() diff --git a/cmake/macros/macro_switch_library_preference.cmake b/cmake/macros/macro_switch_library_preference.cmake index 7c8741ddec..2bd666d419 100644 --- a/cmake/macros/macro_switch_library_preference.cmake +++ b/cmake/macros/macro_switch_library_preference.cmake @@ -19,14 +19,14 @@ # dynamically linked, i.e. DEAL_II_STATIC_EXECUTABLE=OFF # # Usage: -# SWITCH_LIBRARY_PREFERENCE() +# switch_library_preference() # -MACRO(SWITCH_LIBRARY_PREFERENCE) - IF(DEAL_II_PREFER_STATIC_LIBS AND NOT DEAL_II_STATIC_EXECUTABLE) +macro(SWITCH_LIBRARY_PREFERENCE) + if(DEAL_II_PREFER_STATIC_LIBS AND NOT DEAL_II_STATIC_EXECUTABLE) # # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS # is set. This will prefer static archives instead of shared libraries: - LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) - ENDIF() -ENDMACRO() + list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) + endif() +endmacro() diff --git a/cmake/macros/macro_to_string.cmake b/cmake/macros/macro_to_string.cmake index 00f134ffc4..2811301454 100644 --- a/cmake/macros/macro_to_string.cmake +++ b/cmake/macros/macro_to_string.cmake @@ -18,13 +18,13 @@ # separated string: # # Usage: -# TO_STRING(string ${list1} ${list2} ...) +# to_string(string ${list1} ${list2} ...) # -MACRO(TO_STRING _variable) - SET(${_variable} "") - FOREACH(_var ${ARGN}) - SET(${_variable} "${${_variable}} ${_var}") - ENDFOREACH() - STRING(STRIP "${${_variable}}" ${_variable}) -ENDMACRO() +macro(TO_STRING _variable) + set(${_variable} "") + foreach(_var ${ARGN}) + set(${_variable} "${${_variable}} ${_var}") + endforeach() + string(STRIP "${${_variable}}" ${_variable}) +endmacro() diff --git a/cmake/macros/macro_to_string_and_add_prefix.cmake b/cmake/macros/macro_to_string_and_add_prefix.cmake index 3507f61c4a..bf50fad21c 100644 --- a/cmake/macros/macro_to_string_and_add_prefix.cmake +++ b/cmake/macros/macro_to_string_and_add_prefix.cmake @@ -19,13 +19,13 @@ # element of the list. # # Usage: -# TO_STRING_AND_ADD_PREFIX(string "prefix" ${list1} ${list2} ...) +# to_string_and_add_prefix(string "prefix" ${list1} ${list2} ...) # -MACRO(TO_STRING_AND_ADD_PREFIX _variable _prefix) - SET(${_variable} "") - FOREACH(_var ${ARGN}) - SET(${_variable} "${${_variable}} ${_prefix}${_var}") - ENDFOREACH() - STRING(STRIP "${${_variable}}" ${_variable}) -ENDMACRO() +macro(TO_STRING_AND_ADD_PREFIX _variable _prefix) + set(${_variable} "") + foreach(_var ${ARGN}) + set(${_variable} "${${_variable}} ${_prefix}${_var}") + endforeach() + string(STRIP "${${_variable}}" ${_variable}) +endmacro() diff --git a/cmake/macros/macro_unset_if_changed.cmake b/cmake/macros/macro_unset_if_changed.cmake index c290714de3..06dd893887 100644 --- a/cmake/macros/macro_unset_if_changed.cmake +++ b/cmake/macros/macro_unset_if_changed.cmake @@ -15,7 +15,7 @@ # # Usage: -# UNSET_IF_CHANGED( "string" +# unset_if_changed( "string" # [cached variable names] # ) # @@ -23,15 +23,15 @@ # variable>} and unsets all supplied (cached) variables if this string # changes. # -MACRO(UNSET_IF_CHANGED _variable _string) - IF(DEFINED ${_variable}) - IF(NOT "${${_variable}}" STREQUAL "${_string}") - FOREACH(_arg ${ARGN}) - MESSAGE(STATUS +macro(UNSET_IF_CHANGED _variable _string) + if(DEFINED ${_variable}) + if(NOT "${${_variable}}" STREQUAL "${_string}") + foreach(_arg ${ARGN}) + message(STATUS "Configuration changed. Unsetting cached variable \"${_arg}\" and rerunning checks.") - UNSET(${_arg} CACHE) - ENDFOREACH() - ENDIF() - ENDIF() - SET(${_variable} "${_string}" CACHE INTERNAL "" FORCE) -ENDMACRO() + unset(${_arg} CACHE) + endforeach() + endif() + endif() + set(${_variable} "${_string}" CACHE INTERNAL "" FORCE) +endmacro() diff --git a/cmake/macros/macro_verbose_include.cmake b/cmake/macros/macro_verbose_include.cmake index 9fc59faa1e..a047cd650b 100644 --- a/cmake/macros/macro_verbose_include.cmake +++ b/cmake/macros/macro_verbose_include.cmake @@ -13,8 +13,8 @@ ## ## --------------------------------------------------------------------- -MACRO(VERBOSE_INCLUDE _file) - MESSAGE(STATUS "") - MESSAGE(STATUS "Include ${_file}") - INCLUDE(${_file}) -ENDMACRO() +macro(VERBOSE_INCLUDE _file) + message(STATUS "") + message(STATUS "Include ${_file}") + include(${_file}) +endmacro() diff --git a/cmake/modules/FindADOLC.cmake b/cmake/modules/FindADOLC.cmake index 97b1a840ab..2ac0b2a147 100644 --- a/cmake/modules/FindADOLC.cmake +++ b/cmake/modules/FindADOLC.cmake @@ -27,16 +27,16 @@ # ADOLC_WITH_BOOST_ALLOCATOR # -SET(ADOLC_DIR "" CACHE PATH "An optional hint to an ADOL-C installation") -SET_IF_EMPTY(ADOLC_DIR "$ENV{ADOLC_DIR}") +set(ADOLC_DIR "" CACHE PATH "An optional hint to an ADOL-C installation") +set_if_empty(ADOLC_DIR "$ENV{ADOLC_DIR}") -DEAL_II_FIND_PATH(ADOLC_INCLUDE_DIR +deal_ii_find_path(ADOLC_INCLUDE_DIR NAMES adolc/adolc.h HINTS ${ADOLC_DIR} PATH_SUFFIXES include ) -DEAL_II_FIND_LIBRARY(ADOLC_LIBRARY +deal_ii_find_library(ADOLC_LIBRARY NAMES adolc HINTS ${ADOLC_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib @@ -46,68 +46,68 @@ DEAL_II_FIND_LIBRARY(ADOLC_LIBRARY # Look for adolc_settings.h - we'll query it to determine supported features: # -DEAL_II_FIND_FILE(ADOLC_SETTINGS_H adolc_settings.h +deal_ii_find_file(ADOLC_SETTINGS_H adolc_settings.h HINTS ${ADOLC_INCLUDE_DIR} "${ADOLC_INCLUDE_DIR}/adolc/internal" NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) -IF(EXISTS ${ADOLC_SETTINGS_H}) +if(EXISTS ${ADOLC_SETTINGS_H}) # # Check whether ADOL-C is configured with extra trig functions # - FILE(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_ATRIG_ERF_STRING + file(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_ATRIG_ERF_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+ATRIG_ERF" ) - IF(NOT "${ADOLC_ATRIG_ERF_STRING}" STREQUAL "") - SET(ADOLC_WITH_ATRIG_ERF TRUE) - ELSE() - SET(ADOLC_WITH_ATRIG_ERF FALSE) - ENDIF() + if(NOT "${ADOLC_ATRIG_ERF_STRING}" STREQUAL "") + set(ADOLC_WITH_ATRIG_ERF TRUE) + else() + set(ADOLC_WITH_ATRIG_ERF FALSE) + endif() # # Check whether ADOL-C is configured with advanced branching # - FILE(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_ADVANCED_BRANCHING_STRING + file(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_ADVANCED_BRANCHING_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+ADOLC_ADVANCED_BRANCHING" ) - IF(NOT "${ADOLC_ADVANCED_BRANCHING_STRING}" STREQUAL "") - SET(ADOLC_WITH_ADVANCED_BRANCHING TRUE) - ELSE() - SET(ADOLC_WITH_ADVANCED_BRANCHING FALSE) - ENDIF() + if(NOT "${ADOLC_ADVANCED_BRANCHING_STRING}" STREQUAL "") + set(ADOLC_WITH_ADVANCED_BRANCHING TRUE) + else() + set(ADOLC_WITH_ADVANCED_BRANCHING FALSE) + endif() # # Check whether ADOL-C is configured with tapeless number reference counting # - FILE(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_WITH_TAPELESS_REFCOUNTING_STRING + file(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_WITH_TAPELESS_REFCOUNTING_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+USE_ADTL_REFCOUNTING 1" ) - IF(NOT "${ADOLC_WITH_TAPELESS_REFCOUNTING_STRING}" STREQUAL "") - SET(ADOLC_WITH_TAPELESS_REFCOUNTING TRUE) - ELSE() - SET(ADOLC_WITH_TAPELESS_REFCOUNTING FALSE) - ENDIF() + if(NOT "${ADOLC_WITH_TAPELESS_REFCOUNTING_STRING}" STREQUAL "") + set(ADOLC_WITH_TAPELESS_REFCOUNTING TRUE) + else() + set(ADOLC_WITH_TAPELESS_REFCOUNTING FALSE) + endif() # # Check whether ADOL-C is configured to use the Boost pool allocator # - FILE(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_BOOST_POOL_STRING + file(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_BOOST_POOL_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+USE_BOOST_POOL 1" ) - IF(NOT "${ADOLC_BOOST_POOL_STRING}" STREQUAL "") - SET(ADOLC_WITH_BOOST_ALLOCATOR TRUE) - SET(_additional_include_dirs OPTIONAL BOOST_INCLUDE_DIRS) - SET(_additional_library OPTIONAL BOOST_LIBRARIES) - ELSE() - SET(ADOLC_WITH_BOOST_ALLOCATOR FALSE) - SET(_additional_include_dirs) - SET(_additional_library) - ENDIF() -ENDIF() + if(NOT "${ADOLC_BOOST_POOL_STRING}" STREQUAL "") + set(ADOLC_WITH_BOOST_ALLOCATOR TRUE) + set(_additional_include_dirs OPTIONAL BOOST_INCLUDE_DIRS) + set(_additional_library OPTIONAL BOOST_LIBRARIES) + else() + set(ADOLC_WITH_BOOST_ALLOCATOR FALSE) + set(_additional_include_dirs) + set(_additional_library) + endif() +endif() -DEAL_II_PACKAGE_HANDLE(ADOLC +deal_ii_package_handle(ADOLC LIBRARIES REQUIRED ADOLC_LIBRARY ${_additional_library} diff --git a/cmake/modules/FindARBORX.cmake b/cmake/modules/FindARBORX.cmake index 33ca1166f2..bce8085066 100644 --- a/cmake/modules/FindARBORX.cmake +++ b/cmake/modules/FindARBORX.cmake @@ -22,49 +22,49 @@ # ARBORX_INTERFACE_LINK_FLAGS # -SET(ARBORX_DIR "" CACHE PATH "An optional hint to an ArborX installation") -SET_IF_EMPTY(ARBORX_DIR "$ENV{ARBORX_DIR}") +set(ARBORX_DIR "" CACHE PATH "An optional hint to an ArborX installation") +set_if_empty(ARBORX_DIR "$ENV{ARBORX_DIR}") -FIND_PACKAGE(ArborX +find_package(ArborX HINTS ${ARBORX_DIR} ${ArborX_DIR} $ENV{ArborX_DIR} ) -IF(ArborX_FOUND) - GET_PROPERTY(ARBORX_INSTALL_INCLUDE_DIR TARGET ArborX::ArborX PROPERTY INTERFACE_INCLUDE_DIRECTORIES) +if(ArborX_FOUND) + get_property(ARBORX_INSTALL_INCLUDE_DIR TARGET ArborX::ArborX PROPERTY INTERFACE_INCLUDE_DIRECTORIES) # # Check whether ArborX was compiled with MPI support # - MESSAGE(STATUS + message(STATUS "Checking whether the found ArborX has MPI support:" ) # # Look for ArborX_Config.hpp - we'll query it to determine MPI support: # - DEAL_II_FIND_FILE(ARBORX_CONFIG_HPP ArborX_Config.hpp + deal_ii_find_file(ARBORX_CONFIG_HPP ArborX_Config.hpp HINTS ${ARBORX_INSTALL_INCLUDE_DIR} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) - IF(EXISTS ${ARBORX_CONFIG_HPP}) + if(EXISTS ${ARBORX_CONFIG_HPP}) # # Determine whether ArborX was configured with MPI: # - FILE(STRINGS "${ARBORX_CONFIG_HPP}" ARBORX_MPI_STRING + file(STRINGS "${ARBORX_CONFIG_HPP}" ARBORX_MPI_STRING REGEX "#define ARBORX_ENABLE_MPI") - IF("${ARBORX_MPI_STRING}" STREQUAL "") - MESSAGE(STATUS "ArborX has no MPI support") - ELSE() - SET(DEAL_II_ARBORX_WITH_MPI TRUE) - MESSAGE(STATUS "ArborX has MPI support") - ENDIF() - ENDIF() -ENDIF() + if("${ARBORX_MPI_STRING}" STREQUAL "") + message(STATUS "ArborX has no MPI support") + else() + set(DEAL_II_ARBORX_WITH_MPI TRUE) + message(STATUS "ArborX has MPI support") + endif() + endif() +endif() -DEAL_II_PACKAGE_HANDLE(ARBORX +deal_ii_package_handle(ARBORX # ArborX is a header-only library INCLUDE_DIRS REQUIRED ARBORX_INSTALL_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED ARBORX_INSTALL_INCLUDE_DIR diff --git a/cmake/modules/FindARPACK.cmake b/cmake/modules/FindARPACK.cmake index 3820174e20..8f9baf5176 100644 --- a/cmake/modules/FindARPACK.cmake +++ b/cmake/modules/FindARPACK.cmake @@ -23,30 +23,30 @@ # ARPACK_WITH_PARPACK # -SET(ARPACK_DIR "" CACHE PATH "An optional hint to an ARPACK installation") -SET_IF_EMPTY(ARPACK_DIR "$ENV{ARPACK_DIR}") +set(ARPACK_DIR "" CACHE PATH "An optional hint to an ARPACK installation") +set_if_empty(ARPACK_DIR "$ENV{ARPACK_DIR}") -SET(PARPACK_DIR "" CACHE PATH "An optional hint to a PARPACK installation") -SET_IF_EMPTY(PARPACK_DIR "$ENV{PARPACK_DIR}") +set(PARPACK_DIR "" CACHE PATH "An optional hint to a PARPACK installation") +set_if_empty(PARPACK_DIR "$ENV{PARPACK_DIR}") -DEAL_II_FIND_LIBRARY(ARPACK_LIBRARY +deal_ii_find_library(ARPACK_LIBRARY NAMES arpack HINTS ${ARPACK_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -IF(DEAL_II_WITH_MPI) - GET_FILENAME_COMPONENT(_path "${ARPACK_LIBRARY}" PATH) - DEAL_II_FIND_LIBRARY(PARPACK_LIBRARY +if(DEAL_II_WITH_MPI) + get_filename_component(_path "${ARPACK_LIBRARY}" PATH) + deal_ii_find_library(PARPACK_LIBRARY NAMES parpack HINTS ${_path} ${ARPACK_DIR} ${PARPACK_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -ELSE() - SET(PARPACK_LIBRARY "PARPACK_LIBRARY-NOTFOUND") -ENDIF() +else() + set(PARPACK_LIBRARY "PARPACK_LIBRARY-NOTFOUND") +endif() -IF(NOT DEAL_II_ARPACK_WITH_PARPACK) +if(NOT DEAL_II_ARPACK_WITH_PARPACK) # # We have to avoid an unfortunate symbol clash with "libscalapack.so" - # arpack happened to blindly copy a symbol name... @@ -57,21 +57,21 @@ IF(NOT DEAL_II_ARPACK_WITH_PARPACK) # PETSc's link interface. This can be overridden by manually setting # DEAL_II_ARPACK_WITH_PARPACK to true. # - FOREACH(_libraries ${TRILINOS_LIBRARIES} ${PETSC_LIBRARIES}) - IF("${_libraries}" MATCHES "scalapack") - SET(PARPACK_LIBRARY "PARPACK_LIBRARY-NOTFOUND") - ENDIF() - ENDFOREACH() -ENDIF() + foreach(_libraries ${TRILINOS_LIBRARIES} ${PETSC_LIBRARIES}) + if("${_libraries}" MATCHES "scalapack") + set(PARPACK_LIBRARY "PARPACK_LIBRARY-NOTFOUND") + endif() + endforeach() +endif() -IF(NOT PARPACK_LIBRARY MATCHES "-NOTFOUND") - SET(ARPACK_WITH_PARPACK TRUE) -ELSE() - SET(ARPACK_WITH_PARPACK FALSE) -ENDIF() +if(NOT PARPACK_LIBRARY MATCHES "-NOTFOUND") + set(ARPACK_WITH_PARPACK TRUE) +else() + set(ARPACK_WITH_PARPACK FALSE) +endif() -DEAL_II_PACKAGE_HANDLE(ARPACK +deal_ii_package_handle(ARPACK LIBRARIES OPTIONAL PARPACK_LIBRARY REQUIRED ARPACK_LIBRARY LAPACK_LIBRARIES diff --git a/cmake/modules/FindASSIMP.cmake b/cmake/modules/FindASSIMP.cmake index fb9c638b4e..51c6353dcf 100644 --- a/cmake/modules/FindASSIMP.cmake +++ b/cmake/modules/FindASSIMP.cmake @@ -22,20 +22,20 @@ # ASSIMP_INCLUDE_DIRS # -SET(ASSIMP_DIR "" CACHE PATH "An optional hint to a Assimp installation") -SET_IF_EMPTY(ASSIMP_DIR "$ENV{ASSIMP_DIR}") +set(ASSIMP_DIR "" CACHE PATH "An optional hint to a Assimp installation") +set_if_empty(ASSIMP_DIR "$ENV{ASSIMP_DIR}") -DEAL_II_FIND_LIBRARY(ASSIMP_LIB NAMES assimp +deal_ii_find_library(ASSIMP_LIB NAMES assimp HINTS ${ASSIMP_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_PATH(ASSIMP_INC assimp/defs.h +deal_ii_find_path(ASSIMP_INC assimp/defs.h HINTS ${ASSIMP_DIR} PATH_SUFFIXES include ) -DEAL_II_PACKAGE_HANDLE(ASSIMP +deal_ii_package_handle(ASSIMP LIBRARIES REQUIRED ASSIMP_LIB INCLUDE_DIRS REQUIRED ASSIMP_INC USER_INCLUDE_DIRS REQUIRED ASSIMP_INC diff --git a/cmake/modules/FindBOOST.cmake b/cmake/modules/FindBOOST.cmake index c596de6f0b..4b5f760ce6 100644 --- a/cmake/modules/FindBOOST.cmake +++ b/cmake/modules/FindBOOST.cmake @@ -32,69 +32,69 @@ # - Boost::container::small_vector was introduced in 1.58 and some # serialization bugs in 1.58 were not fixed until 1.59. # -SET(BOOST_VERSION_REQUIRED 1.59) +set(BOOST_VERSION_REQUIRED 1.59) -SET(BOOST_DIR "" CACHE PATH "An optional hint to a BOOST installation") -SET_IF_EMPTY(BOOST_DIR "$ENV{BOOST_DIR}") +set(BOOST_DIR "" CACHE PATH "An optional hint to a BOOST installation") +set_if_empty(BOOST_DIR "$ENV{BOOST_DIR}") -IF(NOT "${BOOST_DIR}" STREQUAL "") - SET(BOOST_ROOT "${BOOST_DIR}") -ENDIF() +if(NOT "${BOOST_DIR}" STREQUAL "") + set(BOOST_ROOT "${BOOST_DIR}") +endif() # # Prefer static libs if BUILD_SHARED_LIBS=OFF: # -IF(NOT BUILD_SHARED_LIBS) - SET(Boost_USE_STATIC_LIBS TRUE) -ENDIF() +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/) +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 -SET(Boost_NO_BOOST_CMAKE ON) +set(Boost_NO_BOOST_CMAKE ON) -IF(DEAL_II_WITH_ZLIB) - FIND_PACKAGE(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS +if(DEAL_II_WITH_ZLIB) + find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS iostreams serialization system thread ) -ELSE() - FIND_PACKAGE(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS +else() + find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS serialization system thread ) -ENDIF() -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) +endif() +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # # Fall back to dynamic libraries if no static libraries could be found: # -IF(NOT Boost_FOUND AND Boost_USE_STATIC_LIBS) - SET(Boost_USE_STATIC_LIBS FALSE) +if(NOT Boost_FOUND AND Boost_USE_STATIC_LIBS) + set(Boost_USE_STATIC_LIBS FALSE) # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup - LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - IF(DEAL_II_WITH_ZLIB) - FIND_PACKAGE(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS iostreams serialization system thread) - ELSE() - FIND_PACKAGE(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS serialization system thread) - ENDIF() - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -ENDIF() + list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) + if(DEAL_II_WITH_ZLIB) + find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS iostreams serialization system thread) + else() + find_package(Boost ${BOOST_VERSION_REQUIRED} COMPONENTS serialization system thread) + endif() + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) +endif() -UNSET(Boost_NO_BOOST_CMAKE) +unset(Boost_NO_BOOST_CMAKE) -IF(Boost_FOUND) - SET(BOOST_VERSION_MAJOR "${Boost_MAJOR_VERSION}") - SET(BOOST_VERSION_MINOR "${Boost_MINOR_VERSION}") - SET(BOOST_VERSION_SUBMINOR "${Boost_SUBMINOR_VERSION}") - SET(BOOST_VERSION +if(Boost_FOUND) + set(BOOST_VERSION_MAJOR "${Boost_MAJOR_VERSION}") + set(BOOST_VERSION_MINOR "${Boost_MINOR_VERSION}") + set(BOOST_VERSION_SUBMINOR "${Boost_SUBMINOR_VERSION}") + set(BOOST_VERSION "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}" ) -ENDIF() +endif() -DEAL_II_PACKAGE_HANDLE(BOOST +deal_ii_package_handle(BOOST LIBRARIES REQUIRED Boost_LIBRARIES INCLUDE_DIRS REQUIRED Boost_INCLUDE_DIRS USER_INCLUDE_DIRS Boost_INCLUDE_DIRS diff --git a/cmake/modules/FindCGAL.cmake b/cmake/modules/FindCGAL.cmake index 7071d5b31e..1d5eda15a2 100644 --- a/cmake/modules/FindCGAL.cmake +++ b/cmake/modules/FindCGAL.cmake @@ -24,69 +24,69 @@ # CGAL_VERSION_SUBMINOR # -SET(CGAL_DIR "" CACHE PATH "An optional hint to a CGAL installation") -SET_IF_EMPTY(CGAL_DIR "$ENV{CGAL_DIR}") +set(CGAL_DIR "" CACHE PATH "An optional hint to a CGAL installation") +set_if_empty(CGAL_DIR "$ENV{CGAL_DIR}") -IF(NOT "${CGAL_DIR}" STREQUAL "") - SET(CGAL_DIR ${CGAL_DIR}) -ENDIF() +if(NOT "${CGAL_DIR}" STREQUAL "") + set(CGAL_DIR ${CGAL_DIR}) +endif() # # CGAL requires C++17 and an externally configured Boost, otherwise the -# call to FIND_PACKAGE(CGAL) will fail. Guard the call to FIND_PACKAGE to +# call to find_package(CGAL) will fail. Guard the call to FIND_PACKAGE to # fail cracefully: # -IF(DEAL_II_HAVE_CXX17 AND NOT FEATURE_BOOST_BUNDLED_CONFIGURED) +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) + 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) # Check version manually. Older binary distros don't do this properly. - IF(CGAL_MAJOR_VERSION LESS 5) - SET(CGAL_FOUND FALSE) - SET(CGAL_INCLUDE_DIRS "-NOTFOUND") - SET(CGAL_LIBRARIES "-NOTFOUND") - MESSAGE(STATUS "CGAL wrappers require CGAL version 5 and above.") - ENDIF() + if(CGAL_MAJOR_VERSION LESS 5) + set(CGAL_FOUND FALSE) + set(CGAL_INCLUDE_DIRS "-NOTFOUND") + set(CGAL_LIBRARIES "-NOTFOUND") + message(STATUS "CGAL wrappers require CGAL version 5 and above.") + endif() - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - IF(CGAL_FOUND) - GET_TARGET_PROPERTY(CGAL_LIBRARIES CGAL::CGAL INTERFACE_LINK_LIBRARIES) + if(CGAL_FOUND) + get_target_property(CGAL_LIBRARIES CGAL::CGAL INTERFACE_LINK_LIBRARIES) - IF(DEFINED CGAL_VERSION) - SET(CGAL_VERSION "${CGAL_VERSION}") + if(DEFINED CGAL_VERSION) + set(CGAL_VERSION "${CGAL_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^([0-9]+).*$" "\\1" CGAL_VERSION_MAJOR "${CGAL_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" CGAL_VERSION_MINOR "${CGAL_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" CGAL_VERSION_SUBMINOR "${CGAL_VERSION}" ) - IF("${CGAL_VERSION_SUBMINOR}" MATCHES "^(|${CGAL_VERSION})$") - SET(CGAL_VERSION_SUBMINOR "0") - ENDIF() - ENDIF() + if("${CGAL_VERSION_SUBMINOR}" MATCHES "^(|${CGAL_VERSION})$") + set(CGAL_VERSION_SUBMINOR "0") + endif() + endif() # Make sure we dont' pass Boost::Boost over to deal.II. - LIST(FILTER CGAL_LIBRARIES EXCLUDE REGEX "::") - ENDIF() -ELSE() - SET(CGAL_FOUND FALSE) - SET(CGAL_INCLUDE_DIRS "-NOTFOUND") - SET(CGAL_LIBRARIES "-NOTFOUND") - MESSAGE(STATUS "CGAL wrappers require C++17. Disabling CGAL Support.") -ENDIF() + list(FILTER CGAL_LIBRARIES EXCLUDE REGEX "::") + endif() +else() + set(CGAL_FOUND FALSE) + set(CGAL_INCLUDE_DIRS "-NOTFOUND") + set(CGAL_LIBRARIES "-NOTFOUND") + message(STATUS "CGAL wrappers require C++17. Disabling CGAL Support.") +endif() -DEAL_II_PACKAGE_HANDLE(CGAL +deal_ii_package_handle(CGAL INCLUDE_DIRS REQUIRED CGAL_INCLUDE_DIRS LIBRARIES diff --git a/cmake/modules/FindCUDA.cmake b/cmake/modules/FindCUDA.cmake index 7bf2507286..b794dec9af 100644 --- a/cmake/modules/FindCUDA.cmake +++ b/cmake/modules/FindCUDA.cmake @@ -27,23 +27,23 @@ # CUDA_VERSION_MINOR # -SET(CUDA_DIR "" CACHE PATH "An optional hint to a CUDA installation") -SET_IF_EMPTY(CUDA_DIR "$ENV{CUDA_DIR}") +set(CUDA_DIR "" CACHE PATH "An optional hint to a CUDA installation") +set_if_empty(CUDA_DIR "$ENV{CUDA_DIR}") -IF(NOT "${CUDA_DIR}" STREQUAL "") - SET(CUDA_TOOLKIT_ROOT_DIR "${CUDA_DIR}") -ENDIF() +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/) +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}") -ENDIF() +if(CUDA_FOUND) + message(STATUS "Configured to use CUDA installation at ${CUDA_TOOLKIT_ROOT_DIR}") +endif() -DEAL_II_PACKAGE_HANDLE(CUDA +deal_ii_package_handle(CUDA LIBRARIES REQUIRED CUDA_LIBRARIES CUDA_cusparse_LIBRARY CUDA_cusolver_LIBRARY INCLUDE_DIRS REQUIRED CUDA_INCLUDE_DIRS USER_INCLUDE_DIRS REQUIRED CUDA_INCLUDE_DIRS diff --git a/cmake/modules/FindGINKGO.cmake b/cmake/modules/FindGINKGO.cmake index 43bb8fdf21..008003dd0c 100644 --- a/cmake/modules/FindGINKGO.cmake +++ b/cmake/modules/FindGINKGO.cmake @@ -23,19 +23,19 @@ # GINKGO_VERSION # -SET(GINKGO_DIR "" CACHE PATH "An optional hint to a GINKGO installation") -SET_IF_EMPTY(GINKGO_DIR "$ENV{GINKGO_DIR}") +set(GINKGO_DIR "" CACHE PATH "An optional hint to a GINKGO installation") +set_if_empty(GINKGO_DIR "$ENV{GINKGO_DIR}") # # Save and restore the ${CMAKE_MODULE_PATH} variable. The Ginkgo project # configuration unfortunately overrides the variable which causes # subsequent configuration to fail. # -SET(_cmake_module_path ${CMAKE_MODULE_PATH}) -FIND_PACKAGE(Ginkgo +set(_cmake_module_path ${CMAKE_MODULE_PATH}) +find_package(Ginkgo HINTS ${GINKGO_DIR} ${Ginkgo_DIR} $ENV{Ginkgo_DIR} ) -SET(CMAKE_MODULE_PATH ${_cmake_module_path}) +set(CMAKE_MODULE_PATH ${_cmake_module_path}) # # Cosmetic clean up: Let's remove all variables beginning with "GINKGO_" @@ -49,13 +49,13 @@ unset(GINKGO_CXX_COMPILER) # exports a list with short names. So check again for every lib and store # the full path: # -SET(_libraries "") -FOREACH(_library ginkgo ${GINKGO_INTERFACE_LINK_LIBRARIES}) +set(_libraries "") +foreach(_library ginkgo ${GINKGO_INTERFACE_LINK_LIBRARIES}) # Make sure to only pick up Ginkgo's own libraries here, skipping # the MPI libraries that are listed here as of Ginkgo 1.5.0. - IF(_library MATCHES "ginkgo.*") - LIST(APPEND _libraries GINKGO_LIBRARY_${_library}) - DEAL_II_FIND_LIBRARY(GINKGO_LIBRARY_${_library} + if(_library MATCHES "ginkgo.*") + list(APPEND _libraries GINKGO_LIBRARY_${_library}) + deal_ii_find_library(GINKGO_LIBRARY_${_library} NAMES ${_library} HINTS ${GINKGO_INSTALL_LIBRARY_DIR} NO_DEFAULT_PATH @@ -65,17 +65,17 @@ FOREACH(_library ginkgo ${GINKGO_INTERFACE_LINK_LIBRARIES}) NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) - ENDIF() -ENDFOREACH() + endif() +endforeach() # # Get ginkgo version number # -IF(Ginkgo_FOUND) - SET(GINKGO_VERSION "${GINKGO_PROJECT_VERSION}") -ENDIF() +if(Ginkgo_FOUND) + set(GINKGO_VERSION "${GINKGO_PROJECT_VERSION}") +endif() -DEAL_II_PACKAGE_HANDLE(GINKGO +deal_ii_package_handle(GINKGO LIBRARIES REQUIRED ${_libraries} INCLUDE_DIRS REQUIRED GINKGO_INSTALL_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED GINKGO_INSTALL_INCLUDE_DIR diff --git a/cmake/modules/FindGMSH.cmake b/cmake/modules/FindGMSH.cmake index 4f2faa56da..60601d84cc 100644 --- a/cmake/modules/FindGMSH.cmake +++ b/cmake/modules/FindGMSH.cmake @@ -24,36 +24,36 @@ # GMSH_WITH_API # -SET(GMSH_DIR "" CACHE PATH "An optional hint to a Gmsh installation containing the gmsh executable") -SET_IF_EMPTY(GMSH_DIR "$ENV{GMSH_DIR}") +set(GMSH_DIR "" CACHE PATH "An optional hint to a Gmsh installation containing the gmsh executable") +set_if_empty(GMSH_DIR "$ENV{GMSH_DIR}") -SET(GMSH_LIBRARY_DIR "" CACHE PATH "An optional hint to a Gmsh SDK installation") -SET_IF_EMPTY(GMSH_LIBRARY_DIR "${GMSH_DIR}") +set(GMSH_LIBRARY_DIR "" CACHE PATH "An optional hint to a Gmsh SDK installation") +set_if_empty(GMSH_LIBRARY_DIR "${GMSH_DIR}") -DEAL_II_FIND_PROGRAM(GMSH_EXE gmsh${CMAKE_EXECUTABLE_SUFFIX} +deal_ii_find_program(GMSH_EXE gmsh${CMAKE_EXECUTABLE_SUFFIX} HINTS ${GMSH_DIR} PATH_SUFFIXES bin ) -DEAL_II_FIND_LIBRARY(GMSH_LIBRARY +deal_ii_find_library(GMSH_LIBRARY NAMES gmsh HINTS ${GMSH_LIBRARY_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_PATH(GMSH_INCLUDE_DIR gmsh.h +deal_ii_find_path(GMSH_INCLUDE_DIR gmsh.h HINTS ${GMSH_LIBRARY_DIR} PATH_SUFFIXES include ) -IF(GMSH_LIBRARY MATCHES "-NOTFOUND" OR +if(GMSH_LIBRARY MATCHES "-NOTFOUND" OR GMSH_INCLUDE_DIR MATCHES "-NOTFOUND") - SET(GMSH_WITH_API FALSE) -ELSE() - SET(GMSH_WITH_API TRUE) -ENDIF() + set(GMSH_WITH_API FALSE) +else() + set(GMSH_WITH_API TRUE) +endif() -DEAL_II_PACKAGE_HANDLE(GMSH +deal_ii_package_handle(GMSH EXECUTABLE REQUIRED GMSH_EXE LIBRARIES diff --git a/cmake/modules/FindGSL.cmake b/cmake/modules/FindGSL.cmake index 4be0f55b8d..726de2d9ce 100644 --- a/cmake/modules/FindGSL.cmake +++ b/cmake/modules/FindGSL.cmake @@ -36,10 +36,10 @@ # the manual work anyway. # -SET(GSL_DIR "" CACHE PATH "An optional hint to a GSL installation") -SET_IF_EMPTY(GSL_DIR "$ENV{GSL_DIR}") +set(GSL_DIR "" CACHE PATH "An optional hint to a GSL installation") +set_if_empty(GSL_DIR "$ENV{GSL_DIR}") -DEAL_II_FIND_LIBRARY(GSL_LIBRARY +deal_ii_find_library(GSL_LIBRARY NAMES gsl HINTS ${GSL_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib @@ -50,27 +50,27 @@ DEAL_II_FIND_LIBRARY(GSL_LIBRARY # found we assume that gsl has to be linked against this library, # alternatively as a fall back try known system cblas names # -DEAL_II_FIND_LIBRARY(GSL_CBLAS_LIBRARY +deal_ii_find_library(GSL_CBLAS_LIBRARY NAMES gslcblas cblas refcblas HINTS ${GSL_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h +deal_ii_find_path(GSL_INCLUDE_DIR gsl/gsl_version.h HINTS ${GSL_DIR} PATH_SUFFIXES include ) -IF(EXISTS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" ) - FILE(STRINGS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" GSL_VERSION_STRING_LINE +if(EXISTS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" ) + file(STRINGS "${GSL_INCLUDE_DIR}/gsl/gsl_version.h" GSL_VERSION_STRING_LINE REGEX "^[ \t]*#[ \t]*define[ \t]+GSL_VERSION" ) - STRING(REGEX REPLACE ".*([0-9].[0-9]+).*" "\\1" GSL_VERSION + string(REGEX REPLACE ".*([0-9].[0-9]+).*" "\\1" GSL_VERSION "${GSL_VERSION_STRING_LINE}" ) -ENDIF() +endif() -DEAL_II_PACKAGE_HANDLE(GSL +deal_ii_package_handle(GSL LIBRARIES REQUIRED GSL_LIBRARY OPTIONAL GSL_CBLAS_LIBRARY diff --git a/cmake/modules/FindHDF5.cmake b/cmake/modules/FindHDF5.cmake index af59d4556a..d013167b7a 100644 --- a/cmake/modules/FindHDF5.cmake +++ b/cmake/modules/FindHDF5.cmake @@ -23,25 +23,25 @@ # HDF5_IS_PARALLEL # -SET(HDF5_DIR "" CACHE PATH "An optional hint to an hdf5 directory") -SET_IF_EMPTY(HDF5_DIR "$ENV{HDF5_DIR}") +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/) +list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -IF(NOT "${HDF5_DIR}" STREQUAL "") - SET(HDF5_ROOT "${HDF5_DIR}") -ENDIF() +if(NOT "${HDF5_DIR}" STREQUAL "") + set(HDF5_ROOT "${HDF5_DIR}") +endif() -SET(HDF5_PREFER_PARALLEL TRUE) -FIND_PACKAGE(HDF5) +set(HDF5_PREFER_PARALLEL TRUE) +find_package(HDF5) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -SET(_include_dirs "${HDF5_INCLUDE_DIRS}") -SET(_libraries "${HDF5_LIBRARIES};${HDF5_HL_LIBRARIES}") +set(_include_dirs "${HDF5_INCLUDE_DIRS}") +set(_libraries "${HDF5_LIBRARIES};${HDF5_HL_LIBRARIES}") -DEAL_II_PACKAGE_HANDLE(HDF5 +deal_ii_package_handle(HDF5 LIBRARIES REQUIRED _libraries OPTIONAL MPI_C_LIBRARIES diff --git a/cmake/modules/FindKOKKOS.cmake b/cmake/modules/FindKOKKOS.cmake index 37dd5dc4e4..5e0f10fcf3 100644 --- a/cmake/modules/FindKOKKOS.cmake +++ b/cmake/modules/FindKOKKOS.cmake @@ -22,64 +22,64 @@ # KOKKOS_INTERFACE_LINK_FLAGS # -SET(KOKKOS_DIR "" CACHE PATH "An optional hint to a Kokkos installation") -SET_IF_EMPTY(KOKKOS_DIR "$ENV{KOKKOS_DIR}") +set(KOKKOS_DIR "" CACHE PATH "An optional hint to a Kokkos installation") +set_if_empty(KOKKOS_DIR "$ENV{KOKKOS_DIR}") -IF(DEAL_II_TRILINOS_WITH_KOKKOS) +if(DEAL_II_TRILINOS_WITH_KOKKOS) # Let ArborX know that we have found Kokkos - SET(Kokkos_FOUND ON) + set(Kokkos_FOUND ON) # Let deal.II know that we have found Kokkos - SET(KOKKOS_FOUND ON) -ELSE() + 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 + 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/) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - IF(Kokkos_FOUND) + if(Kokkos_FOUND) # We are only interested in Kokkos if it is not part of Trilinos - IF(TARGET Kokkos::kokkos AND TARGET Kokkos::kokkoscore) - GET_PROPERTY(KOKKOS_INSTALL_INCLUDE_DIR TARGET Kokkos::kokkos PROPERTY INTERFACE_INCLUDE_DIRECTORIES) - GET_PROPERTY(KOKKOS_EXTRA_LD_FLAGS_FULL TARGET Kokkos::kokkoscore PROPERTY INTERFACE_LINK_OPTIONS) - STRING(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_EXTRA_LD_FLAGS "${KOKKOS_EXTRA_LD_FLAGS_FULL}") - STRING(REPLACE ";" " " KOKKOS_EXTRA_LD_FLAGS "${KOKKOS_EXTRA_LD_FLAGS}") - GET_PROPERTY(KOKKOS_COMPILE_FLAGS_FULL TARGET Kokkos::kokkoscore PROPERTY INTERFACE_COMPILE_OPTIONS) - STRING(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS_FULL}") - STRING(REPLACE ";" " " KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS}") + if(TARGET Kokkos::kokkos AND TARGET Kokkos::kokkoscore) + get_property(KOKKOS_INSTALL_INCLUDE_DIR TARGET Kokkos::kokkos PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + get_property(KOKKOS_EXTRA_LD_FLAGS_FULL TARGET Kokkos::kokkoscore PROPERTY INTERFACE_LINK_OPTIONS) + string(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_EXTRA_LD_FLAGS "${KOKKOS_EXTRA_LD_FLAGS_FULL}") + string(REPLACE ";" " " KOKKOS_EXTRA_LD_FLAGS "${KOKKOS_EXTRA_LD_FLAGS}") + get_property(KOKKOS_COMPILE_FLAGS_FULL TARGET Kokkos::kokkoscore PROPERTY INTERFACE_COMPILE_OPTIONS) + string(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS_FULL}") + string(REPLACE ";" " " KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS}") # We need to disable SIMD vectorization for CUDA device code. # Otherwise, nvcc compilers from version 9 on will emit an error message like: # "[...] contains a vector, which is not supported in device code". We # would like to set the variable in check_01_cpu_feature but at that point # we don't know if CUDA support is enabled in Kokkos - IF(Kokkos_ENABLE_CUDA) - SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) + if(Kokkos_ENABLE_CUDA) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) # Require lambda support to use Kokkos as a backend KOKKOS_CHECK(OPTIONS CUDA_LAMBDA) - ENDIF() + endif() - DEAL_II_FIND_LIBRARY(KOKKOS_CORE_LIBRARY + deal_ii_find_library(KOKKOS_CORE_LIBRARY NAMES kokkoscore HINTS ${KOKKOS_DIR}/lib ${Kokkos_DIR}/lib $ENV{Kokkos_DIR}/lib PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) - DEAL_II_FIND_LIBRARY(KOKKOS_CONTAINERS_LIBRARY + deal_ii_find_library(KOKKOS_CONTAINERS_LIBRARY NAMES kokkoscontainers HINTS ${KOKKOS_DIR}/lib ${Kokkos_DIR}/lib $ENV{Kokkos_DIR}/lib PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) - ELSE() - SET(Kokkos_FOUND FALSE) - ENDIF() - ENDIF() + else() + set(Kokkos_FOUND FALSE) + endif() + endif() - DEAL_II_PACKAGE_HANDLE(KOKKOS + deal_ii_package_handle(KOKKOS LIBRARIES REQUIRED KOKKOS_CORE_LIBRARY KOKKOS_CONTAINERS_LIBRARY INCLUDE_DIRS REQUIRED KOKKOS_INSTALL_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED KOKKOS_INSTALL_INCLUDE_DIR @@ -87,4 +87,4 @@ ELSE() LINKER_FLAGS OPTIONAL KOKKOS_EXTRA_LD_FLAGS CLEAR KOKKOS_DIR KOKKOS_CORE_LIBRARY KOKKOS_CONTAINERS_LIBRARY ) -ENDIF() +endif() diff --git a/cmake/modules/FindLAPACK.cmake b/cmake/modules/FindLAPACK.cmake index d584c63469..ee3ddb2288 100644 --- a/cmake/modules/FindLAPACK.cmake +++ b/cmake/modules/FindLAPACK.cmake @@ -31,49 +31,49 @@ # We have to use a trick with CMAKE_PREFIX_PATH to make LAPACK_DIR and # BLAS_DIR work... # -OPTION(LAPACK_WITH_64BIT_BLAS_INDICES +option(LAPACK_WITH_64BIT_BLAS_INDICES "BLAS has 64 bit integers." OFF ) -MARK_AS_ADVANCED(LAPACK_WITH_64BIT_BLAS_INDICES) +mark_as_advanced(LAPACK_WITH_64BIT_BLAS_INDICES) -SET(LAPACK_DIR "" CACHE PATH "An optional hint to a LAPACK installation") -SET(BLAS_DIR "" CACHE PATH "An optional hint to a BLAS installation") -SET_IF_EMPTY(BLAS_DIR "$ENV{BLAS_DIR}") -SET_IF_EMPTY(LAPACK_DIR "$ENV{LAPACK_DIR}") +set(LAPACK_DIR "" CACHE PATH "An optional hint to a LAPACK installation") +set(BLAS_DIR "" CACHE PATH "An optional hint to a BLAS installation") +set_if_empty(BLAS_DIR "$ENV{BLAS_DIR}") +set_if_empty(LAPACK_DIR "$ENV{LAPACK_DIR}") -SET(_cmake_prefix_path_backup "${CMAKE_PREFIX_PATH}") +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/) +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) +set(CMAKE_PREFIX_PATH ${BLAS_DIR} ${LAPACK_DIR} ${_cmake_prefix_path_backup}) +find_package(BLAS) -SET(CMAKE_PREFIX_PATH ${LAPACK_DIR} ${_cmake_prefix_path_backup}) -FIND_PACKAGE(LAPACK) +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/) +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: # -IF(DEFINED BLAS_LIBRARIES) - LIST(REMOVE_ITEM BLAS_LIBRARIES "FALSE") -ENDIF() -IF(DEFINED LAPACK_LIBRARIES) - LIST(REMOVE_ITEM LAPACK_LIBRARIES "FALSE") -ENDIF() +if(DEFINED BLAS_LIBRARIES) + list(REMOVE_ITEM BLAS_LIBRARIES "FALSE") +endif() +if(DEFINED LAPACK_LIBRARIES) + list(REMOVE_ITEM LAPACK_LIBRARIES "FALSE") +endif() # # Work around a bug in CMake 3.11 by simply filtering out # "PkgConf::PKGC_BLAS". See bug # https://gitlab.kitware.com/cmake/cmake/issues/17934 # -IF(DEFINED BLAS_LIBRARIES) - LIST(REMOVE_ITEM BLAS_LIBRARIES "PkgConfig::PKGC_BLAS") -ENDIF() +if(DEFINED BLAS_LIBRARIES) + list(REMOVE_ITEM BLAS_LIBRARIES "PkgConfig::PKGC_BLAS") +endif() # # Well, in case of static archives we have to manually pick up the @@ -82,8 +82,8 @@ ENDIF() # If CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES is not available, do it # unconditionally for the most common case (gfortran). # -IF(NOT BUILD_SHARED_LIBS) - SET(_fortran_libs ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}) +if(NOT BUILD_SHARED_LIBS) + set(_fortran_libs ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}) # # Since CMake 3.9 the gcc runtime libraries libgcc.a and libgcc_s.so.1 # have been added to the CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES variable. @@ -91,17 +91,17 @@ IF(NOT BUILD_SHARED_LIBS) # libgcc_s.so.1 from the link interface; otherwise completely static # linkage is broken. # - LIST(REMOVE_ITEM _fortran_libs gcc_s) - SET_IF_EMPTY(_fortran_libs gfortran quadmath m) + list(REMOVE_ITEM _fortran_libs gcc_s) + set_if_empty(_fortran_libs gfortran quadmath m) - FOREACH(_lib ${_fortran_libs}) - FIND_SYSTEM_LIBRARY(${_lib}_LIBRARY NAMES ${_lib}) - LIST(APPEND _additional_libraries ${_lib}_LIBRARY) - ENDFOREACH() -ENDIF() + foreach(_lib ${_fortran_libs}) + find_system_library(${_lib}_LIBRARY NAMES ${_lib}) + list(APPEND _additional_libraries ${_lib}_LIBRARY) + endforeach() +endif() -DEAL_II_PACKAGE_HANDLE(LAPACK +deal_ii_package_handle(LAPACK LIBRARIES REQUIRED LAPACK_LIBRARIES OPTIONAL BLAS_LIBRARIES ${_additional_libraries} diff --git a/cmake/modules/FindMETIS.cmake b/cmake/modules/FindMETIS.cmake index 4729c1f7a7..96d0a748f4 100644 --- a/cmake/modules/FindMETIS.cmake +++ b/cmake/modules/FindMETIS.cmake @@ -26,8 +26,8 @@ # METIS_VERSION_SUBMINOR # -SET(METIS_DIR "" CACHE PATH "An optional hint to a metis directory") -SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}") +set(METIS_DIR "" CACHE PATH "An optional hint to a metis directory") +set_if_empty(METIS_DIR "$ENV{METIS_DIR}") # # Metis is usually pretty self contained. So no external dependencies @@ -36,7 +36,7 @@ SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}") # Link in MPI unconditionally (if found). # -DEAL_II_FIND_LIBRARY(METIS_LIBRARY +deal_ii_find_library(METIS_LIBRARY NAMES metis HINTS ${METIS_DIR} PATH_SUFFIXES @@ -46,42 +46,42 @@ DEAL_II_FIND_LIBRARY(METIS_LIBRARY ) -DEAL_II_FIND_PATH(METIS_INCLUDE_DIR metis.h +deal_ii_find_path(METIS_INCLUDE_DIR metis.h HINTS ${METIS_DIR} PATH_SUFFIXES metis include/metis include ) -IF(EXISTS ${METIS_INCLUDE_DIR}/metis.h) +if(EXISTS ${METIS_INCLUDE_DIR}/metis.h) # # Extract the version number out of metis.h # - FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_major_string + file(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_major_string REGEX "METIS_VER_MAJOR" ) - STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_VERSION_MAJOR "${_metis_major_string}" ) - FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_minor_string + file(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_minor_string REGEX "METIS_VER_MINOR" ) - STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_VERSION_MINOR "${_metis_minor_string}" ) - FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_subminor_string + file(STRINGS "${METIS_INCLUDE_DIR}/metis.h" _metis_subminor_string REGEX "METIS_VER_SUBMINOR" ) - STRING(REGEX REPLACE "^.*METIS_VER_SUBMINOR.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*METIS_VER_SUBMINOR.* ([0-9]+).*" "\\1" METIS_VERSION_SUBMINOR "${_metis_subminor_string}" ) - SET(METIS_VERSION + set(METIS_VERSION "${METIS_VERSION_MAJOR}.${METIS_VERSION_MINOR}.${METIS_VERSION_SUBMINOR}" ) - IF("${METIS_VERSION}" STREQUAL "..") - SET(METIS_VERSION) - ENDIF() -ENDIF() + if("${METIS_VERSION}" STREQUAL "..") + set(METIS_VERSION) + endif() +endif() -DEAL_II_PACKAGE_HANDLE(METIS +deal_ii_package_handle(METIS LIBRARIES REQUIRED METIS_LIBRARY OPTIONAL MPI_C_LIBRARIES diff --git a/cmake/modules/FindMPI.cmake b/cmake/modules/FindMPI.cmake index 521755a169..5124acbe3f 100644 --- a/cmake/modules/FindMPI.cmake +++ b/cmake/modules/FindMPI.cmake @@ -35,25 +35,25 @@ # by some external libraries for the link interface. # -IF(MPI_CXX_FOUND) - SET(MPI_FOUND TRUE) -ENDIF() +if(MPI_CXX_FOUND) + set(MPI_FOUND TRUE) +endif() # # Call the system FindMPI.cmake module: # # in case MPIEXEC is specified first call find_program() so that in case of -# success its subsequent runs inside FIND_PACKAGE(MPI) do not alter the +# success its subsequent runs inside find_package(MPI) do not alter the # desired result. -IF(DEFINED ENV{MPIEXEC}) - FIND_PROGRAM(MPIEXEC $ENV{MPIEXEC}) -ENDIF() +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/) +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 @@ -61,10 +61,10 @@ LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # for this to compile, not *just* the correct include directories. # -CLEAR_CMAKE_REQUIRED() -SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED} ${MPI_CXX_COMPILE_FLAGS} ${MPI_CXX_LINK_FLAGS}) -SET(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) -SET(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED} ${MPI_LIBRARIES}) +clear_cmake_required() +set(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED} ${MPI_CXX_COMPILE_FLAGS} ${MPI_CXX_LINK_FLAGS}) +set(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) +set(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED} ${MPI_LIBRARIES}) CHECK_CXX_SOURCE_COMPILES( " #include @@ -75,41 +75,41 @@ CHECK_CXX_SOURCE_COMPILES( " MPI_HAVE_MPI_SEEK_SET ) -RESET_CMAKE_REQUIRED() +reset_cmake_required() # # Newer versions of FindMPI.cmake only populate MPI_CXX_* (and MPI_C_*, # MPI_Fortran_*) variables. Let's rename these version names # -IF(NOT DEFINED MPI_VERSION AND DEFINED MPI_CXX_VERSION) - SET(MPI_VERSION ${MPI_CXX_VERSION}) - SET(MPI_VERSION_MAJOR ${MPI_CXX_VERSION_MAJOR}) - SET(MPI_VERSION_MINOR ${MPI_CXX_VERSION_MINOR}) -ENDIF() +if(NOT DEFINED MPI_VERSION AND DEFINED MPI_CXX_VERSION) + set(MPI_VERSION ${MPI_CXX_VERSION}) + set(MPI_VERSION_MAJOR ${MPI_CXX_VERSION_MAJOR}) + set(MPI_VERSION_MINOR ${MPI_CXX_VERSION_MINOR}) +endif() # # Really old versions of CMake do not export any version information. In # this case, query the mpi.h header for the necessary information: # -DEAL_II_FIND_FILE(MPI_MPI_H +deal_ii_find_file(MPI_MPI_H NAMES mpi.h HINTS ${MPI_CXX_INCLUDE_PATH} ${MPI_C_INCLUDE_PATH} ) -IF(NOT MPI_MPI_H MATCHES "-NOTFOUND" AND NOT DEFINED MPI_VERSION) - FILE(STRINGS "${MPI_MPI_H}" MPI_VERSION_MAJOR_STRING +if(NOT MPI_MPI_H MATCHES "-NOTFOUND" AND NOT DEFINED MPI_VERSION) + file(STRINGS "${MPI_MPI_H}" MPI_VERSION_MAJOR_STRING REGEX "#define.*MPI_VERSION") - STRING(REGEX REPLACE "^.*MPI_VERSION[ ]+([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*MPI_VERSION[ ]+([0-9]+).*" "\\1" MPI_VERSION_MAJOR "${MPI_VERSION_MAJOR_STRING}" ) - FILE(STRINGS ${MPI_MPI_H} MPI_VERSION_MINOR_STRING + file(STRINGS ${MPI_MPI_H} MPI_VERSION_MINOR_STRING REGEX "#define.*MPI_SUBVERSION") - STRING(REGEX REPLACE "^.*MPI_SUBVERSION[ ]+([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*MPI_SUBVERSION[ ]+([0-9]+).*" "\\1" MPI_VERSION_MINOR "${MPI_VERSION_MINOR_STRING}" ) - SET(MPI_VERSION "${MPI_VERSION_MAJOR}.${MPI_VERSION_MINOR}") -ENDIF() + set(MPI_VERSION "${MPI_VERSION_MAJOR}.${MPI_VERSION_MINOR}") +endif() # # Except - this doesn't always work. Some distributions install a header @@ -118,32 +118,32 @@ ENDIF() # straightforward to find the correct header file to query the version # information from. Just set a very conservative default: # -IF(NOT DEFINED MPI_VERSION OR MPI_VERSION STREQUAL ".") - SET(MPI_VERSION "0.0") - SET(MPI_VERSION_MAJOR "0") - SET(MPI_VERSION_MINOR "0") -ENDIF() +if(NOT DEFINED MPI_VERSION OR MPI_VERSION STREQUAL ".") + set(MPI_VERSION "0.0") + set(MPI_VERSION_MAJOR "0") + set(MPI_VERSION_MINOR "0") +endif() # # Make sure that we do not run into underlinking on Debian/Ubuntu systems with # lld / ld.gold and missing libopen-pal.so on the link line: # -CHECK_COMPILER_SETUP( +check_compiler_setup( "${DEAL_II_CXX_FLAGS_SAVED} ${DEAL_II_CXX_FLAGS}" "${DEAL_II_LINKER_FLAGS_SAVED} ${DEAL_II_LINKER_FLAGS}" MPI_UNDERLINKAGE_OK ${MPI_CXX_LIBRARIES} ${MPI_Fortran_LIBRARIES} ${MPI_C_LIBRARIES} ) -IF(NOT MPI_UNDERLINKAGE_OK AND NOT "${MPI_CXX_LIBRARIES}" STREQUAL "") +if(NOT MPI_UNDERLINKAGE_OK AND NOT "${MPI_CXX_LIBRARIES}" STREQUAL "") # This check only works if MPI_CXX_LIBRARIES is non-empty, otherwise we will just give up # and hope for the best... - MESSAGE(STATUS "Trying to avoid underlinkage by expliclitly adding libopen-pal to link line") + message(STATUS "Trying to avoid underlinkage by expliclitly adding libopen-pal to link line") - LIST(GET MPI_CXX_LIBRARIES 0 _lib) - GET_FILENAME_COMPONENT(_hint ${_lib} DIRECTORY) - DEAL_II_FIND_LIBRARY(_mpi_libopen_pal_library + list(GET MPI_CXX_LIBRARIES 0 _lib) + get_filename_component(_hint ${_lib} DIRECTORY) + deal_ii_find_library(_mpi_libopen_pal_library NAMES open-pal HINTS ${_hint} NO_DEFAULT_PATH @@ -163,9 +163,9 @@ IF(NOT MPI_UNDERLINKAGE_OK AND NOT "${MPI_CXX_LIBRARIES}" STREQUAL "") # and we start dropping -fuse-ld=lld and -fuse-ld=ld.gold from the # command line. # -ENDIF() +endif() -DEAL_II_PACKAGE_HANDLE(MPI +deal_ii_package_handle(MPI LIBRARIES OPTIONAL MPI_CXX_LIBRARIES MPI_Fortran_LIBRARIES MPI_C_LIBRARIES _mpi_libopen_pal_library INCLUDE_DIRS diff --git a/cmake/modules/FindMUPARSER.cmake b/cmake/modules/FindMUPARSER.cmake index 26c43797c9..a49717bfac 100644 --- a/cmake/modules/FindMUPARSER.cmake +++ b/cmake/modules/FindMUPARSER.cmake @@ -26,58 +26,58 @@ # MUPARSER_VERSION_SUBMINOR # -SET(MUPARSER_DIR "" CACHE PATH "An optional hint to a MUPARSER installation") -SET_IF_EMPTY(MUPARSER_DIR "$ENV{MUPARSER_DIR}") +set(MUPARSER_DIR "" CACHE PATH "An optional hint to a MUPARSER installation") +set_if_empty(MUPARSER_DIR "$ENV{MUPARSER_DIR}") -DEAL_II_FIND_LIBRARY(MUPARSER_LIBRARY +deal_ii_find_library(MUPARSER_LIBRARY NAMES muparser muparserd HINTS ${MUPARSER_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_PATH(MUPARSER_INCLUDE_DIR muParserDef.h +deal_ii_find_path(MUPARSER_INCLUDE_DIR muParserDef.h HINTS ${MUPARSER_DIR} PATH_SUFFIXES include ) -IF(EXISTS ${MUPARSER_INCLUDE_DIR}/muParserDef.h) - FILE(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING_LINE +if(EXISTS ${MUPARSER_INCLUDE_DIR}/muParserDef.h) + file(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING_LINE # Try to match the line # # #define MUP_VERSION _T("2.2.4") REGEX "^[ \t]*#[ \t]*define[ \t]+MUP_VERSION _T" ) - IF("${MUPARSER_VERSION_STRING_LINE}" STREQUAL "") + if("${MUPARSER_VERSION_STRING_LINE}" STREQUAL "") # try again with the newer version format (starting in at least 2.3.2), # which matches the line # # static const string_type ParserVersion = string_type(_T("2.3.2")); - FILE(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING_LINE + file(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING_LINE REGEX "string_type ParserVersion = string_type" ) - ENDIF() + endif() - STRING(REGEX REPLACE ".*\"(.*)\".*" "\\1" + string(REGEX REPLACE ".*\"(.*)\".*" "\\1" _VERSION_STRING "${MUPARSER_VERSION_STRING_LINE}" ) - STRING(REPLACE "." ";" _VERSION_LIST ${_VERSION_STRING}) - LIST(GET _VERSION_LIST 0 MUPARSER_VERSION_MAJOR) - LIST(GET _VERSION_LIST 1 MUPARSER_VERSION_MINOR) - LIST( LENGTH _VERSION_LIST _LISTLEN ) - IF (${_LISTLEN} GREATER 2) - LIST(GET _VERSION_LIST 2 MUPARSER_VERSION_SUBMINOR) - ELSE() - SET(MUPARSER_VERSION_SUBMINOR "0") - ENDIF() + string(REPLACE "." ";" _VERSION_LIST ${_VERSION_STRING}) + list(GET _VERSION_LIST 0 MUPARSER_VERSION_MAJOR) + list(GET _VERSION_LIST 1 MUPARSER_VERSION_MINOR) + list( LENGTH _VERSION_LIST _LISTLEN ) + if (${_LISTLEN} GREATER 2) + list(GET _VERSION_LIST 2 MUPARSER_VERSION_SUBMINOR) + else() + set(MUPARSER_VERSION_SUBMINOR "0") + endif() - SET(MUPARSER_VERSION + set(MUPARSER_VERSION "${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_SUBMINOR}" ) -ENDIF() +endif() -DEAL_II_PACKAGE_HANDLE(MUPARSER +deal_ii_package_handle(MUPARSER LIBRARIES REQUIRED MUPARSER_LIBRARY INCLUDE_DIRS REQUIRED MUPARSER_INCLUDE_DIR CLEAR MUPARSER_LIBRARY MUPARSER_INCLUDE_DIR diff --git a/cmake/modules/FindOPENCASCADE.cmake b/cmake/modules/FindOPENCASCADE.cmake index f8ce890ba4..d1861554e9 100644 --- a/cmake/modules/FindOPENCASCADE.cmake +++ b/cmake/modules/FindOPENCASCADE.cmake @@ -32,59 +32,59 @@ # -SET(OPENCASCADE_DIR "" CACHE PATH "An optional hint to a OpenCASCADE installation") -SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{OPENCASCADE_DIR}") -SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{OCC_DIR}") -SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{OCE_DIR}") -SET_IF_EMPTY(OPENCASCADE_DIR "$ENV{CASROOT}") +set(OPENCASCADE_DIR "" CACHE PATH "An optional hint to a OpenCASCADE installation") +set_if_empty(OPENCASCADE_DIR "$ENV{OPENCASCADE_DIR}") +set_if_empty(OPENCASCADE_DIR "$ENV{OCC_DIR}") +set_if_empty(OPENCASCADE_DIR "$ENV{OCE_DIR}") +set_if_empty(OPENCASCADE_DIR "$ENV{CASROOT}") -DEAL_II_FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx +deal_ii_find_path(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx HINTS ${OPENCASCADE_DIR} PATH_SUFFIXES include include/oce include/opencascade inc ) -IF(EXISTS ${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx) - FILE(STRINGS "${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx" OPENCASCADE_VERSION +if(EXISTS ${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx) + file(STRINGS "${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx" OPENCASCADE_VERSION REGEX "^[ \t]*#[ \t]*define[ \t]+OCC_VERSION_COMPLETE " ) - STRING(REGEX REPLACE + string(REGEX REPLACE "#define OCC_VERSION_COMPLETE.*\"(.*)\"" "\\1" OPENCASCADE_VERSION "${OPENCASCADE_VERSION}" ) - STRING(REGEX REPLACE + string(REGEX REPLACE "^([0-9]+).*$" "\\1" OPENCASCADE_VERSION_MAJOR "${OPENCASCADE_VERSION}" ) - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" OPENCASCADE_VERSION_MINOR "${OPENCASCADE_VERSION}" ) - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" OPENCASCADE_VERSION_SUBMINOR "${OPENCASCADE_VERSION}" ) -ENDIF() +endif() # These seem to be pretty much the only required ones. -SET(_opencascade_libraries +set(_opencascade_libraries TKBO TKBool TKBRep TKernel TKFeat TKFillet TKG2d TKG3d TKGeomAlgo TKGeomBase TKHLR TKIGES TKMath TKMesh TKOffset TKPrim TKShHealing TKSTEP TKSTEPAttr TKSTEPBase TKSTEP209 TKSTL TKTopAlgo TKXSBase ) -SET(_libraries "") -FOREACH(_library ${_opencascade_libraries}) - LIST(APPEND _libraries OPENCASCADE_${_library}) - DEAL_II_FIND_LIBRARY(OPENCASCADE_${_library} +set(_libraries "") +foreach(_library ${_opencascade_libraries}) + list(APPEND _libraries OPENCASCADE_${_library}) + deal_ii_find_library(OPENCASCADE_${_library} NAMES ${_library} HINTS ${OPENCASCADE_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib mac64/clang/lib mac32/clang/lib lin64/gcc/lib lin32/gcc/lib ) -ENDFOREACH() +endforeach() -DEAL_II_PACKAGE_HANDLE(OPENCASCADE +deal_ii_package_handle(OPENCASCADE LIBRARIES REQUIRED ${_libraries} INCLUDE_DIRS diff --git a/cmake/modules/FindP4EST.cmake b/cmake/modules/FindP4EST.cmake index 0fd3f7e2d3..94f0221558 100644 --- a/cmake/modules/FindP4EST.cmake +++ b/cmake/modules/FindP4EST.cmake @@ -30,18 +30,18 @@ # P4EST_VERSION_PATCH # -SET(P4EST_DIR "" CACHE PATH +set(P4EST_DIR "" CACHE PATH "An optional hint to a p4est installation/directory" ) -SET_IF_EMPTY(P4EST_DIR "$ENV{P4EST_DIR}") -SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}") +set_if_empty(P4EST_DIR "$ENV{P4EST_DIR}") +set_if_empty(SC_DIR "$ENV{SC_DIR}") # # Search for the sc library, usually bundled with p4est. If no SC_DIR was # given, take what we chose for p4est. # -DEAL_II_FIND_PATH(SC_INCLUDE_DIR sc.h +deal_ii_find_path(SC_INCLUDE_DIR sc.h HINTS ${SC_DIR}/FAST ${SC_DIR}/DEBUG @@ -53,13 +53,13 @@ DEAL_II_FIND_PATH(SC_INCLUDE_DIR sc.h sc include/p4est include src sc/src ) -DEAL_II_FIND_LIBRARY(P4EST_LIBRARY_OPTIMIZED +deal_ii_find_library(P4EST_LIBRARY_OPTIMIZED NAMES p4est HINTS ${P4EST_DIR}/FAST ${P4EST_DIR}/DEBUG ${P4EST_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib src ) -DEAL_II_FIND_LIBRARY(SC_LIBRARY_OPTIMIZED +deal_ii_find_library(SC_LIBRARY_OPTIMIZED NAMES sc HINTS ${SC_DIR}/FAST @@ -76,106 +76,106 @@ DEAL_II_FIND_LIBRARY(SC_LIBRARY_OPTIMIZED # Support debug variants as well: # -DEAL_II_FIND_LIBRARY(P4EST_LIBRARY_DEBUG +deal_ii_find_library(P4EST_LIBRARY_DEBUG NAMES p4est HINTS ${P4EST_DIR}/DEBUG PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib src ) -DEAL_II_FIND_LIBRARY(SC_LIBRARY_DEBUG +deal_ii_find_library(SC_LIBRARY_DEBUG NAMES sc HINTS ${SC_DIR}/DEBUG ${P4EST_DIR}/DEBUG PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib src sc/src ) -IF( ( "${P4EST_LIBRARY_OPTIMIZED}" STREQUAL "${P4EST_LIBRARY_DEBUG}" +if( ( "${P4EST_LIBRARY_OPTIMIZED}" STREQUAL "${P4EST_LIBRARY_DEBUG}" AND "${SC_LIBRARY_OPTIMIZED}" STREQUAL "${SC_LIBRARY_DEBUG}" ) OR P4EST_LIBRARY_DEBUG MATCHES "-NOTFOUND" OR SC_LIBRARY_DEBUG MATCHES "-NOTFOUND" ) - SET(_libraries P4EST_LIBRARY_OPTIMIZED SC_LIBRARY_OPTIMIZED) -ELSE() - SET(_libraries + set(_libraries P4EST_LIBRARY_OPTIMIZED SC_LIBRARY_OPTIMIZED) +else() + set(_libraries optimized P4EST_LIBRARY_OPTIMIZED SC_LIBRARY_OPTIMIZED debug P4EST_LIBRARY_DEBUG SC_LIBRARY_DEBUG general ) -ENDIF() +endif() -DEAL_II_FIND_PATH(P4EST_INCLUDE_DIR p4est_config.h +deal_ii_find_path(P4EST_INCLUDE_DIR p4est_config.h HINTS ${P4EST_DIR}/FAST ${P4EST_DIR}/DEBUG ${P4EST_DIR} PATH_SUFFIXES p4est include/p4est include src ) -IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) +if(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) # # Determine mpi support of p4est: # - FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING + file(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING REGEX "#define.*P4EST_MPI 1") - IF("${P4EST_MPI_STRING}" STREQUAL "") - FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING + if("${P4EST_MPI_STRING}" STREQUAL "") + file(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING REGEX "#define.*P4EST_ENABLE_MPI") - IF("${P4EST_MPI_STRING}" STREQUAL "") - SET(P4EST_WITH_MPI FALSE) - ELSE() - SET(P4EST_WITH_MPI TRUE) - ENDIF() - ELSE() - SET(P4EST_WITH_MPI TRUE) - ENDIF() + if("${P4EST_MPI_STRING}" STREQUAL "") + set(P4EST_WITH_MPI FALSE) + else() + set(P4EST_WITH_MPI TRUE) + endif() + else() + set(P4EST_WITH_MPI TRUE) + endif() # # Is p4est built against zlib? # - FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_ZLIB_STRING + file(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_ZLIB_STRING REGEX "^#define.*P4EST_HAVE_ZLIB") - IF("${P4EST_ZLIB_STRING}" STREQUAL "") - SET(P4EST_WITH_ZLIB FALSE) - ELSE() - SET(P4EST_WITH_ZLIB TRUE) - ENDIF() + if("${P4EST_ZLIB_STRING}" STREQUAL "") + set(P4EST_WITH_ZLIB FALSE) + else() + set(P4EST_WITH_ZLIB TRUE) + endif() # # Is binary vtk output enabled? # - FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VTK_BINARY_STRING + file(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VTK_BINARY_STRING REGEX "#define.*P4EST_ENABLE_VTK_BINARY 1") - IF("${P4EST_VTK_BINARY_STRING}" STREQUAL "") - SET(P4EST_WITH_VTK_BINARY FALSE) - ELSE() - SET(P4EST_WITH_VTK_BINARY TRUE) - ENDIF() + if("${P4EST_VTK_BINARY_STRING}" STREQUAL "") + set(P4EST_WITH_VTK_BINARY FALSE) + else() + set(P4EST_WITH_VTK_BINARY TRUE) + endif() # # Does p4est have search local? # - FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_base.h" P4EST_SEARCH_LOCAL_STRING + file(STRINGS "${P4EST_INCLUDE_DIR}/p4est_base.h" P4EST_SEARCH_LOCAL_STRING REGEX "#define.*P4EST_SEARCH_LOCAL") - IF("${P4EST_SEARCH_LOCAL_STRING}" STREQUAL "") - SET(P4EST_WITH_SEARCH_LOCAL FALSE) - ELSE() - SET(P4EST_WITH_SEARCH_LOCAL TRUE) - ENDIF() + if("${P4EST_SEARCH_LOCAL_STRING}" STREQUAL "") + set(P4EST_WITH_SEARCH_LOCAL FALSE) + else() + set(P4EST_WITH_SEARCH_LOCAL TRUE) + endif() # # Extract version numbers: # - FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VERSION + file(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VERSION REGEX "^[ \t]*#[ \t]*define[ \t]+P4EST_VERSION \"") - STRING(REGEX REPLACE "^.*P4EST_VERSION.*\"([0-9]+.*)\".*" "\\1" + string(REGEX REPLACE "^.*P4EST_VERSION.*\"([0-9]+.*)\".*" "\\1" P4EST_VERSION "${P4EST_VERSION}" ) - STRING(REGEX REPLACE + string(REGEX REPLACE "^([0-9]+).*$" "\\1" P4EST_VERSION_MAJOR "${P4EST_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" P4EST_VERSION_MINOR "${P4EST_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" P4EST_VERSION_SUBMINOR "${P4EST_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" P4EST_VERSION_PATCH "${P4EST_VERSION}") @@ -189,16 +189,16 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) # empty or be the full version string. In those cases, set those numbers # to 0 if necessary. # - IF("${P4EST_VERSION_SUBMINOR}" MATCHES "^(|${P4EST_VERSION})$") - SET(P4EST_VERSION_SUBMINOR "0") - ENDIF() + if("${P4EST_VERSION_SUBMINOR}" MATCHES "^(|${P4EST_VERSION})$") + set(P4EST_VERSION_SUBMINOR "0") + endif() - IF("${P4EST_VERSION_PATCH}" MATCHES "^(|${P4EST_VERSION})$") - SET(P4EST_VERSION_PATCH "0") - ENDIF() -ENDIF() + if("${P4EST_VERSION_PATCH}" MATCHES "^(|${P4EST_VERSION})$") + set(P4EST_VERSION_PATCH "0") + endif() +endif() -DEAL_II_PACKAGE_HANDLE(P4EST +deal_ii_package_handle(P4EST LIBRARIES REQUIRED ${_libraries} OPTIONAL LAPACK_LIBRARIES MPI_C_LIBRARIES diff --git a/cmake/modules/FindPETSC.cmake b/cmake/modules/FindPETSC.cmake index ea13227625..5383b3cd33 100644 --- a/cmake/modules/FindPETSC.cmake +++ b/cmake/modules/FindPETSC.cmake @@ -33,12 +33,12 @@ # PETSC_WITH_MUMPS # -SET(PETSC_DIR "" CACHE PATH "An optional hint to a PETSc directory") -SET(PETSC_ARCH "" CACHE STRING "An optional hint to a PETSc arch") -SET_IF_EMPTY(PETSC_DIR "$ENV{PETSC_DIR}") -SET_IF_EMPTY(PETSC_ARCH "$ENV{PETSC_ARCH}") +set(PETSC_DIR "" CACHE PATH "An optional hint to a PETSc directory") +set(PETSC_ARCH "" CACHE STRING "An optional hint to a PETSc arch") +set_if_empty(PETSC_DIR "$ENV{PETSC_DIR}") +set_if_empty(PETSC_ARCH "$ENV{PETSC_ARCH}") -DEAL_II_FIND_LIBRARY(PETSC_LIBRARY +deal_ii_find_library(PETSC_LIBRARY NAMES petsc libpetsc HINTS ${PETSC_DIR} ${PETSC_DIR}/${PETSC_ARCH} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib @@ -48,30 +48,30 @@ DEAL_II_FIND_LIBRARY(PETSC_LIBRARY # Search for the first part of the includes: # -DEAL_II_FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h +deal_ii_find_path(PETSC_INCLUDE_DIR_ARCH petscconf.h HINTS ${PETSC_DIR} ${PETSC_DIR}/${PETSC_ARCH} ${PETSC_INCLUDE_DIRS} PATH_SUFFIXES petsc include include/petsc ) -SET(PETSC_PETSCCONF_H "${PETSC_INCLUDE_DIR_ARCH}/petscconf.h") +set(PETSC_PETSCCONF_H "${PETSC_INCLUDE_DIR_ARCH}/petscconf.h") -MACRO(_petsc_feature_check _var _regex) - FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_${_var}_STRING +macro(_petsc_feature_check _var _regex) + file(STRINGS "${PETSC_PETSCCONF_H}" PETSC_${_var}_STRING REGEX "${_regex}") - IF("${PETSC_${_var}_STRING}" STREQUAL "") - SET(PETSC_WITH_${_var} FALSE) - ELSE() - SET(PETSC_WITH_${_var} TRUE) - ENDIF() -ENDMACRO() - -IF(EXISTS ${PETSC_PETSCCONF_H}) + if("${PETSC_${_var}_STRING}" STREQUAL "") + set(PETSC_WITH_${_var} FALSE) + else() + set(PETSC_WITH_${_var} TRUE) + endif() +endmacro() + +if(EXISTS ${PETSC_PETSCCONF_H}) _petsc_feature_check(64BIT_INDICES "#define.*PETSC_USE_64BIT_INDICES 1") _petsc_feature_check(COMPLEX "#define.*PETSC_USE_COMPLEX 1") _petsc_feature_check(HYPRE "#define.*PETSC_HAVE_HYPRE 1") _petsc_feature_check(MPIUNI "#define.*PETSC_HAVE_MPIUNI 1") _petsc_feature_check(MUMPS "#define.*PETSC_HAVE_MUMPS 1") -ENDIF() +endif() # # Sometimes, this is not enough... @@ -87,37 +87,37 @@ ENDIF() # Either way, we must be able to find petscversion.h: # -DEAL_II_FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h +deal_ii_find_path(PETSC_INCLUDE_DIR_COMMON petscversion.h HINTS ${PETSC_DIR} ${PETSC_DIR}/${PETSC_ARCH} ${PETSC_INCLUDE_DIRS} PATH_SUFFIXES petsc include include/petsc ) -SET(PETSC_PETSCVERSION_H "${PETSC_INCLUDE_DIR_COMMON}/petscversion.h") -IF(EXISTS ${PETSC_PETSCVERSION_H}) - FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING +set(PETSC_PETSCVERSION_H "${PETSC_INCLUDE_DIR_COMMON}/petscversion.h") +if(EXISTS ${PETSC_PETSCVERSION_H}) + file(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING REGEX "^#[ \t]*define[ \t]+PETSC_VERSION_MAJOR[ \t]+[0-9]+[ \t]*$") - STRING(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_MAJOR[ \t]+([0-9]+)[ \t]*$" "\\1" + string(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_MAJOR[ \t]+([0-9]+)[ \t]*$" "\\1" PETSC_VERSION_MAJOR "${PETSC_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MINOR_STRING + file(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MINOR_STRING REGEX "^#[ \t]*define[ \t]+PETSC_VERSION_MINOR[ \t]+[0-9]+[ \t]*$") - STRING(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_MINOR[ \t]+([0-9]+)[ \t]*$" "\\1" + string(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_MINOR[ \t]+([0-9]+)[ \t]*$" "\\1" PETSC_VERSION_MINOR "${PETSC_VERSION_MINOR_STRING}" ) - FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_SUBMINOR_STRING + file(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_SUBMINOR_STRING REGEX "^#[ \t]*define[ \t]+PETSC_VERSION_SUBMINOR[ \t]+[0-9]+[ \t]*$") - STRING(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_SUBMINOR[ \t]+([0-9]+)[ \t]*$" "\\1" + string(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_SUBMINOR[ \t]+([0-9]+)[ \t]*$" "\\1" PETSC_VERSION_SUBMINOR "${PETSC_VERSION_SUBMINOR_STRING}" ) - FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_PATCH_STRING + file(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_PATCH_STRING REGEX "^#[ \t]*define[ \t]+PETSC_VERSION_PATCH[ \t]+[0-9]+[ \t]*$") - STRING(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_PATCH[ \t]+([0-9]+)[ \t]*$" "\\1" + string(REGEX REPLACE "^#[ \t]*define[ \t]+PETSC_VERSION_PATCH[ \t]+([0-9]+)[ \t]*$" "\\1" PETSC_VERSION_PATCH "${PETSC_VERSION_PATCH_STRING}" ) - SET(PETSC_VERSION + set(PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}.${PETSC_VERSION_PATCH}" ) -ENDIF() +endif() # # So, up to this point it was easy. Now, the tricky part. Search for @@ -125,89 +125,89 @@ ENDIF() # that file: # -DEAL_II_FIND_FILE(PETSC_PETSCVARIABLES +deal_ii_find_file(PETSC_PETSCVARIABLES NAMES petscvariables HINTS ${PETSC_DIR}/${PETSC_ARCH} ${PETSC_DIR} PATH_SUFFIXES conf lib/petsc/conf ) -IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND") +if(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND") # # Includes: # - FILE(STRINGS "${PETSC_PETSCVARIABLES}" _external_includes + file(STRINGS "${PETSC_PETSCVARIABLES}" _external_includes REGEX "^PETSC_CC_INCLUDES =.*") - SEPARATE_ARGUMENTS(_external_includes) + separate_arguments(_external_includes) - SET(_petsc_includes) - FOREACH(_token ${_external_includes}) + set(_petsc_includes) + foreach(_token ${_external_includes}) # # workaround: Do not pull in scotch include directory. It clashes with # our use of the metis headers... # - IF(_token MATCHES "^-I" AND NOT _token MATCHES "scotch$") - STRING(REGEX REPLACE "^-I" "" _token "${_token}") - LIST(APPEND _petsc_includes ${_token}) - ENDIF() - ENDFOREACH() + if(_token MATCHES "^-I" AND NOT _token MATCHES "scotch$") + string(REGEX REPLACE "^-I" "" _token "${_token}") + list(APPEND _petsc_includes ${_token}) + endif() + endforeach() # # Link line: # - FILE(STRINGS "${PETSC_PETSCVARIABLES}" PETSC_EXTERNAL_LINK_LINE + file(STRINGS "${PETSC_PETSCVARIABLES}" PETSC_EXTERNAL_LINK_LINE REGEX "^PETSC_WITH_EXTERNAL_LIB =.*") - SEPARATE_ARGUMENTS(PETSC_EXTERNAL_LINK_LINE) + separate_arguments(PETSC_EXTERNAL_LINK_LINE) - SET(_hints) - SET(_petsc_libraries) - SET(_cleanup_variables) - FOREACH(_token ${PETSC_EXTERNAL_LINK_LINE}) - IF(_token MATCHES "^-L") + set(_hints) + set(_petsc_libraries) + set(_cleanup_variables) + foreach(_token ${PETSC_EXTERNAL_LINK_LINE}) + if(_token MATCHES "^-L") # Build up hints with the help of all tokens passed with -L: - STRING(REGEX REPLACE "^-L" "" _token "${_token}") - LIST(APPEND _hints ${_token}) - ELSEIF(_token MATCHES "^-l") + string(REGEX REPLACE "^-L" "" _token "${_token}") + list(APPEND _hints ${_token}) + elseif(_token MATCHES "^-l") # Search for every library that was specified with -l: - STRING(REGEX REPLACE "^-l" "" _token "${_token}") + string(REGEX REPLACE "^-l" "" _token "${_token}") - IF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s|clang_rt)") - LIST(APPEND _cleanup_variables PETSC_LIBRARY_${_token}) + if(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s|clang_rt)") + list(APPEND _cleanup_variables PETSC_LIBRARY_${_token}) - IF(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread)$") - FIND_SYSTEM_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token}) - ELSE() - DEAL_II_FIND_LIBRARY(PETSC_LIBRARY_${_token} + if(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread)$") + find_system_library(PETSC_LIBRARY_${_token} NAMES ${_token}) + else() + deal_ii_find_library(PETSC_LIBRARY_${_token} NAMES ${_token} HINTS ${_hints} ) - ENDIF() - IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND") - LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}}) - ENDIF() + endif() + if(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND") + list(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}}) + endif() - ENDIF() + endif() - ENDIF() - ENDFOREACH() -ENDIF() + endif() + endforeach() +endif() -IF(PETSC_WITH_MPIUNI) +if(PETSC_WITH_MPIUNI) # # Workaround: Some distributions happen to not install petscvariables and # we consequently might miss some essential include directories. Let's # try at least to find the mpiuni include directory. # - DEAL_II_FIND_PATH(PETSC_INCLUDE_DIR_MPIUNI mpiuni/mpi.h + deal_ii_find_path(PETSC_INCLUDE_DIR_MPIUNI mpiuni/mpi.h HINTS ${PETSC_INCLUDE_DIR_COMMON} ${PETSC_INCLUDE_DIR_ARCH} ${_petsc_includes} PATH_SUFFIXES petsc ) - SET(PETSC_INCLUDE_DIR_MPIUNI "${PETSC_INCLUDE_DIR_MPIUNI}/mpiuni") -ENDIF() + set(PETSC_INCLUDE_DIR_MPIUNI "${PETSC_INCLUDE_DIR_MPIUNI}/mpiuni") +endif() -DEAL_II_PACKAGE_HANDLE(PETSC +deal_ii_package_handle(PETSC LIBRARIES REQUIRED PETSC_LIBRARY OPTIONAL _petsc_libraries @@ -222,8 +222,8 @@ DEAL_II_PACKAGE_HANDLE(PETSC PETSC_PETSCVARIABLES ${_cleanup_variables} ) -IF(PETSC_FOUND) - MARK_AS_ADVANCED(PETSC_ARCH) -ELSE() - MARK_AS_ADVANCED(CLEAR PETSC_ARCH) -ENDIF() +if(PETSC_FOUND) + mark_as_advanced(PETSC_ARCH) +else() + mark_as_advanced(CLEAR PETSC_ARCH) +endif() diff --git a/cmake/modules/FindSCALAPACK.cmake b/cmake/modules/FindSCALAPACK.cmake index 9949cb8e10..fa3633b015 100644 --- a/cmake/modules/FindSCALAPACK.cmake +++ b/cmake/modules/FindSCALAPACK.cmake @@ -22,16 +22,16 @@ # SCALAPACK_LINKER_FLAGS # -SET(SCALAPACK_DIR "" CACHE PATH "An optional hint to a SCALAPACK directory") -SET(BLACS_DIR "" CACHE PATH "An optional hint to a BLACS directory") -SET_IF_EMPTY(SCALAPACK_DIR "$ENV{SCALAPACK_DIR}") -SET_IF_EMPTY(BLACS_DIR "$ENV{BLACS_DIR}") +set(SCALAPACK_DIR "" CACHE PATH "An optional hint to a SCALAPACK directory") +set(BLACS_DIR "" CACHE PATH "An optional hint to a BLACS directory") +set_if_empty(SCALAPACK_DIR "$ENV{SCALAPACK_DIR}") +set_if_empty(BLACS_DIR "$ENV{BLACS_DIR}") # # Search for scalapack: # -DEAL_II_FIND_LIBRARY(SCALAPACK_LIBRARY NAMES scalapack scalapack-openmpi scalapack-pvm scalapack-mpi scalapack-mpich scalapack-mpich2 scalapack-lam +deal_ii_find_library(SCALAPACK_LIBRARY NAMES scalapack scalapack-openmpi scalapack-pvm scalapack-mpi scalapack-mpich scalapack-mpich2 scalapack-lam HINTS ${SCALAPACK_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) @@ -39,13 +39,13 @@ DEAL_II_FIND_LIBRARY(SCALAPACK_LIBRARY NAMES scalapack scalapack-openmpi scalapa # # Well, depending on the version of scalapack and the distribution it might # be necessary to search for blacs, too. -IF (SCALAPACK_LIBRARY) - MESSAGE(STATUS "Check if BLACS is embedded in ScaLAPACK library") +if (SCALAPACK_LIBRARY) + message(STATUS "Check if BLACS is embedded in ScaLAPACK library") - CLEAR_CMAKE_REQUIRED() - SET(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED} ${MPI_CXX_COMPILE_FLAGS} ${MPI_CXX_LINK_FLAGS}) - SET(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) - SET(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED} ${MPI_LIBRARIES} ${SCALAPACK_LIBRARY} ${LAPACK_LIBRARIES}) + clear_cmake_required() + set(CMAKE_REQUIRED_FLAGS ${DEAL_II_CXX_FLAGS_SAVED} ${MPI_CXX_COMPILE_FLAGS} ${MPI_CXX_LINK_FLAGS}) + set(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) + set(CMAKE_REQUIRED_LIBRARIES ${DEAL_II_LINKER_FLAGS_SAVED} ${MPI_LIBRARIES} ${SCALAPACK_LIBRARY} ${LAPACK_LIBRARIES}) CHECK_CXX_SOURCE_COMPILES( " #include @@ -59,31 +59,31 @@ IF (SCALAPACK_LIBRARY) " SCALAPACK_LIBRARY_HAS_BLACS ) - RESET_CMAKE_REQUIRED() + reset_cmake_required() # If Blacs is not embedded, try to find it - IF (NOT SCALAPACK_LIBRARY_HAS_BLACS) - MESSAGE(STATUS "Try to find BLACS") + if (NOT SCALAPACK_LIBRARY_HAS_BLACS) + message(STATUS "Try to find BLACS") # FIXME: use instead: - # FIND_PACKAGE(BLACS ${SCALAPACK_FIND_QUIETLY}) - # SET(SCALAPACK_LIBRARY ${SCALAPACK_LIBRARY} ${BLACS_LIBRARY}) + # find_package(BLACS ${SCALAPACK_FIND_QUIETLY}) + # set(SCALAPACK_LIBRARY ${SCALAPACK_LIBRARY} ${BLACS_LIBRARY}) # FIXME: this is potentially dangerous endeavour as we can easily pickup # system-provided BLACS build with some MPI which is inconsistent with # ScaLAPACK library found above. - FOREACH(_lib blacs blacsCinit blacsF77init) - STRING(TOUPPER "${_lib}" _lib_upper) - DEAL_II_FIND_LIBRARY(${_lib_upper}_LIBRARY + foreach(_lib blacs blacsCinit blacsF77init) + string(TOUPPER "${_lib}" _lib_upper) + deal_ii_find_library(${_lib_upper}_LIBRARY NAMES ${_lib} ${_lib}_MPI-LINUX-0 ${_lib}_MPI-DARWIN-0 ${_lib}-openmpi HINTS ${BLACS_DIR} ${SCALAPACK_DIR} ${SCALAPACK_DIR}/../blacs/ PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib LIB ) - ENDFOREACH() - ENDIF() -ENDIF() + endforeach() + endif() +endif() -DEAL_II_PACKAGE_HANDLE(SCALAPACK +deal_ii_package_handle(SCALAPACK LIBRARIES REQUIRED SCALAPACK_LIBRARY LAPACK_LIBRARIES OPTIONAL BLACS_LIBRARY BLACSCINIT_LIBRARY BLACSF77INIT_LIBRARY MPI_Fortran_LIBRARIES diff --git a/cmake/modules/FindSLEPC.cmake b/cmake/modules/FindSLEPC.cmake index d252aa6f89..ca60d8c17b 100644 --- a/cmake/modules/FindSLEPC.cmake +++ b/cmake/modules/FindSLEPC.cmake @@ -28,23 +28,23 @@ # SLEPC_VERSION_PATCH # -SET(SLEPC_DIR "" CACHE PATH "An optional hint to a SLEPC directory") -SET_IF_EMPTY(SLEPC_DIR "$ENV{SLEPC_DIR}") -SET_IF_EMPTY(PETSC_DIR "$ENV{PETSC_DIR}") -SET_IF_EMPTY(PETSC_ARCH "$ENV{PETSC_ARCH}") +set(SLEPC_DIR "" CACHE PATH "An optional hint to a SLEPC directory") +set_if_empty(SLEPC_DIR "$ENV{SLEPC_DIR}") +set_if_empty(PETSC_DIR "$ENV{PETSC_DIR}") +set_if_empty(PETSC_ARCH "$ENV{PETSC_ARCH}") # # Luckily, SLEPc wants the same insanity as PETSc, so we can just copy the # mechanism. # -DEAL_II_FIND_LIBRARY(SLEPC_LIBRARY +deal_ii_find_library(SLEPC_LIBRARY NAMES slepc libslepc HINTS ${SLEPC_DIR} ${SLEPC_DIR}/${PETSC_ARCH} ${PETSC_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_PATH(SLEPC_INCLUDE_DIR_ARCH slepcconf.h +deal_ii_find_path(SLEPC_INCLUDE_DIR_ARCH slepcconf.h HINTS ${SLEPC_DIR} ${SLEPC_DIR}/${PETSC_ARCH} @@ -53,7 +53,7 @@ DEAL_II_FIND_PATH(SLEPC_INCLUDE_DIR_ARCH slepcconf.h PATH_SUFFIXES slepc include include/slepc ) -DEAL_II_FIND_PATH(SLEPC_INCLUDE_DIR_COMMON slepcversion.h +deal_ii_find_path(SLEPC_INCLUDE_DIR_COMMON slepcversion.h HINTS ${SLEPC_DIR} ${SLEPC_DIR}/${PETSC_ARCH} @@ -62,34 +62,34 @@ DEAL_II_FIND_PATH(SLEPC_INCLUDE_DIR_COMMON slepcversion.h PATH_SUFFIXES slepc include include/slepc ) -SET(SLEPC_SLEPCVERSION_H "${SLEPC_INCLUDE_DIR_COMMON}/slepcversion.h") -IF(EXISTS ${SLEPC_SLEPCVERSION_H}) - FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MAJOR_STRING +set(SLEPC_SLEPCVERSION_H "${SLEPC_INCLUDE_DIR_COMMON}/slepcversion.h") +if(EXISTS ${SLEPC_SLEPCVERSION_H}) + file(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MAJOR_STRING REGEX "#define.*SLEPC_VERSION_MAJOR") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_MAJOR.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SLEPC_VERSION_MAJOR.* ([0-9]+).*" "\\1" SLEPC_VERSION_MAJOR "${SLEPC_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MINOR_STRING + file(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MINOR_STRING REGEX "#define.*SLEPC_VERSION_MINOR") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_MINOR.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SLEPC_VERSION_MINOR.* ([0-9]+).*" "\\1" SLEPC_VERSION_MINOR "${SLEPC_VERSION_MINOR_STRING}" ) - FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_SUBMINOR_STRING + file(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_SUBMINOR_STRING REGEX "#define.*SLEPC_VERSION_SUBMINOR") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_SUBMINOR.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SLEPC_VERSION_SUBMINOR.* ([0-9]+).*" "\\1" SLEPC_VERSION_SUBMINOR "${SLEPC_VERSION_SUBMINOR_STRING}" ) - FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_PATCH_STRING + file(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_PATCH_STRING REGEX "#define.*SLEPC_VERSION_PATCH") - STRING(REGEX REPLACE "^.*SLEPC_VERSION_PATCH.* ([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SLEPC_VERSION_PATCH.* ([0-9]+).*" "\\1" SLEPC_VERSION_PATCH "${SLEPC_VERSION_PATCH_STRING}" ) - SET(SLEPC_VERSION + set(SLEPC_VERSION "${SLEPC_VERSION_MAJOR}.${SLEPC_VERSION_MINOR}.${SLEPC_VERSION_SUBMINOR}.${SLEPC_VERSION_PATCH}" ) -ENDIF() +endif() -DEAL_II_PACKAGE_HANDLE(SLEPC +deal_ii_package_handle(SLEPC LIBRARIES REQUIRED SLEPC_LIBRARY PETSC_LIBRARIES INCLUDE_DIRS diff --git a/cmake/modules/FindSUNDIALS.cmake b/cmake/modules/FindSUNDIALS.cmake index dbfb90377c..a9c4aa8e8b 100644 --- a/cmake/modules/FindSUNDIALS.cmake +++ b/cmake/modules/FindSUNDIALS.cmake @@ -36,93 +36,93 @@ # Here SUNDIALS_INCLUDE_DIR is just '/prefix/include/', not # '/prefix/include/sundials/'. -SET(SUNDIALS_DIR "" CACHE PATH "An optional hint to a SUNDIALS_DIR installation") -SET_IF_EMPTY(SUNDIALS_DIR "$ENV{SUNDIALS_DIR}") +set(SUNDIALS_DIR "" CACHE PATH "An optional hint to a SUNDIALS_DIR installation") +set_if_empty(SUNDIALS_DIR "$ENV{SUNDIALS_DIR}") -DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_IDAS NAMES sundials_idas +deal_ii_find_library(SUNDIALS_LIB_IDAS NAMES sundials_idas HINTS ${SUNDIALS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_IDA NAMES sundials_ida +deal_ii_find_library(SUNDIALS_LIB_IDA NAMES sundials_ida HINTS ${SUNDIALS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_ARKODE NAMES sundials_arkode +deal_ii_find_library(SUNDIALS_LIB_ARKODE NAMES sundials_arkode HINTS ${SUNDIALS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_KINSOL NAMES sundials_kinsol +deal_ii_find_library(SUNDIALS_LIB_KINSOL NAMES sundials_kinsol HINTS ${SUNDIALS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_SER NAMES sundials_nvecserial +deal_ii_find_library(SUNDIALS_LIB_SER NAMES sundials_nvecserial HINTS ${SUNDIALS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -DEAL_II_FIND_PATH(SUNDIALS_INCLUDE_DIR sundials/sundials_version.h +deal_ii_find_path(SUNDIALS_INCLUDE_DIR sundials/sundials_version.h HINTS ${SUNDIALS_DIR} PATH_SUFFIXES include ) -SET(_sundials_lib_par) -IF(DEAL_II_WITH_MPI) - DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_PAR NAMES sundials_nvecparallel +set(_sundials_lib_par) +if(DEAL_II_WITH_MPI) + deal_ii_find_library(SUNDIALS_LIB_PAR NAMES sundials_nvecparallel HINTS ${SUNDIALS_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) - SET(_sundials_lib_par "SUNDIALS_LIB_PAR") -ENDIF() + set(_sundials_lib_par "SUNDIALS_LIB_PAR") +endif() # # If IDAS is available, we prefer said library over IDA. We have to make # sure to only link one of the two library variants: # -IF(NOT SUNDIALS_LIB_IDAS MATCHES "-NOTFOUND") - SET(_sundials_lib_ida "SUNDIALS_LIB_IDAS") - SET(SUNDIALS_WITH_IDAS TRUE) -ELSE() - SET(_sundials_lib_ida "SUNDIALS_LIB_IDA") - SET(SUNDIALS_WITH_IDAS FALSE) -ENDIF() +if(NOT SUNDIALS_LIB_IDAS MATCHES "-NOTFOUND") + set(_sundials_lib_ida "SUNDIALS_LIB_IDAS") + set(SUNDIALS_WITH_IDAS TRUE) +else() + set(_sundials_lib_ida "SUNDIALS_LIB_IDA") + set(SUNDIALS_WITH_IDAS FALSE) +endif() # # Extract SUNDIALS version. # -DEAL_II_FIND_FILE(SUNDIALS_CONFIG_H +deal_ii_find_file(SUNDIALS_CONFIG_H NAMES sundials_config.h HINTS ${SUNDIALS_INCLUDE_DIR}/sundials ) -IF(NOT SUNDIALS_CONFIG_H MATCHES "-NOTFOUND") - FILE(STRINGS "${SUNDIALS_CONFIG_H}" SUNDIALS_VERSION_MAJOR_STRING +if(NOT SUNDIALS_CONFIG_H MATCHES "-NOTFOUND") + file(STRINGS "${SUNDIALS_CONFIG_H}" SUNDIALS_VERSION_MAJOR_STRING REGEX "#define.*SUNDIALS_VERSION_MAJOR" ) - STRING(REGEX REPLACE "^.*SUNDIALS_VERSION_MAJOR.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SUNDIALS_VERSION_MAJOR.*([0-9]+).*" "\\1" SUNDIALS_VERSION_MAJOR "${SUNDIALS_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${SUNDIALS_CONFIG_H}" SUNDIALS_VERSION_MINOR_STRING + file(STRINGS "${SUNDIALS_CONFIG_H}" SUNDIALS_VERSION_MINOR_STRING REGEX "#define.*SUNDIALS_VERSION_MINOR" ) - STRING(REGEX REPLACE "^.*SUNDIALS_VERSION_MINOR.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SUNDIALS_VERSION_MINOR.*([0-9]+).*" "\\1" SUNDIALS_VERSION_MINOR "${SUNDIALS_VERSION_MINOR_STRING}" ) - FILE(STRINGS "${SUNDIALS_CONFIG_H}" SUNDIALS_VERSION_PATCH_STRING + file(STRINGS "${SUNDIALS_CONFIG_H}" SUNDIALS_VERSION_PATCH_STRING REGEX "#define.*SUNDIALS_VERSION_PATCH" ) - STRING(REGEX REPLACE "^.*SUNDIALS_VERSION_PATCH.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SUNDIALS_VERSION_PATCH.*([0-9]+).*" "\\1" SUNDIALS_VERSION_PATCH "${SUNDIALS_VERSION_PATCH_STRING}" ) - SET(SUNDIALS_VERSION + set(SUNDIALS_VERSION "${SUNDIALS_VERSION_MAJOR}.${SUNDIALS_VERSION_MINOR}.${SUNDIALS_VERSION_PATCH}" ) -ENDIF() +endif() -DEAL_II_PACKAGE_HANDLE(SUNDIALS +deal_ii_package_handle(SUNDIALS LIBRARIES REQUIRED ${_sundials_lib_ida} SUNDIALS_LIB_ARKODE diff --git a/cmake/modules/FindSYMENGINE.cmake b/cmake/modules/FindSYMENGINE.cmake index 84584db94f..a9ea291bd6 100644 --- a/cmake/modules/FindSYMENGINE.cmake +++ b/cmake/modules/FindSYMENGINE.cmake @@ -23,19 +23,19 @@ # SYMENGINE_WITH_LLVM # -SET(SYMENGINE_DIR "" CACHE PATH "An optional hint to a SymEngine installation") -SET_IF_EMPTY(SYMENGINE_DIR "$ENV{SYMENGINE_DIR}") +set(SYMENGINE_DIR "" CACHE PATH "An optional hint to a SymEngine installation") +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 (DEAL_II_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) # # Include the SymEngine: # -FIND_PACKAGE(SymEngine +find_package(SymEngine CONFIG QUIET HINTS ${SYMENGINE_DIR} PATH_SUFFIXES lib/cmake/symengine @@ -45,14 +45,14 @@ FIND_PACKAGE(SymEngine # # Reset the CMake module path # -SET (CMAKE_MODULE_PATH ${DEAL_II_CMAKE_MODULE_PATH}) +set (CMAKE_MODULE_PATH ${DEAL_II_CMAKE_MODULE_PATH}) # # Look for symengine_config.h - we'll query it to determine supported features: # -IF(SymEngine_FOUND) - DEAL_II_FIND_FILE(SYMENGINE_SETTINGS_H symengine_config.h +if(SymEngine_FOUND) + deal_ii_find_file(SYMENGINE_SETTINGS_H symengine_config.h HINTS ${SYMENGINE_INCLUDE_DIRS} PATH_SUFFIXES symengine NO_DEFAULT_PATH @@ -62,47 +62,47 @@ IF(SymEngine_FOUND) NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) -ENDIF() +endif() # # Version check # -IF(EXISTS ${SYMENGINE_SETTINGS_H}) +if(EXISTS ${SYMENGINE_SETTINGS_H}) - FILE(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_VERSION_MAJOR_STRING + file(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_VERSION_MAJOR_STRING REGEX "#define.*SYMENGINE_MAJOR_VERSION") - STRING(REGEX REPLACE "^.*SYMENGINE_MAJOR_VERSION.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SYMENGINE_MAJOR_VERSION.*([0-9]+).*" "\\1" SYMENGINE_VERSION_MAJOR "${SYMENGINE_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_VERSION_MINOR_STRING + file(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_VERSION_MINOR_STRING REGEX "#define.*SYMENGINE_MINOR_VERSION") - STRING(REGEX REPLACE "^.*SYMENGINE_MINOR_VERSION.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SYMENGINE_MINOR_VERSION.*([0-9]+).*" "\\1" SYMENGINE_VERSION_MINOR "${SYMENGINE_VERSION_MINOR_STRING}" ) - FILE(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_VERSION_PATCH_STRING + file(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_VERSION_PATCH_STRING REGEX "#define.*SYMENGINE_PATCH_VERSION") - STRING(REGEX REPLACE "^.*SYMENGINE_PATCH_VERSION.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*SYMENGINE_PATCH_VERSION.*([0-9]+).*" "\\1" SYMENGINE_VERSION_PATCH "${SYMENGINE_VERSION_PATCH_STRING}" ) - SET(SYMENGINE_VERSION ${SymEngine_VERSION}) -ENDIF() + set(SYMENGINE_VERSION ${SymEngine_VERSION}) +endif() # # Feature checks # -MACRO(_symengine_feature_check _var _regex) - IF(EXISTS ${SYMENGINE_SETTINGS_H}) - FILE(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_${_var}_STRING +macro(_symengine_feature_check _var _regex) + if(EXISTS ${SYMENGINE_SETTINGS_H}) + file(STRINGS "${SYMENGINE_SETTINGS_H}" SYMENGINE_${_var}_STRING REGEX "${_regex}") - IF("${SYMENGINE_${_var}_STRING}" STREQUAL "") - SET(SYMENGINE_WITH_${_var} FALSE) - ELSE() - SET(SYMENGINE_WITH_${_var} TRUE) - ENDIF() - ENDIF() -ENDMACRO() + if("${SYMENGINE_${_var}_STRING}" STREQUAL "") + set(SYMENGINE_WITH_${_var} FALSE) + else() + set(SYMENGINE_WITH_${_var} TRUE) + endif() + endif() +endmacro() # Other possible features of interest: BOOST, GMP _symengine_feature_check(LLVM "#define.*HAVE_SYMENGINE_LLVM") @@ -111,28 +111,28 @@ _symengine_feature_check(LLVM "#define.*HAVE_SYMENGINE_LLVM") # Sanitize include dirs: # -STRING(REGEX REPLACE +string(REGEX REPLACE "(lib64|lib)\\/cmake\\/symengine\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/" "" SYMENGINE_INCLUDE_DIRS "${SYMENGINE_INCLUDE_DIRS}" ) -REMOVE_DUPLICATES(SYMENGINE_INCLUDE_DIRS) +remove_duplicates(SYMENGINE_INCLUDE_DIRS) # # Get the full path for the SYMENGINE_LIBRARIES. Some of these libraries are # CMake targets, so we can query them directly for this information. # -FOREACH(SYMENGINE_LIBRARY_NAME ${SYMENGINE_LIBRARIES}) - IF (TARGET ${SYMENGINE_LIBRARY_NAME}) - GET_PROPERTY(SYMENGINE_LIBRARY TARGET ${SYMENGINE_LIBRARY_NAME} PROPERTY LOCATION) - ELSE () - SET(SYMENGINE_LIBRARY ${SYMENGINE_LIBRARY_NAME}) - ENDIF() +foreach(SYMENGINE_LIBRARY_NAME ${SYMENGINE_LIBRARIES}) + if (TARGET ${SYMENGINE_LIBRARY_NAME}) + get_property(SYMENGINE_LIBRARY TARGET ${SYMENGINE_LIBRARY_NAME} PROPERTY LOCATION) + else () + set(SYMENGINE_LIBRARY ${SYMENGINE_LIBRARY_NAME}) + endif() - SET(_symengine_libraries ${_symengine_libraries} ${SYMENGINE_LIBRARY}) -ENDFOREACH() -SET(SYMENGINE_LIBRARIES ${_symengine_libraries}) + set(_symengine_libraries ${_symengine_libraries} ${SYMENGINE_LIBRARY}) +endforeach() +set(SYMENGINE_LIBRARIES ${_symengine_libraries}) -DEAL_II_PACKAGE_HANDLE(SYMENGINE +deal_ii_package_handle(SYMENGINE LIBRARIES REQUIRED SYMENGINE_LIBRARIES INCLUDE_DIRS REQUIRED SYMENGINE_INCLUDE_DIRS USER_INCLUDE_DIRS REQUIRED SYMENGINE_INCLUDE_DIRS diff --git a/cmake/modules/FindTASKFLOW.cmake b/cmake/modules/FindTASKFLOW.cmake index e118fbbabf..b668607645 100644 --- a/cmake/modules/FindTASKFLOW.cmake +++ b/cmake/modules/FindTASKFLOW.cmake @@ -22,10 +22,10 @@ # TASKFLOW_VERSION # -SET(TASKFLOW_DIR "" CACHE PATH "An optional hint to a Taskflow installation") -SET_IF_EMPTY(TASKFLOW_DIR "$ENV{TASKFLOW_DIR}") +set(TASKFLOW_DIR "" CACHE PATH "An optional hint to a Taskflow installation") +set_if_empty(TASKFLOW_DIR "$ENV{TASKFLOW_DIR}") -FIND_PACKAGE(TASKFLOW_CONFIG +find_package(TASKFLOW_CONFIG CONFIG QUIET NAMES Taskflow HINTS @@ -38,20 +38,20 @@ FIND_PACKAGE(TASKFLOW_CONFIG NO_SYSTEM_ENVIRONMENT_PATH ) -SET(TASKFLOW_INCLUDE_DIR ${Taskflow_INCLUDE_DIR}) +set(TASKFLOW_INCLUDE_DIR ${Taskflow_INCLUDE_DIR}) # # Extract version numbers: # -SET(TASKFLOW_VERSION "${TASKFLOW_CONFIG_VERSION}") -STRING(REGEX REPLACE +set(TASKFLOW_VERSION "${TASKFLOW_CONFIG_VERSION}") +string(REGEX REPLACE "^([0-9]+).*$" "\\1" TASKFLOW_VERSION_MAJOR "${TASKFLOW_CONFIG_VERSION}") -STRING(REGEX REPLACE +string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" TASKFLOW_VERSION_MINOR "${TASKFLOW_CONFIG_VERSION}") -DEAL_II_PACKAGE_HANDLE(TASKFLOW +deal_ii_package_handle(TASKFLOW INCLUDE_DIRS REQUIRED TASKFLOW_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED TASKFLOW_INCLUDE_DIR CLEAR TASKFLOW_CONFIG_DIR diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index bc08d1ed99..5cd14eaa87 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -27,11 +27,11 @@ # TBB_VERSION_MINOR # -SET(TBB_DIR "" CACHE PATH "An optional hint to a TBB installation") -SET_IF_EMPTY(TBB_DIR "$ENV{TBB_DIR}") +set(TBB_DIR "" CACHE PATH "An optional hint to a TBB installation") +set_if_empty(TBB_DIR "$ENV{TBB_DIR}") -FILE(GLOB _path ${TBB_DIR}/build/*_release ${TBB_DIR}/lib/intel64/gcc*) -DEAL_II_FIND_LIBRARY(TBB_LIBRARY +file(GLOB _path ${TBB_DIR}/build/*_release ${TBB_DIR}/lib/intel64/gcc*) +deal_ii_find_library(TBB_LIBRARY NAMES tbb HINTS ${_path} @@ -42,79 +42,79 @@ DEAL_II_FIND_LIBRARY(TBB_LIBRARY # # Also search for the debug library: # -FILE(GLOB _path ${TBB_DIR}/build/*_debug ${TBB_DIR}/lib/intel64/gcc*) -DEAL_II_FIND_LIBRARY(TBB_DEBUG_LIBRARY +file(GLOB _path ${TBB_DIR}/build/*_debug ${TBB_DIR}/lib/intel64/gcc*) +deal_ii_find_library(TBB_DEBUG_LIBRARY NAMES tbb_debug HINTS ${_path} ${TBB_DIR} PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib ) -IF(NOT TBB_DEBUG_LIBRARY MATCHES "-NOTFOUND") - SET(TBB_WITH_DEBUGLIB TRUE) - SET(_libraries debug TBB_DEBUG_LIBRARY optimized TBB_LIBRARY) -ELSE() - SET(_libraries TBB_LIBRARY) -ENDIF() +if(NOT TBB_DEBUG_LIBRARY MATCHES "-NOTFOUND") + set(TBB_WITH_DEBUGLIB TRUE) + set(_libraries debug TBB_DEBUG_LIBRARY optimized TBB_LIBRARY) +else() + set(_libraries TBB_LIBRARY) +endif() # # Check for old TBB header layout: # -DEAL_II_FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h +deal_ii_find_path(TBB_INCLUDE_DIR tbb/tbb_stddef.h HINTS ${TBB_DIR} PATH_SUFFIXES include include/tbb tbb ) -IF(EXISTS ${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h) - FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MAJOR_STRING +if(EXISTS ${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h) + file(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MAJOR_STRING REGEX "#define.*TBB_VERSION_MAJOR") - STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR +([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*TBB_VERSION_MAJOR +([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${TBB_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MINOR_STRING + file(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MINOR_STRING REGEX "#define.*TBB_VERSION_MINOR") - STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR +([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*TBB_VERSION_MINOR +([0-9]+).*" "\\1" TBB_VERSION_MINOR "${TBB_VERSION_MINOR_STRING}" ) - SET(TBB_VERSION + set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" ) - SET(TBB_WITH_ONEAPI FALSE) -ELSE() + set(TBB_WITH_ONEAPI FALSE) +else() # # Check for new oneAPI TBB header layout: # - DEAL_II_FIND_PATH(TBB_INCLUDE_DIR oneapi/tbb/version.h + deal_ii_find_path(TBB_INCLUDE_DIR oneapi/tbb/version.h HINTS ${TBB_DIR} PATH_SUFFIXES include include/tbb tbb ) - IF(EXISTS ${TBB_INCLUDE_DIR}/oneapi/tbb/version.h) - FILE(STRINGS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" TBB_VERSION_MAJOR_STRING + if(EXISTS ${TBB_INCLUDE_DIR}/oneapi/tbb/version.h) + file(STRINGS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" TBB_VERSION_MAJOR_STRING REGEX "#define.*TBB_VERSION_MAJOR") - STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR +([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*TBB_VERSION_MAJOR +([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${TBB_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" TBB_VERSION_MINOR_STRING + file(STRINGS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" TBB_VERSION_MINOR_STRING REGEX "#define.*TBB_VERSION_MINOR") - STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR +([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*TBB_VERSION_MINOR +([0-9]+).*" "\\1" TBB_VERSION_MINOR "${TBB_VERSION_MINOR_STRING}" ) - SET(TBB_VERSION + set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" ) - ENDIF() + endif() - SET(TBB_WITH_ONEAPI TRUE) -ENDIF() + set(TBB_WITH_ONEAPI TRUE) +endif() -DEAL_II_PACKAGE_HANDLE(TBB +deal_ii_package_handle(TBB LIBRARIES REQUIRED ${_libraries} INCLUDE_DIRS REQUIRED TBB_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED TBB_INCLUDE_DIR diff --git a/cmake/modules/FindTRILINOS.cmake b/cmake/modules/FindTRILINOS.cmake index 940ae1d6ba..cdfb4e960f 100644 --- a/cmake/modules/FindTRILINOS.cmake +++ b/cmake/modules/FindTRILINOS.cmake @@ -29,13 +29,13 @@ # TRILINOS_WITH_MPI # -SET(TRILINOS_DIR "" CACHE PATH "An optional hint to a Trilinos installation") -SET_IF_EMPTY(TRILINOS_DIR "$ENV{TRILINOS_DIR}") +set(TRILINOS_DIR "" CACHE PATH "An optional hint to a Trilinos installation") +set_if_empty(TRILINOS_DIR "$ENV{TRILINOS_DIR}") # # Include the trilinos package configuration: # -FIND_PACKAGE(TRILINOS_CONFIG +find_package(TRILINOS_CONFIG CONFIG QUIET NAMES Trilinos TRILINOS HINTS @@ -49,67 +49,67 @@ FIND_PACKAGE(TRILINOS_CONFIG ) -IF(DEFINED Trilinos_VERSION) +if(DEFINED Trilinos_VERSION) # # Extract version numbers: # - SET(TRILINOS_VERSION "${Trilinos_VERSION}") + set(TRILINOS_VERSION "${Trilinos_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^([0-9]+).*$" "\\1" TRILINOS_VERSION_MAJOR "${Trilinos_VERSION}") - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" TRILINOS_VERSION_MINOR "${Trilinos_VERSION}") # If there is no subminor number, # TRILINOS_VERSION_SUBMINOR is set to an empty string. # If that is the case, set the subminor number to zero - STRING(REGEX REPLACE + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.?(([0-9]+)?).*$" "\\1" TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}") - IF("${TRILINOS_VERSION_SUBMINOR}" STREQUAL "") - SET(TRILINOS_VERSION_SUBMINOR "0") - ENDIF() -ENDIF() + if("${TRILINOS_VERSION_SUBMINOR}" STREQUAL "") + set(TRILINOS_VERSION_SUBMINOR "0") + endif() +endif() # # Look for Epetra_config.h - we'll query it to determine MPI and 64bit # indices support: # -DEAL_II_FIND_FILE(EPETRA_CONFIG_H Epetra_config.h +deal_ii_find_file(EPETRA_CONFIG_H Epetra_config.h HINTS ${Trilinos_INCLUDE_DIRS} NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) -IF(EXISTS ${EPETRA_CONFIG_H}) +if(EXISTS ${EPETRA_CONFIG_H}) # # Determine whether Trilinos was configured with MPI and 64bit indices: # - FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_MPI_STRING + file(STRINGS "${EPETRA_CONFIG_H}" EPETRA_MPI_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+HAVE_MPI") - IF("${EPETRA_MPI_STRING}" STREQUAL "") - SET(TRILINOS_WITH_MPI FALSE) - ELSE() - SET(TRILINOS_WITH_MPI TRUE) - ENDIF() - FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING + if("${EPETRA_MPI_STRING}" STREQUAL "") + set(TRILINOS_WITH_MPI FALSE) + else() + set(TRILINOS_WITH_MPI TRUE) + endif() + file(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+EPETRA_NO_32BIT_GLOBAL_INDICES") - IF("${EPETRA_64BIT_STRING}" STREQUAL "") - SET(TRILINOS_WITH_NO_32BITS_INDICES TRUE) - ELSE() - SET(TRILINOS_WITH_NO_32BITS_INDICES FALSE) - ENDIF() - FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING + if("${EPETRA_64BIT_STRING}" STREQUAL "") + set(TRILINOS_WITH_NO_32BITS_INDICES TRUE) + else() + set(TRILINOS_WITH_NO_32BITS_INDICES FALSE) + endif() + file(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING REGEX "^[ \t]*#[ \t]*define[ \t]+EPETRA_NO_64BIT_GLOBAL_INDICES") - IF("${EPETRA_64BIT_STRING}" STREQUAL "") - SET(TRILINOS_WITH_NO_64BITS_INDICES TRUE) - ELSE() - SET(TRILINOS_WITH_NO_64BITS_INDICES FALSE) - ENDIF() -ENDIF() + if("${EPETRA_64BIT_STRING}" STREQUAL "") + set(TRILINOS_WITH_NO_64BITS_INDICES TRUE) + else() + set(TRILINOS_WITH_NO_64BITS_INDICES FALSE) + endif() +endif() # @@ -117,32 +117,32 @@ ENDIF() # # Especially deduplicate stuff... # -REMOVE_DUPLICATES(Trilinos_LIBRARIES REVERSE) -REMOVE_DUPLICATES(Trilinos_TPL_LIBRARIES REVERSE) +remove_duplicates(Trilinos_LIBRARIES REVERSE) +remove_duplicates(Trilinos_TPL_LIBRARIES REVERSE) -REMOVE_DUPLICATES(Trilinos_INCLUDE_DIRS) -STRING(REGEX REPLACE +remove_duplicates(Trilinos_INCLUDE_DIRS) +string(REGEX REPLACE "(lib64|lib)\\/cmake\\/Trilinos\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/" "" Trilinos_INCLUDE_DIRS "${Trilinos_INCLUDE_DIRS}" ) -REMOVE_DUPLICATES(Trilinos_TPL_INCLUDE_DIRS) +remove_duplicates(Trilinos_TPL_INCLUDE_DIRS) -IF(TARGET Kokkos::kokkos) - GET_PROPERTY(KOKKOS_COMPILE_FLAGS_FULL TARGET Kokkos::kokkos PROPERTY INTERFACE_COMPILE_OPTIONS) - STRING(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS_FULL}") - STRING(REPLACE ";" " " KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS}") -ENDIF() +if(TARGET Kokkos::kokkos) + get_property(KOKKOS_COMPILE_FLAGS_FULL TARGET Kokkos::kokkos PROPERTY INTERFACE_COMPILE_OPTIONS) + string(REGEX REPLACE "\\$<\\$:([^>]*)>" "\\1" KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS_FULL}") + string(REPLACE ";" " " KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS}") +endif() # # We'd like to have the full library names but the Trilinos package only # exports a list with short names... # So we check again for every lib and store the full path: # -SET(_libraries "") -FOREACH(_library ${Trilinos_LIBRARIES}) - LIST(APPEND _libraries TRILINOS_LIBRARY_${_library}) - DEAL_II_FIND_LIBRARY(TRILINOS_LIBRARY_${_library} +set(_libraries "") +foreach(_library ${Trilinos_LIBRARIES}) + list(APPEND _libraries TRILINOS_LIBRARY_${_library}) + deal_ii_find_library(TRILINOS_LIBRARY_${_library} NAMES ${_library} HINTS ${Trilinos_LIBRARY_DIRS} NO_DEFAULT_PATH @@ -152,10 +152,10 @@ FOREACH(_library ${Trilinos_LIBRARIES}) NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH ) -ENDFOREACH() +endforeach() -DEAL_II_PACKAGE_HANDLE(TRILINOS +deal_ii_package_handle(TRILINOS LIBRARIES REQUIRED ${_libraries} OPTIONAL Trilinos_TPL_LIBRARIES MPI_CXX_LIBRARIES diff --git a/cmake/modules/FindUMFPACK.cmake b/cmake/modules/FindUMFPACK.cmake index 1b8bf583ae..0bf6af99db 100644 --- a/cmake/modules/FindUMFPACK.cmake +++ b/cmake/modules/FindUMFPACK.cmake @@ -27,22 +27,22 @@ # UMFPACK_VERSION_SUBMINOR # -SET(UMFPACK_DIR "" CACHE PATH "An optional hint to an UMFPACK directory") -SET(SUITESPARSE_DIR "" CACHE PATH +set(UMFPACK_DIR "" CACHE PATH "An optional hint to an UMFPACK directory") +set(SUITESPARSE_DIR "" CACHE PATH "An optional hint to a SUITESPARSE directory" ) -FOREACH(_comp SUITESPARSE SUITESPARSE_CONFIG UMFPACK AMD CHOLMOD COLAMD) - SET_IF_EMPTY(${_comp}_DIR "$ENV{${_comp}_DIR}") -ENDFOREACH() +foreach(_comp SUITESPARSE SUITESPARSE_CONFIG UMFPACK AMD CHOLMOD COLAMD) + set_if_empty(${_comp}_DIR "$ENV{${_comp}_DIR}") +endforeach() # # Two macros to make life easier: # -MACRO(FIND_UMFPACK_PATH _comp _file) - STRING(TOLOWER ${_comp} _comp_lowercase) - STRING(TOUPPER ${_comp} _comp_uppercase) - DEAL_II_FIND_PATH(${_comp}_INCLUDE_DIR ${_file} +macro(FIND_UMFPACK_PATH _comp _file) + string(TOLOWER ${_comp} _comp_lowercase) + string(TOUPPER ${_comp} _comp_uppercase) + deal_ii_find_path(${_comp}_INCLUDE_DIR ${_file} HINTS ${${_comp_uppercase}_DIR} ${SUITESPARSE_DIR}/${_comp} @@ -52,11 +52,11 @@ MACRO(FIND_UMFPACK_PATH _comp _file) PATH_SUFFIXES ${_comp_lowercase} include/${_comp_lowercase} include Include ${_comp}/Include suitesparse ) -ENDMACRO() +endmacro() -MACRO(FIND_UMFPACK_LIBRARY _comp _name) - STRING(TOUPPER ${_comp} _comp_uppercase) - DEAL_II_FIND_LIBRARY(${_comp}_LIBRARY +macro(FIND_UMFPACK_LIBRARY _comp _name) + string(TOUPPER ${_comp} _comp_uppercase) + deal_ii_find_library(${_comp}_LIBRARY NAMES ${_name} lib${_name} HINTS ${${_comp_uppercase}_DIR} @@ -67,7 +67,7 @@ MACRO(FIND_UMFPACK_LIBRARY _comp _name) PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib Lib ${_comp}/Lib ) -ENDMACRO() +endmacro() # @@ -76,36 +76,36 @@ ENDMACRO() FIND_UMFPACK_PATH(UMFPACK umfpack.h) FIND_UMFPACK_PATH(AMD amd.h) -IF(EXISTS ${UMFPACK_INCLUDE_DIR}/umfpack.h) +if(EXISTS ${UMFPACK_INCLUDE_DIR}/umfpack.h) # # Well, recent versions of UMFPACK include SuiteSparse_config.h, if so, # ensure that we'll find these headers as well. # - FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_SUITESPARSE_STRING + file(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_SUITESPARSE_STRING REGEX "#include \"SuiteSparse_config.h\"") - IF(NOT "${UMFPACK_SUITESPARSE_STRING}" STREQUAL "") + if(NOT "${UMFPACK_SUITESPARSE_STRING}" STREQUAL "") FIND_UMFPACK_PATH(SuiteSparse_config SuiteSparse_config.h) - ENDIF() + endif() - FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MAJOR_STRING + file(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MAJOR_STRING REGEX "#define.*UMFPACK_MAIN_VERSION") - STRING(REGEX REPLACE "^.*UMFPACK_MAIN_VERSION.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*UMFPACK_MAIN_VERSION.*([0-9]+).*" "\\1" UMFPACK_VERSION_MAJOR "${UMFPACK_VERSION_MAJOR_STRING}" ) - FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MINOR_STRING + file(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_MINOR_STRING REGEX "#define.*UMFPACK_SUB_VERSION") - STRING(REGEX REPLACE "^.*UMFPACK_SUB_VERSION.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*UMFPACK_SUB_VERSION.*([0-9]+).*" "\\1" UMFPACK_VERSION_MINOR "${UMFPACK_VERSION_MINOR_STRING}" ) - FILE(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_SUBMINOR_STRING + file(STRINGS "${UMFPACK_INCLUDE_DIR}/umfpack.h" UMFPACK_VERSION_SUBMINOR_STRING REGEX "#define.*UMFPACK_SUBSUB_VERSION") - STRING(REGEX REPLACE "^.*UMFPACK_SUBSUB_VERSION.*([0-9]+).*" "\\1" + string(REGEX REPLACE "^.*UMFPACK_SUBSUB_VERSION.*([0-9]+).*" "\\1" UMFPACK_VERSION_SUBMINOR "${UMFPACK_VERSION_SUBMINOR_STRING}" ) - SET(UMFPACK_VERSION + set(UMFPACK_VERSION "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUBMINOR}" ) -ENDIF() +endif() # # Link against everything we can find to avoid underlinkage: @@ -124,9 +124,9 @@ FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig) # lib does not record its dependence on librt.so as evidenced # by ldd :-( ): # -FIND_SYSTEM_LIBRARY(rt_LIBRARY NAMES rt) +find_system_library(rt_LIBRARY NAMES rt) -DEAL_II_PACKAGE_HANDLE(UMFPACK +deal_ii_package_handle(UMFPACK LIBRARIES REQUIRED UMFPACK_LIBRARY OPTIONAL CHOLMOD_LIBRARY CCOLAMD_LIBRARY COLAMD_LIBRARY CAMD_LIBRARY SuiteSparse_config_LIBRARY @@ -146,8 +146,8 @@ DEAL_II_PACKAGE_HANDLE(UMFPACK AMD_INCLUDE_DIR SuiteSparse_config_INCLUDE_DIR ) -IF(UMFPACK_FOUND) - MARK_AS_ADVANCED(SUITESPARSE_DIR) -ELSE() - MARK_AS_ADVANCED(CLEAR SUITESPARSE_DIR) -ENDIF() +if(UMFPACK_FOUND) + mark_as_advanced(SUITESPARSE_DIR) +else() + mark_as_advanced(CLEAR SUITESPARSE_DIR) +endif() diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake index f077287dad..e6654a13a0 100644 --- a/cmake/modules/FindZLIB.cmake +++ b/cmake/modules/FindZLIB.cmake @@ -23,20 +23,20 @@ # ZLIB_VERSION # -SET(ZLIB_DIR "" CACHE PATH "An optional hint to a ZLIB installation") -SET_IF_EMPTY(ZLIB_DIR "$ENV{ZLIB_DIR}") +set(ZLIB_DIR "" CACHE PATH "An optional hint to a ZLIB installation") +set_if_empty(ZLIB_DIR "$ENV{ZLIB_DIR}") -IF(NOT "${ZLIB_DIR}" STREQUAL "") - SET(ZLIB_ROOT ${ZLIB_DIR}) -ENDIF() +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/) +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}) +set(ZLIB_VERSION ${ZLIB_VERSION_STRING}) -DEAL_II_PACKAGE_HANDLE(ZLIB +deal_ii_package_handle(ZLIB LIBRARIES REQUIRED ZLIB_LIBRARY INCLUDE_DIRS REQUIRED ZLIB_INCLUDE_DIR CLEAR ZLIB_INCLUDE_DIR ZLIB_LIBRARY diff --git a/cmake/scripts/CMakeLists.txt b/cmake/scripts/CMakeLists.txt index a85de24258..1b61ef5522 100644 --- a/cmake/scripts/CMakeLists.txt +++ b/cmake/scripts/CMakeLists.txt @@ -13,7 +13,7 @@ ## ## --------------------------------------------------------------------- -ADD_EXECUTABLE(expand_instantiations_exe expand_instantiations.cc) +add_executable(expand_instantiations_exe expand_instantiations.cc) # # We run into a bug when compiling expand_instantiations with @@ -27,9 +27,9 @@ ADD_EXECUTABLE(expand_instantiations_exe expand_instantiations.cc) # linker flag, filtering this one command out of the list of flags # does not harm either. # -STRING(REPLACE "-fuse-ld=gold" "" _expand_instantiations_link_flags "${DEAL_II_LINKER_FLAGS}" ) +string(REPLACE "-fuse-ld=gold" "" _expand_instantiations_link_flags "${DEAL_II_LINKER_FLAGS}" ) -SET_TARGET_PROPERTIES(expand_instantiations_exe PROPERTIES +set_target_properties(expand_instantiations_exe PROPERTIES LINK_FLAGS "${_expand_instantiations_link_flags}" LINKER_LANGUAGE "CXX" COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS}" @@ -38,24 +38,24 @@ SET_TARGET_PROPERTIES(expand_instantiations_exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR} ) -IF (DEAL_II_MSVC) - SET_TARGET_PROPERTIES(expand_instantiations_exe PROPERTIES +if (DEAL_II_MSVC) + set_target_properties(expand_instantiations_exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) -ENDIF() +endif() -SET(_scripts +set(_scripts ${CMAKE_CURRENT_SOURCE_DIR}/normalize.pl ${CMAKE_CURRENT_SOURCE_DIR}/run_test.cmake ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh ${CMAKE_CURRENT_SOURCE_DIR}/get_closest_tag.sh ${CMAKE_CURRENT_SOURCE_DIR}/get_latest_tag.sh ) -FILE(COPY ${_scripts} +file(COPY ${_scripts} DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts ) -INSTALL(FILES ${_scripts} +install(FILES ${_scripts} DESTINATION ${DEAL_II_SHARE_RELDIR}/scripts COMPONENT library ) diff --git a/cmake/scripts/run_test.cmake b/cmake/scripts/run_test.cmake index 517a630f29..b5eefe77fb 100644 --- a/cmake/scripts/run_test.cmake +++ b/cmake/scripts/run_test.cmake @@ -34,25 +34,25 @@ # ${GUARD_FILE} is found, it is deleted. # -IF(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}) +if(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}) # # Guard file still exists, so this script must have been interrupted. # Remove guard file to force a complete rerun: # - EXECUTE_PROCESS(COMMAND rm -f ${GUARD_FILE}) -ELSEIF(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}_bck) + execute_process(COMMAND rm -f ${GUARD_FILE}) +elseif(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}_bck) # # A backed up guard file exists. Put it back in place: # - EXECUTE_PROCESS(COMMAND mv ${GUARD_FILE}_bck ${GUARD_FILE}) -ENDIF() + execute_process(COMMAND mv ${GUARD_FILE}_bck ${GUARD_FILE}) +endif() -IF("${EXPECT}" STREQUAL "") - SET(EXPECT "PASSED") -ENDIF() +if("${EXPECT}" STREQUAL "") + set(EXPECT "PASSED") +endif() -EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} +execute_process(COMMAND ${CMAKE_COMMAND} --build . --target ${TRGT} WORKING_DIRECTORY ${BINARY_DIR} RESULT_VARIABLE _result_code # ignored ;-) @@ -68,80 +68,80 @@ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} # PASSED - the test passed all stages # -STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex "${_output}") -STRING(REGEX MATCH "${TEST}: BUILD failed\\." _build_regex "${_output}") -STRING(REGEX MATCH "${TEST}: RUN failed\\." _run_regex "${_output}") -STRING(REGEX MATCH "${TEST}: DIFF failed\\." _diff_regex "${_output}") -STRING(REGEX MATCH "${TEST}: PASSED\\." _passed_regex "${_output}") - -IF(NOT "${_passed_regex}" STREQUAL "") - SET(_stage PASSED) -ELSEIF(NOT "${_diff_regex}" STREQUAL "") - SET(_stage DIFF) -ELSEIF(NOT "${_run_regex}" STREQUAL "") - SET(_stage RUN) -ELSEIF(NOT "${_configure_regex}" STREQUAL "") - SET(_stage CONFIGURE) -ELSE() # unconditionally, because "BUILD failed." doesn't have to be printed... - SET(_stage BUILD) -ENDIF() +string(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex "${_output}") +string(REGEX MATCH "${TEST}: BUILD failed\\." _build_regex "${_output}") +string(REGEX MATCH "${TEST}: RUN failed\\." _run_regex "${_output}") +string(REGEX MATCH "${TEST}: DIFF failed\\." _diff_regex "${_output}") +string(REGEX MATCH "${TEST}: PASSED\\." _passed_regex "${_output}") + +if(NOT "${_passed_regex}" STREQUAL "") + set(_stage PASSED) +elseif(NOT "${_diff_regex}" STREQUAL "") + set(_stage DIFF) +elseif(NOT "${_run_regex}" STREQUAL "") + set(_stage RUN) +elseif(NOT "${_configure_regex}" STREQUAL "") + set(_stage CONFIGURE) +else() # unconditionally, because "BUILD failed." doesn't have to be printed... + set(_stage BUILD) +endif() # # Print out the test result: # -MESSAGE("Test ${TEST}: ${_stage}") +message("Test ${TEST}: ${_stage}") -MESSAGE("=============================== OUTPUT BEGIN ===============================") +message("=============================== OUTPUT BEGIN ===============================") -IF("${_stage}" STREQUAL "PASSED") - STRING(REGEX REPLACE ".*\\/" "" _test ${TEST}) +if("${_stage}" STREQUAL "PASSED") + string(REGEX REPLACE ".*\\/" "" _test ${TEST}) # # MPI tests have a special runtime directory so rename: # test.mpirun=X.BUILD -> test.BUILD/mpirun=X # - STRING(REGEX REPLACE "\\.(mpirun=[0-9]+)(\\..*)" "\\2/\\1" _test ${_test}) + string(REGEX REPLACE "\\.(mpirun=[0-9]+)(\\..*)" "\\2/\\1" _test ${_test}) # # Also output the diff file if we guessed the location correctly. This is # solely for cosmetic reasons: The diff file is either empty (if # comparison against the main comparison file was successful) or contains # a string explaining which comparison file variant succeeded. # - SET(_diff "") - IF(EXISTS ${BINARY_DIR}/${_test}/diff) - FILE(READ ${BINARY_DIR}/${_test}/diff _diff) - ENDIF() - MESSAGE("${_diff}${TEST}: PASSED.") + set(_diff "") + if(EXISTS ${BINARY_DIR}/${_test}/diff) + file(READ ${BINARY_DIR}/${_test}/diff _diff) + endif() + message("${_diff}${TEST}: PASSED.") -ELSE() +else() - IF( "${_stage}" STREQUAL "BUILD" AND "${_build_regex}" STREQUAL "" ) + if( "${_stage}" STREQUAL "BUILD" AND "${_build_regex}" STREQUAL "" ) # Some special output in case the BUILD stage failed in a regression test: - MESSAGE("${TEST}: BUILD failed. Output:") - ENDIF() - MESSAGE("${_output}") - MESSAGE("") - MESSAGE("${TEST}: ****** ${_stage} failed *******") - MESSAGE("") -ENDIF() + message("${TEST}: BUILD failed. Output:") + endif() + message("${_output}") + message("") + message("${TEST}: ****** ${_stage} failed *******") + message("") +endif() -MESSAGE("=============================== OUTPUT END ===============================") +message("=============================== OUTPUT END ===============================") # # Back up guard file: # -IF(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}) - EXECUTE_PROCESS(COMMAND mv ${GUARD_FILE} ${GUARD_FILE}_bck) -ENDIF() +if(NOT "${GUARD_FILE}" STREQUAL "" AND EXISTS ${GUARD_FILE}) + execute_process(COMMAND mv ${GUARD_FILE} ${GUARD_FILE}_bck) +endif() # # Bail out: # -IF(NOT "${_stage}" STREQUAL "${EXPECT}") - MESSAGE("Expected stage ${EXPECT} - aborting") - MESSAGE(FATAL_ERROR "*** abort") -ELSEIF(NOT "${_stage}" STREQUAL "PASSED") - MESSAGE("Expected stage ${EXPECT} - test considered successful.") -ENDIF() +if(NOT "${_stage}" STREQUAL "${EXPECT}") + message("Expected stage ${EXPECT} - aborting") + message(FATAL_ERROR "*** abort") +elseif(NOT "${_stage}" STREQUAL "PASSED") + message("Expected stage ${EXPECT} - test considered successful.") +endif() diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index 279a13ff76..861cd228a7 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -14,7 +14,7 @@ ## --------------------------------------------------------------------- # -# Set up cached variables (prior to the PROJECT(deal.II) call) +# Set up cached variables (prior to the project(deal.II) call) # # This file sets up the following cached Options: # @@ -67,46 +67,46 @@ # # ######################################################################## -If(DEAL_II_HAVE_BUNDLED_DIRECTORY) - OPTION(DEAL_II_ALLOW_BUNDLED +if(DEAL_II_HAVE_BUNDLED_DIRECTORY) + option(DEAL_II_ALLOW_BUNDLED "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)" ON ) -ENDIF() +endif() -If(DEAL_II_HAVE_DOC_DIRECTORY) - OPTION(DEAL_II_COMPONENT_DOCUMENTATION +if(DEAL_II_HAVE_DOC_DIRECTORY) + option(DEAL_II_COMPONENT_DOCUMENTATION "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system." OFF ) - LIST(APPEND DEAL_II_COMPONENTS DOCUMENTATION) + list(APPEND DEAL_II_COMPONENTS DOCUMENTATION) -ENDIF() +endif() -OPTION(DEAL_II_COMPONENT_EXAMPLES +option(DEAL_II_COMPONENT_EXAMPLES "Enable configuration and installation of the example steps. This adds a COMPONENT \"examples\" to the build system." ON ) -LIST(APPEND DEAL_II_COMPONENTS EXAMPLES) +list(APPEND DEAL_II_COMPONENTS EXAMPLES) -OPTION(DEAL_II_COMPONENT_PACKAGE +option(DEAL_II_COMPONENT_PACKAGE "Generates additional targets for packaging deal.II" OFF ) -LIST(APPEND DEAL_II_COMPONENTS PACKAGE) +list(APPEND DEAL_II_COMPONENTS PACKAGE) -OPTION(DEAL_II_COMPONENT_PYTHON_BINDINGS +option(DEAL_II_COMPONENT_PYTHON_BINDINGS "Enable configuration and installation of the python bindings. This adds a COMPONENT \"PYTHON_BINDINGS\" to the build system." OFF ) -LIST(APPEND DEAL_II_COMPONENTS PYTHON_BINDINGS) +list(APPEND DEAL_II_COMPONENTS PYTHON_BINDINGS) -OPTION(DEAL_II_ALLOW_AUTODETECTION +option(DEAL_II_ALLOW_AUTODETECTION "Allow to automatically set up features by setting all undefined DEAL_II_WITH_* variables to ON or OFF" ON ) -OPTION(DEAL_II_FORCE_AUTODETECTION +option(DEAL_II_FORCE_AUTODETECTION "Force feature autodetection by undefining all DEAL_II_WITH_* variables prior to configure" OFF ) @@ -122,7 +122,7 @@ OPTION(DEAL_II_FORCE_AUTODETECTION # Setup CMAKE_BUILD_TYPE: # -SET(CMAKE_BUILD_TYPE +set(CMAKE_BUILD_TYPE "DebugRelease" CACHE STRING "Choose the type of build, options are: Debug, Release and DebugRelease." @@ -130,77 +130,77 @@ SET(CMAKE_BUILD_TYPE # This is cruel, I know. But it is better to only have a known number of # options for CMAKE_BUILD_TYPE... -IF( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND +if( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease" ) - MESSAGE(FATAL_ERROR + message(FATAL_ERROR "CMAKE_BUILD_TYPE does neither match Release, Debug, nor DebugRelease!" ) -ENDIF() +endif() # # Configuration behaviour: # -OPTION(DEAL_II_ALLOW_PLATFORM_INTROSPECTION +option(DEAL_II_ALLOW_PLATFORM_INTROSPECTION "Allow platform introspection for CPU command sets, SSE and AVX" ON ) -MARK_AS_ADVANCED(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) +mark_as_advanced(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) -OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS +option(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target." ON ) -MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) +mark_as_advanced(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) -OPTION(DEAL_II_SETUP_COVERAGE +option(DEAL_II_SETUP_COVERAGE "Setup debug compiler flags to provide additional test coverage information. Currently only gprof is supported." OFF ) -MARK_AS_ADVANCED(DEAL_II_SETUP_COVERAGE) +mark_as_advanced(DEAL_II_SETUP_COVERAGE) -OPTION(DEAL_II_UNITY_BUILD +option(DEAL_II_UNITY_BUILD "Compile the library by concatenating together source files to form a few large targets instead of many small ones. This lowers total compilation wall time by about 25%." OFF) -MARK_AS_ADVANCED(DEAL_II_UNITY_BUILD) +mark_as_advanced(DEAL_II_UNITY_BUILD) -OPTION(DEAL_II_EARLY_DEPRECATIONS +option(DEAL_II_EARLY_DEPRECATIONS "Enable deprecation warnings for features deprecated since the last release." OFF) -MARK_AS_ADVANCED(DEAL_II_EARLY_DEPRECATIONS) +mark_as_advanced(DEAL_II_EARLY_DEPRECATIONS) -SET(BUILD_SHARED_LIBS "ON" CACHE BOOL +set(BUILD_SHARED_LIBS "ON" CACHE BOOL "Build a shared library" ) -OPTION(DEAL_II_PREFER_STATIC_LIBS +option(DEAL_II_PREFER_STATIC_LIBS "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface" OFF ) -MARK_AS_ADVANCED(DEAL_II_PREFER_STATIC_LIBS) +mark_as_advanced(DEAL_II_PREFER_STATIC_LIBS) -OPTION(DEAL_II_STATIC_EXECUTABLE +option(DEAL_II_STATIC_EXECUTABLE "Provide a link interface that is suitable for static linkage of executables. Enabling this option forces BUILD_SHARED_LIBS=OFF and DEAL_II_PREFER_STATIC_LIBS=ON" OFF ) -MARK_AS_ADVANCED(DEAL_II_STATIC_EXECUTABLE) +mark_as_advanced(DEAL_II_STATIC_EXECUTABLE) -IF(DEAL_II_STATIC_EXECUTABLE) - SET(BUILD_SHARED_LIBS "OFF" CACHE BOOL +if(DEAL_II_STATIC_EXECUTABLE) + set(BUILD_SHARED_LIBS "OFF" CACHE BOOL "Build a shared library" FORCE ) - SET(DEAL_II_PREFER_STATIC_LIBS "ON" CACHE BOOL + set(DEAL_II_PREFER_STATIC_LIBS "ON" CACHE BOOL "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface" FORCE ) -ENDIF() +endif() -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL "Set the rpath of the library to the external link paths on installation" ) -MARK_AS_ADVANCED(CMAKE_INSTALL_RPATH_USE_LINK_PATH) +mark_as_advanced(CMAKE_INSTALL_RPATH_USE_LINK_PATH) ######################################################################## @@ -213,7 +213,7 @@ MARK_AS_ADVANCED(CMAKE_INSTALL_RPATH_USE_LINK_PATH) # Hide all unused CMake variables: # -SET(DEAL_II_REMOVED_FLAGS +set(DEAL_II_REMOVED_FLAGS CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG @@ -235,21 +235,21 @@ SET(DEAL_II_REMOVED_FLAGS CMAKE_SHARED_LINKER_FLAGS_RELEASE CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO ) -FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) +foreach(_flag ${DEAL_II_REMOVED_FLAGS}) # # Promote all variables to internal cache. This prevents CMake from # populating these variables with default values. Further, store the # actual content of the variables such that users can still use # CMAKE_CXX_FLAGS(|_RELEASE|_DEBUG). # - SET(${_flag} ${${_flag}} CACHE INTERNAL "" FORCE) -ENDFOREACH() + set(${_flag} ${${_flag}} CACHE INTERNAL "" FORCE) +endforeach() # # Promote our configuration variables to cache: # -SET(DEAL_II_USED_FLAGS +set(DEAL_II_USED_FLAGS DEAL_II_CXX_FLAGS DEAL_II_CXX_FLAGS_DEBUG DEAL_II_CXX_FLAGS_RELEASE @@ -257,47 +257,47 @@ SET(DEAL_II_USED_FLAGS DEAL_II_LINKER_FLAGS_DEBUG DEAL_II_LINKER_FLAGS_RELEASE ) -FOREACH(_flag ${DEAL_II_USED_FLAGS}) - SET(${_flag} "${${_flag}}" CACHE STRING +foreach(_flag ${DEAL_II_USED_FLAGS}) + set(${_flag} "${${_flag}}" CACHE STRING "The user supplied cache variable will be appended _at the end_ of the configuration step to the auto generated ${_flag} variable" ) - MARK_AS_ADVANCED(${_flag}) -ENDFOREACH() + mark_as_advanced(${_flag}) +endforeach() -FOREACH(_variable +foreach(_variable DEAL_II_DEFINITIONS DEAL_II_DEFINITIONS_DEBUG DEAL_II_DEFINITIONS_RELEASE ) - SET(${_variable} ${${_variable}} CACHE STRING + set(${_variable} ${${_variable}} CACHE STRING "Additional, user supplied compile definitions" ) - MARK_AS_ADVANCED(${_variable}) -ENDFOREACH() + mark_as_advanced(${_variable}) +endforeach() # # Translate CMake specific variables to deal.II naming: # -FOREACH(_flag +foreach(_flag CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG ) - IF(NOT "${CMAKE_${_flag}}" STREQUAL "") - MESSAGE(STATUS + if(NOT "${CMAKE_${_flag}}" STREQUAL "") + message(STATUS "Prepending \${CMAKE_${_flag}} to \${DEAL_II_${_flag}}" ) - SET(DEAL_II_${_flag} "${CMAKE_${_flag}} ${DEAL_II_${_flag}}") - ENDIF() -ENDFOREACH() + set(DEAL_II_${_flag} "${CMAKE_${_flag}} ${DEAL_II_${_flag}}") + endif() +endforeach() -FOREACH(_flag LINKER_FLAGS LINKER_FLAGS_DEBUG LINKER_FLAGS_RELEASE) - IF(NOT "${CMAKE_SHARED_${_flag}}" STREQUAL "") - MESSAGE(STATUS +foreach(_flag LINKER_FLAGS LINKER_FLAGS_DEBUG LINKER_FLAGS_RELEASE) + if(NOT "${CMAKE_SHARED_${_flag}}" STREQUAL "") + message(STATUS "Prepending \${CMAKE_SHARED_${_flag}} to \${DEAL_II_${_flag}}" ) - SET(DEAL_II_${_flag} "${CMAKE_${_flag}} ${DEAL_II_${_flag}}") - ENDIF() -ENDFOREACH() + set(DEAL_II_${_flag} "${CMAKE_${_flag}} ${DEAL_II_${_flag}}") + endif() +endforeach() @@ -306,7 +306,7 @@ ENDFOREACH() # variables. # -FOREACH(_flag ${DEAL_II_USED_FLAGS}) +foreach(_flag ${DEAL_II_USED_FLAGS}) # # The order of compiler and linker flags is important. In order to # provide an override mechanism we have to save the initial (cached) @@ -315,18 +315,18 @@ FOREACH(_flag ${DEAL_II_USED_FLAGS}) # setup_finalize.cmake (called at the end of the main CMakeLists.txt # file). # - SET(${_flag}_SAVED ${${_flag}}) - SET(${_flag} "") -ENDFOREACH() + set(${_flag}_SAVED ${${_flag}}) + set(${_flag} "") +endforeach() # # Also set all unused CMAKE_* flags to an empty string for the # configuration run so that it does not confuse the build system (to unset # is not an option - it is cached...) # -FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) - SET(${_flag} "") -ENDFOREACH() +foreach(_flag ${DEAL_II_REMOVED_FLAGS}) + set(${_flag} "") +endforeach() # # Finally, read in CXXFLAGS, LDFLAGS and NVCCFLAGS from environment and @@ -336,13 +336,13 @@ ENDFOREACH() # old cmake versions happy # -SET(DEAL_II_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${DEAL_II_CXX_FLAGS_SAVED}") -STRING(STRIP "${DEAL_II_CXX_FLAGS_SAVED}" DEAL_II_CXX_FLAGS_SAVED) -SET(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}") -STRING(STRIP "${DEAL_II_LINKER_FLAGS_SAVED}" DEAL_II_LINKER_FLAGS_SAVED) -UNSET(ENV{CXXFLAGS}) -UNSET(ENV{LDFLAGS}) -UNSET(ENV{NVCCFLAGS}) +set(DEAL_II_CXX_FLAGS_SAVED "$ENV{CXXFLAGS} ${DEAL_II_CXX_FLAGS_SAVED}") +string(STRIP "${DEAL_II_CXX_FLAGS_SAVED}" DEAL_II_CXX_FLAGS_SAVED) +set(DEAL_II_LINKER_FLAGS_SAVED "$ENV{LDFLAGS} ${DEAL_II_LINKER_FLAGS_SAVED}") +string(STRIP "${DEAL_II_LINKER_FLAGS_SAVED}" DEAL_II_LINKER_FLAGS_SAVED) +unset(ENV{CXXFLAGS}) +unset(ENV{LDFLAGS}) +unset(ENV{NVCCFLAGS}) ######################################################################## @@ -351,45 +351,45 @@ UNSET(ENV{NVCCFLAGS}) # # ######################################################################## -OPTION(DEAL_II_WITH_64BIT_INDICES +option(DEAL_II_WITH_64BIT_INDICES "If set to ON, then use 64-bit data types to represent global degree of freedom indices. The default is to OFF. You only want to set this to ON if you will solve problems with more than 2^31 (approximately 2 billion) unknowns. If set to ON, you also need to ensure that both Trilinos and/or PETSc support 64-bit indices." OFF ) -LIST(APPEND DEAL_II_FEATURES 64BIT_INDICES) +list(APPEND DEAL_II_FEATURES 64BIT_INDICES) -OPTION(DEAL_II_WITH_COMPLEX_VALUES +option(DEAL_II_WITH_COMPLEX_VALUES "If set to OFF, the classes that take a number type are not explicitly instantiated for std::complex and std::complex. This effectively disables the support for computing with complex values. If PETSc is built with complex scalar type, this option must be ON." ON ) -LIST(APPEND DEAL_II_FEATURES COMPLEX_VALUES) +list(APPEND DEAL_II_FEATURES COMPLEX_VALUES) -OPTION(DEAL_II_DOXYGEN_USE_MATHJAX +option(DEAL_II_DOXYGEN_USE_MATHJAX "If set to ON, doxygen documentation is generated using mathjax" OFF ) -MARK_AS_ADVANCED(DEAL_II_DOXYGEN_USE_MATHJAX) +mark_as_advanced(DEAL_II_DOXYGEN_USE_MATHJAX) -OPTION(DEAL_II_COMPILE_EXAMPLES +option(DEAL_II_COMPILE_EXAMPLES "If set to ON, all configurable example executables will be built and installed as well. If set to OFF, the examples component only installs the source code of example steps." ON ) -MARK_AS_ADVANCED(DEAL_II_COMPILE_EXAMPLES) +mark_as_advanced(DEAL_II_COMPILE_EXAMPLES) -OPTION(DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX +option(DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX "If set to ON, doxygen documentation is generated using online (from CDN) mathjax copy" ON ) -MARK_AS_ADVANCED(DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX) +mark_as_advanced(DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX) -SET(DEAL_II_CPACK_EXTERNAL_LIBS "opt" CACHE STRING +set(DEAL_II_CPACK_EXTERNAL_LIBS "opt" CACHE STRING "A relative path to tree of external libraries that will be installed in bundle package. The path is relative to the /Applications/${DEAL_II_CPACK_BUNDLE_NAME}.app/Contents/Resources directory. It defaults to opt, but you may want to use a different value, for example if you want to distribute a brew based package." ) -MARK_AS_ADVANCED(DEAL_II_CPACK_EXTERNAL_LIBS) +mark_as_advanced(DEAL_II_CPACK_EXTERNAL_LIBS) -SET(DEAL_II_CPACK_BUNDLE_NAME "${DEAL_II_PACKAGE_NAME}" CACHE STRING +set(DEAL_II_CPACK_BUNDLE_NAME "${DEAL_II_PACKAGE_NAME}" CACHE STRING "Name of the application bundle to generate." ) -MARK_AS_ADVANCED(DEAL_II_CPACK_BUNDLE_NAME) +mark_as_advanced(DEAL_II_CPACK_BUNDLE_NAME) ######################################################################## @@ -403,8 +403,8 @@ MARK_AS_ADVANCED(DEAL_II_CPACK_BUNDLE_NAME) # much pain, not enough profit"): # -IF("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}") - MESSAGE(FATAL_ERROR " +if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}") + message(FATAL_ERROR " Error CMAKE_INSTALL_PREFIX is equal to CMAKE_BINARY_DIR. It is not possible to install into the build directory. Please set CMAKE_INSTALL_PREFIX to a designated install directory different than @@ -413,39 +413,39 @@ CMAKE_BINARY_DIR. without the need to install it, if this is what you tried to do.) " ) -ENDIF() +endif() # # Miscellaneous renaming: # -GET_CMAKE_PROPERTY(_res VARIABLES) -FOREACH(_var ${_res}) +get_cmake_property(_res VARIABLES) +foreach(_var ${_res}) # # Rename (ALLOW|WITH|FORCE|COMPONENT)_* by DEAL_II_(ALLOW|WITH|FORCE|COMPONENT)_* # - FOREACH(_match ALLOW_ WITH_ FORCE_ COMPONENT_) - IF(_var MATCHES "^${_match}") - SET(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE) - UNSET(${_var} CACHE) - ENDIF() - ENDFOREACH() + foreach(_match ALLOW_ WITH_ FORCE_ COMPONENT_) + if(_var MATCHES "^${_match}") + set(DEAL_II_${_var} ${${_var}} CACHE BOOL "" FORCE) + unset(${_var} CACHE) + endif() + endforeach() # # Same for components: # - IF(_var MATCHES "^(DOCUMENTATION|EXAMPLES|PACKAGE|PYTHON_BINDINGS)") - SET(DEAL_II_COMPONENT_${_var} ${${_var}} CACHE BOOL "" FORCE) - UNSET(${_var} CACHE) - ENDIF() + if(_var MATCHES "^(DOCUMENTATION|EXAMPLES|PACKAGE|PYTHON_BINDINGS)") + set(DEAL_II_COMPONENT_${_var} ${${_var}} CACHE BOOL "" FORCE) + unset(${_var} CACHE) + endif() # # If DEAL_II_FORCE_AUTODETECTION is set undefine all feature toggles # DEAL_II_WITH_* prior to configure: # - IF(DEAL_II_FORCE_AUTODETECTION AND _var MATCHES "^DEAL_II_WITH_" + if(DEAL_II_FORCE_AUTODETECTION AND _var MATCHES "^DEAL_II_WITH_" # Exclude FEATURES that do not represent external libraries: AND NOT _var MATCHES "^DEAL_II_WITH_64BIT_INDICES" ) - UNSET(${_var} CACHE) - ENDIF() -ENDFOREACH() + unset(${_var} CACHE) + endif() +endforeach() diff --git a/cmake/setup_compiler_flags.cmake b/cmake/setup_compiler_flags.cmake index 618d5728e9..e63341247f 100644 --- a/cmake/setup_compiler_flags.cmake +++ b/cmake/setup_compiler_flags.cmake @@ -42,8 +42,8 @@ # All modifications shall be guarded with the ENABLE_IF_SUPPORTED # or ENABLE_IF_LINKS macro, e.g. # -# ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-fpic") -# ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--as-needed") +# enable_if_supported(DEAL_II_CXX_FLAGS "-fpic") +# enable_if_links(DEAL_II_LINKER_FLAGS "-Wl,--as-needed") # # Checks for compiler features (such as C++14 support) and compiler # specific bugs that @@ -71,16 +71,16 @@ # Check the user provided CXX flags: # -FOREACH(build ${DEAL_II_BUILD_TYPES}) - CHECK_COMPILER_SETUP( +foreach(build ${DEAL_II_BUILD_TYPES}) + check_compiler_setup( "${DEAL_II_CXX_FLAGS_SAVED} ${DEAL_II_CXX_FLAGS_${build}_SAVED}" "${DEAL_II_LINKER_FLAGS_SAVED} ${DEAL_II_LINKER_FLAGS_${build}_SAVED}" DEAL_II_HAVE_USABLE_USER_FLAGS_${build} ${DEAL_II_LIBRARIES} ${DEAL_II_LIBRARIES_${build}} ) - IF(NOT DEAL_II_HAVE_USABLE_USER_FLAGS_${build}) - MESSAGE(FATAL_ERROR " + if(NOT DEAL_II_HAVE_USABLE_USER_FLAGS_${build}) + message(FATAL_ERROR " Configuration error: Cannot compile with the user supplied flags: CXX flags (${build}): ${DEAL_II_CXX_FLAGS_SAVED} ${DEAL_II_CXX_FLAGS_${build}_SAVED} LD flags (${build}): ${DEAL_II_LINKER_FLAGS_SAVED} ${DEAL_II_LINKER_FLAGS_${build}_SAVED} @@ -90,8 +90,8 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) DEAL_II_LINKER_FLAGS, DEAL_II_CXX_FLAGS_${build} and the environment variables CXXFLAGS, LDFLAGS.\n\n" ) - ENDIF() -ENDFOREACH() + endif() +endforeach() ######################################################################## @@ -100,7 +100,7 @@ ENDFOREACH() # # ######################################################################## -IF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) +if(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) # # *Hooray* We are allowed to set compiler flags :-] # @@ -108,40 +108,40 @@ IF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) # # General setup for GCC and compilers sufficiently close to GCC: # - IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR + if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) - VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_gnu.cmake) - SET(DEAL_II_KNOWN_COMPILER TRUE) - ENDIF() + verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_gnu.cmake) + set(DEAL_II_KNOWN_COMPILER TRUE) + endif() # # Setup for ICC compiler (version >= 10): # - IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_intel.cmake) - SET(DEAL_II_KNOWN_COMPILER TRUE) - ENDIF() + if(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_intel.cmake) + set(DEAL_II_KNOWN_COMPILER TRUE) + endif() # # Setup for MSVC compiler (version >= 2012): # - IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - VERBOSE_INCLUDE(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_msvc.cmake) - SET(DEAL_II_KNOWN_COMPILER TRUE) - ENDIF() + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + verbose_include(${CMAKE_SOURCE_DIR}/cmake/setup_compiler_flags_msvc.cmake) + set(DEAL_II_KNOWN_COMPILER TRUE) + endif() - IF(NOT DEAL_II_KNOWN_COMPILER) - MESSAGE(FATAL_ERROR "\n" + if(NOT DEAL_II_KNOWN_COMPILER) + message(FATAL_ERROR "\n" "Unknown compiler!\n" "If you're serious about it, set DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF " "and set the relevant compiler options by hand.\n\n" ) - ENDIF() + endif() -ELSE(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) +else(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) - MESSAGE(STATUS + message(STATUS "Skipped setup of default compiler flags " "(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF)" ) -ENDIF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) +endif(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) diff --git a/cmake/setup_compiler_flags_gnu.cmake b/cmake/setup_compiler_flags_gnu.cmake index 2a2315bac5..2d069ac1e4 100644 --- a/cmake/setup_compiler_flags_gnu.cmake +++ b/cmake/setup_compiler_flags_gnu.cmake @@ -20,33 +20,33 @@ # editing this file. # -IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND +if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0" ) - MESSAGE(FATAL_ERROR "\n" + message(FATAL_ERROR "\n" "deal.II requires support for features of C++14 that are not present in\n" "versions of GCC prior to 5.0." ) -ENDIF() +endif() -IF( CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND +if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0" ) - MESSAGE(FATAL_ERROR "\n" + message(FATAL_ERROR "\n" "deal.II requires support for features of C++14 that are not present in\n" "versions of Clang prior to 4.0." ) -ENDIF() +endif() # Correspondence between AppleClang version and upstream Clang version: # https://en.wikipedia.org/wiki/Xcode#Xcode_7.0_-_11.x_(since_Free_On-Device_Development) -IF (POLICY CMP0025) - IF( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" AND +if (POLICY CMP0025) + if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0" ) - MESSAGE(FATAL_ERROR "\n" + message(FATAL_ERROR "\n" "deal.II requires support for features of C++14 that are not present in\n" "versions of AppleClang prior to 9.0." ) - ENDIF() -ENDIF() + endif() +endif() ######################## @@ -58,79 +58,79 @@ ENDIF() # # Set -pedantic if the compiler supports it. # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-pedantic") +enable_if_supported(DEAL_II_CXX_FLAGS "-pedantic") # # Set the pic flag. # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-fPIC") +enable_if_supported(DEAL_II_CXX_FLAGS "-fPIC") # # Setup various warnings: # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wall") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wextra") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wmissing-braces") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Woverloaded-virtual") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wpointer-arith") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsign-compare") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsuggest-override") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wswitch") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wsynth") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wwrite-strings") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wall") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wextra") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wmissing-braces") +enable_if_supported(DEAL_II_CXX_FLAGS "-Woverloaded-virtual") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wpointer-arith") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wsign-compare") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wsuggest-override") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wswitch") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wsynth") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wwrite-strings") # # Disable Wplacement-new that will trigger a lot of warnings # in the BOOST function classes that we include via the # BOOST signals classes: # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-placement-new") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-placement-new") # # Disable deprecation warnings # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") # # Disable warning generated by Debian version of openmpi # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-literal-suffix") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-literal-suffix") # # Disable warning about ABI changes # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-psabi") +enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-psabi") # # Disable warnings regarding improper direct memory access # if compiling without C++17 support # -IF(NOT DEAL_II_HAVE_CXX17) - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-class-memaccess") -ENDIF() +if(NOT DEAL_II_HAVE_CXX17) + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-class-memaccess") +endif() -IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Enable warnings for conversion from real types to integer types. # The warning is too noisy in gcc and therefore only enabled for clang. - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wfloat-conversion") + enable_if_supported(DEAL_II_CXX_FLAGS "-Wfloat-conversion") # # Silence Clang warnings about unused compiler parameters (works around a # regression in the clang driver frontend of certain versions): # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Qunused-arguments") + enable_if_supported(DEAL_II_CXX_FLAGS "-Qunused-arguments") # # Clang verbosely warns about not supporting all our friend declarations # (and consequently removing access control altogether) # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unsupported-friend") + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-unsupported-friend") # # Disable a diagnostic that warns about potentially uninstantiated static # members. This leads to a ton of false positives. # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-undefined-var-template") + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-undefined-var-template") # # Clang versions prior to 3.6 emit a lot of false positives wrt @@ -140,18 +140,18 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # which admits a more fine-grained control. Otherwise, we are left # with just disabling this feature for all versions between 4.0 and 6.3. # - IF (POLICY CMP0025) - IF( (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + if (POLICY CMP0025) + if( (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.6") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.3")) - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-function") - ENDIF() - ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.6" OR + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-unused-function") + endif() + elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.6" OR ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.3") ) - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-unused-function") - ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-unused-function") + endif() # # Clang-14.0.5 complaines loudly about not being able to vectorize some @@ -164,18 +164,18 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # # Let us simply disable the warning for now. # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-pass-failed") -ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS "-Wno-pass-failed") +endif() -IF(DEAL_II_STATIC_EXECUTABLE) +if(DEAL_II_STATIC_EXECUTABLE) # # To produce a static executable, we have to statically link libstdc++ # and gcc's support libraries and glibc: # - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static") - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-pthread") -ENDIF() + enable_if_supported(DEAL_II_LINKER_FLAGS "-static") + enable_if_supported(DEAL_II_LINKER_FLAGS "-pthread") +endif() ############################# @@ -184,29 +184,29 @@ ENDIF() # # ############################# -IF (CMAKE_BUILD_TYPE MATCHES "Release") +if (CMAKE_BUILD_TYPE MATCHES "Release") # # General optimization flags: # - ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2") + add_flags(DEAL_II_CXX_FLAGS_RELEASE "-O2") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-all-loops") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-fstrict-aliasing") + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops") + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-funroll-all-loops") + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-fstrict-aliasing") # # Disable assert() in deal.II and user projects in release mode # - LIST(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG") - LIST(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG") + list(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG") + list(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG") # # There are many places in the library where we create a new typedef and then # immediately use it in an Assert. Hence, only ignore unused typedefs in Release # mode. # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-Wno-unused-local-typedefs") -ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-Wno-unused-local-typedefs") +endif() ########################### @@ -215,42 +215,42 @@ ENDIF() # # ########################### -IF (CMAKE_BUILD_TYPE MATCHES "Debug") +if (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") + list(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") + list(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") # # In recent versions, gcc often eliminates too much debug information # using '-Og' to be useful. # - IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Og") - ENDIF() + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU") + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-Og") + endif() # # If -Og is not available, fall back to -O0: # - IF(NOT DEAL_II_HAVE_FLAG_Og) - ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0") - ENDIF() + if(NOT DEAL_II_HAVE_FLAG_Og) + add_flags(DEAL_II_CXX_FLAGS_DEBUG "-O0") + endif() - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ggdb") - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-ggdb") + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-ggdb") + enable_if_supported(DEAL_II_LINKER_FLAGS_DEBUG "-ggdb") # # If -ggdb is not available, fall back to -g: # - IF(NOT DEAL_II_HAVE_FLAG_ggdb) - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-g") - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_DEBUG "-g") - ENDIF() + if(NOT DEAL_II_HAVE_FLAG_ggdb) + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-g") + enable_if_supported(DEAL_II_LINKER_FLAGS_DEBUG "-g") + endif() - IF(DEAL_II_SETUP_COVERAGE) + if(DEAL_II_SETUP_COVERAGE) # # Enable test coverage # - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-fno-elide-constructors") - ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs") - ADD_FLAGS(DEAL_II_LINKER_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs") - ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-fno-elide-constructors") + add_flags(DEAL_II_CXX_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs") + add_flags(DEAL_II_LINKER_FLAGS_DEBUG "-ftest-coverage -fprofile-arcs") + endif() -ENDIF() +endif() diff --git a/cmake/setup_compiler_flags_intel.cmake b/cmake/setup_compiler_flags_intel.cmake index 36ad8870ce..146b87d99c 100644 --- a/cmake/setup_compiler_flags_intel.cmake +++ b/cmake/setup_compiler_flags_intel.cmake @@ -20,12 +20,12 @@ # editing this file. # -IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0" ) - MESSAGE(WARNING "\n" +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0" ) + message(WARNING "\n" "You're using an old version of the Intel C++ Compiler (icc/icpc)!\n" "It is strongly recommended to use at least version 15.\n" ) -ENDIF() +endif() ######################## @@ -37,17 +37,17 @@ ENDIF() # # Set the pic flag. # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-fpic") +enable_if_supported(DEAL_II_CXX_FLAGS "-fpic") # # Enable verbose warnings: # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-w2") +enable_if_supported(DEAL_II_CXX_FLAGS "-w2") # # Disable remarks like "Inlining inhibited by limit max-size" # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-diag-disable=remark") +enable_if_supported(DEAL_II_CXX_FLAGS "-diag-disable=remark") # # Disable some warnings that lead to a lot of false positives: @@ -101,27 +101,27 @@ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-diag-disable=remark") # -w15531 A portion of SIMD loop is serialized # -w15552 loop was not vectorized with "simd" # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd21") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd68") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd135") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd175") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd177") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd191") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd193") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd279") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd327") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd383") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd854") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd981") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1418") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1478") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1572") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2259") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2536") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2651") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd3415") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd15531") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd15552") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd21") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd68") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd135") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd175") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd177") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd191") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd193") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd279") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd327") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd383") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd854") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd981") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd1418") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd1478") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd1572") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd2259") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd2536") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd2651") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd3415") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd15531") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd15552") # @@ -140,28 +140,28 @@ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd15552") # -w280 selector expression is constant # When writing 'switch(dim)' # -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd111") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd128") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd185") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd186") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd280") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd111") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd128") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd185") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd186") +enable_if_supported(DEAL_II_CXX_FLAGS "-wd280") -IF(DEAL_II_STATIC_EXECUTABLE) +if(DEAL_II_STATIC_EXECUTABLE) # # To produce a static executable, we have to statically link intel's # support libraries: # - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static") - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static-intel") - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-static-gcc") - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-pthread") -ELSE() + enable_if_supported(DEAL_II_LINKER_FLAGS "-static") + enable_if_supported(DEAL_II_LINKER_FLAGS "-static-intel") + enable_if_supported(DEAL_II_LINKER_FLAGS "-static-gcc") + enable_if_supported(DEAL_II_LINKER_FLAGS "-pthread") +else() # # Explicitly link intel support libraries dynamically: # - ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS "-shared-intel") -ENDIF() + enable_if_supported(DEAL_II_LINKER_FLAGS "-shared-intel") +endif() ############################# @@ -170,26 +170,26 @@ ENDIF() # # ############################# -IF (CMAKE_BUILD_TYPE MATCHES "Release") +if (CMAKE_BUILD_TYPE MATCHES "Release") # # General optimization flags: # - ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "-O2") + add_flags(DEAL_II_CXX_FLAGS_RELEASE "-O2") # # Disable assert() in deal.II and user projects in release mode # - LIST(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG") - LIST(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG") + list(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG") + list(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG") # equivalent to -fno-strict-aliasing: - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-no-ansi-alias") + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-no-ansi-alias") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-ip") + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-ip") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops") -ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS_RELEASE "-funroll-loops") +endif() ########################### @@ -198,14 +198,14 @@ ENDIF() # # ########################### -IF (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") +if (CMAKE_BUILD_TYPE MATCHES "Debug") + list(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") + list(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") - ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0") + add_flags(DEAL_II_CXX_FLAGS_DEBUG "-O0") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-g") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-gdwarf-2") - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-grecord-gcc-switches") -ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-g") + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-gdwarf-2") + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "-grecord-gcc-switches") +endif() diff --git a/cmake/setup_compiler_flags_msvc.cmake b/cmake/setup_compiler_flags_msvc.cmake index b7b94ad397..5aaf651421 100644 --- a/cmake/setup_compiler_flags_msvc.cmake +++ b/cmake/setup_compiler_flags_msvc.cmake @@ -31,28 +31,28 @@ # version 15.0" is, the c++ compiler is advertised as "MSVC++ 14.1" but the # version information is 19.10.x (this is the numbering used by CMake), see # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering -IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.10" ) - MESSAGE(FATAL_ERROR "\n" +if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.10" ) + message(FATAL_ERROR "\n" "You're using an old version of the Visual Studio C++ Compiler!\n" "You need at least version Visual Studio 2017.\n" ) -ENDIF() +endif() # enable exception handling: -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/EHsc") +enable_if_supported(DEAL_II_CXX_FLAGS "/EHsc") # Globally disable some legacy min and max macros that cause problems: -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/NOMINMAX") -LIST(APPEND DEAL_II_DEFINITIONS "NOMINMAX") -LIST(APPEND DEAL_II_USER_DEFINITIONS "NOMINMAX") +enable_if_supported(DEAL_II_CXX_FLAGS "/NOMINMAX") +list(APPEND DEAL_II_DEFINITIONS "NOMINMAX") +list(APPEND DEAL_II_USER_DEFINITIONS "NOMINMAX") # fix "fatal error C1128: number of sections exceeded object file format limit" # happening in debug mode with visual studio 2015 -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/bigobj") +enable_if_supported(DEAL_II_CXX_FLAGS "/bigobj") -ADD_FLAGS(DEAL_II_CXX_FLAGS "/W3") +add_flags(DEAL_II_CXX_FLAGS "/W3") # # Selectively disable a bunch of warnings: @@ -70,23 +70,23 @@ ADD_FLAGS(DEAL_II_CXX_FLAGS "/W3") # 4700 - uninitialized local variable # 4789 - destination of memory copy is too small # 4808 - case 'value' is not a valid value for switch condition of type 'bool -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4068") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4244") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4267") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4996") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4355") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4800") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4146") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4667") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4520") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4700") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4789") -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd4808") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4068") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4244") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4267") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4996") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4355") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4800") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4146") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4667") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4520") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4700") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4789") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd4808") # Bug in MSVC 2017: bogus warning C5037: an out-of-line definition of a member of a class template cannot have default arguments # see https://developercommunity.visualstudio.com/content/problem/81223/incorrect-error-c5037-with-permissive.html -ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd5037") +enable_if_supported(DEAL_II_CXX_FLAGS "/wd5037") ############################# # # @@ -94,19 +94,19 @@ ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/wd5037") # # ############################# -IF (CMAKE_BUILD_TYPE MATCHES "Release") +if (CMAKE_BUILD_TYPE MATCHES "Release") # # General optimization flags: (very basic for now) # - ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "/O2") + add_flags(DEAL_II_CXX_FLAGS_RELEASE "/O2") # # Disable assert() in deal.II and user projects in release mode # - LIST(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG") - LIST(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG") + list(APPEND DEAL_II_DEFINITIONS_RELEASE "NDEBUG") + list(APPEND DEAL_II_USER_DEFINITIONS_RELEASE "NDEBUG") -ENDIF() +endif() ########################### @@ -115,11 +115,11 @@ ENDIF() # # ########################### -IF (CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") - LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") +if (CMAKE_BUILD_TYPE MATCHES "Debug") + list(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG") + list(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG") # generate some debug info: - ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "/Zi /MDd /Od") -ENDIF() + enable_if_supported(DEAL_II_CXX_FLAGS_DEBUG "/Zi /MDd /Od") +endif() diff --git a/cmake/setup_cpack.cmake b/cmake/setup_cpack.cmake index 01effb5b70..f324daa5d6 100644 --- a/cmake/setup_cpack.cmake +++ b/cmake/setup_cpack.cmake @@ -13,81 +13,81 @@ ## ## --------------------------------------------------------------------- -IF(DEAL_II_COMPONENT_PACKAGE) - MESSAGE(STATUS "Setting up CPack") - SET(CPACK_GENERATOR "Bundle") +if(DEAL_II_COMPONENT_PACKAGE) + message(STATUS "Setting up CPack") + set(CPACK_GENERATOR "Bundle") - CONFIGURE_FILE( + configure_file( ${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/mac_startup_script.sh.in ${CMAKE_BINARY_DIR}/cpack/mac_startup_script.sh @ONLY ) - CONFIGURE_FILE( + configure_file( ${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/dealii-terminal.in ${CMAKE_BINARY_DIR}/cpack/dealii-terminal @ONLY ) - CONFIGURE_FILE( + configure_file( ${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/dealii.conf.in ${CMAKE_BINARY_DIR}/cpack/dealii.conf @ONLY ) - CONFIGURE_FILE( + configure_file( ${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/Info.plist.in ${CMAKE_BINARY_DIR}/cpack/Info.plist @ONLY ) - SET(CPACK_PACKAGE_ICON + set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/dealii-icon.icns" ) set(CPACK_PACKAGE_FILE_NAME "dealii-${DEAL_II_PACKAGE_VERSION}" ) - MESSAGE(STATUS " Disk filename: ${CPACK_PACKAGE_FILE_NAME}.dmg") + message(STATUS " Disk filename: ${CPACK_PACKAGE_FILE_NAME}.dmg") set(CPACK_BUNDLE_NAME "${DEAL_II_CPACK_BUNDLE_NAME}" ) - MESSAGE(STATUS " Application: ${DEAL_II_CPACK_BUNDLE_NAME}.app") + message(STATUS " Application: ${DEAL_II_CPACK_BUNDLE_NAME}.app") - SET(CPACK_BUNDLE_ICON + set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/cmake/cpack-mac-bundle/dealii-icon.icns" ) - SET(CPACK_BUNDLE_PLIST + set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/cpack/Info.plist" ) - SET(CPACK_BUNDLE_STARTUP_COMMAND + set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_BINARY_DIR}/cpack/mac_startup_script.sh" ) - INSTALL(FILES + install(FILES ${CMAKE_BINARY_DIR}/cpack/dealii.conf DESTINATION ${DEAL_II_SHARE_RELDIR} ) - INSTALL(PROGRAMS + install(PROGRAMS ${CMAKE_BINARY_DIR}/cpack/dealii-terminal DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} ) - IF(NOT "${DEAL_II_CPACK_EXTERNAL_LIBS}" STREQUAL "") - SET(_SRC "/Applications/${DEAL_II_CPACK_BUNDLE_NAME}.app/Contents/Resources/${DEAL_II_CPACK_EXTERNAL_LIBS}/") - IF(IS_DIRECTORY ${_SRC}) - MESSAGE(STATUS " Will copy ${_SRC} *as is* in the generated package") - INSTALL(DIRECTORY ${_SRC} + if(NOT "${DEAL_II_CPACK_EXTERNAL_LIBS}" STREQUAL "") + set(_SRC "/Applications/${DEAL_II_CPACK_BUNDLE_NAME}.app/Contents/Resources/${DEAL_II_CPACK_EXTERNAL_LIBS}/") + if(IS_DIRECTORY ${_SRC}) + message(STATUS " Will copy ${_SRC} *as is* in the generated package") + install(DIRECTORY ${_SRC} DESTINATION ${DEAL_II_CPACK_EXTERNAL_LIBS} USE_SOURCE_PERMISSIONS ) - ENDIF() - ENDIF() + endif() + endif() - INCLUDE(CPack) - MESSAGE(STATUS "Setting up CPack - Done") -ENDIF() + include(CPack) + message(STATUS "Setting up CPack - Done") +endif() diff --git a/cmake/setup_custom_targets.cmake b/cmake/setup_custom_targets.cmake index ef28ba82d6..3d42b17bcc 100644 --- a/cmake/setup_custom_targets.cmake +++ b/cmake/setup_custom_targets.cmake @@ -22,54 +22,54 @@ # -IF("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") +if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") # # In case that CMAKE_INSTALL_PREFIX wasn't set, we assume that the user # doesn't actually want to install but just use deal.II in the build # directory. In this case, do not add the "install" phase to the # convenience targets. # - MACRO(_add_custom_target _name) - ADD_CUSTOM_TARGET(${_name}) - ENDMACRO() + macro(_add_custom_target _name) + add_custom_target(${_name}) + endmacro() # Print precise information about the convenience targets: - SET(_description_string "build") -ELSE() - MACRO(_add_custom_target _name) - ADD_CUSTOM_TARGET(${_name} + set(_description_string "build") +else() + macro(_add_custom_target _name) + add_custom_target(${_name} COMMAND ${CMAKE_COMMAND} -DCOMPONENT="${_name}" -P cmake_install.cmake COMMENT "Build and install component \"library\"." WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - ENDMACRO() + endmacro() # Print precise information about the convenience targets: - SET(_description_string "build and install") -ENDIF() + set(_description_string "build and install") +endif() # The library can always be compiled and/or installed unconditionally ;-) _add_custom_target(library) -FOREACH(_component documentation examples python_bindings) - STRING(TOUPPER "${_component}" _component_uppercase) - IF(DEAL_II_COMPONENT_${_component_uppercase}) +foreach(_component documentation examples python_bindings) + string(TOUPPER "${_component}" _component_uppercase) + if(DEAL_II_COMPONENT_${_component_uppercase}) _add_custom_target(${_component}) - ELSE() - STRING(TOUPPER ${_component} _componentuppercase) + else() + string(TOUPPER ${_component} _componentuppercase) - SET(_error_description_message + set(_error_description_message "Error: Could not ${_description_string} disabled component ${_component}.") - DECORATE_WITH_STARS(${_error_description_message} + decorate_with_stars(${_error_description_message} _decorated_error_description_message) - SET(_reconfiguration_help_message + set(_reconfiguration_help_message "Please reconfigure with -DDEAL_II_COMPONENT_${_componentuppercase}=ON") - DECORATE_WITH_STARS(${_reconfiguration_help_message} + decorate_with_stars(${_reconfiguration_help_message} _decorated_reconfiguration_help_message) - ADD_CUSTOM_TARGET(${_component} + add_custom_target(${_component} COMMAND ${CMAKE_COMMAND} -E echo '' && ${CMAKE_COMMAND} -E echo '' @@ -81,11 +81,11 @@ FOREACH(_component documentation examples python_bindings) && ${CMAKE_COMMAND} -E echo '' && false ) - ENDIF() -ENDFOREACH() + endif() +endforeach() -IF(NOT DEAL_II_COMPONENT_PACKAGE) - ADD_CUSTOM_TARGET(package +if(NOT DEAL_II_COMPONENT_PACKAGE) + add_custom_target(package COMMAND ${CMAKE_COMMAND} -E echo '' && ${CMAKE_COMMAND} -E echo '' @@ -97,13 +97,13 @@ IF(NOT DEAL_II_COMPONENT_PACKAGE) && ${CMAKE_COMMAND} -E echo '' && false ) -ENDIF() +endif() # # Provide an indentation target for indenting uncommitted changes and changes on # the current feature branch # -ADD_CUSTOM_TARGET(indent +add_custom_target(indent WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ./contrib/utilities/indent COMMENT "Indenting recently changed files in the deal.II directories" @@ -112,7 +112,7 @@ ADD_CUSTOM_TARGET(indent # # Provide "indent" target for indenting all headers and source files # -ADD_CUSTOM_TARGET(indent-all +add_custom_target(indent-all WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ./contrib/utilities/indent-all COMMENT "Indenting all files in the deal.II directories" @@ -122,14 +122,14 @@ ADD_CUSTOM_TARGET(indent-all # # Provide an "info" target to print a help message: # -IF(CMAKE_GENERATOR MATCHES "Ninja") - SET(_make_command "ninja") -ELSE() - SET(_make_command "make") -ENDIF() +if(CMAKE_GENERATOR MATCHES "Ninja") + set(_make_command "ninja") +else() + set(_make_command "make") +endif() -FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake -"MESSAGE( +file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake +"message( \"### # # The following targets are available (invoke by $ ${_make_command} ): @@ -164,26 +164,26 @@ FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake # Provide "relocate" target to run install_name_tool on all external libraries # under ${DEAL_II_CPACK_EXTERNAL_LIBS_TREE} # -IF(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND +if(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT "${DEAL_II_CPACK_EXTERNAL_LIBS_TREE}" STREQUAL "") - ADD_CUSTOM_TARGET(relocate + add_custom_target(relocate WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ./contrib/utilities/relocate_libraries.py COMMENT "Running install_name_tool under ${DEAL_II_CPACK_EXTERNAL_LIBS_TREE}" ) - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake "# # relocate - fix RPATH for external libraries, if packaging was requested " ) -ENDIF() +endif() -FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake +file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake "# ###\")" ) -ADD_CUSTOM_TARGET(info +add_custom_target(info COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_info.cmake ) @@ -191,4 +191,4 @@ ADD_CUSTOM_TARGET(info # # Provide a target to build all .inst files # -ADD_CUSTOM_TARGET(expand_all_instantiations) +add_custom_target(expand_all_instantiations) diff --git a/cmake/setup_deal_ii.cmake b/cmake/setup_deal_ii.cmake index 5bdfb74c27..90cf4cecaa 100644 --- a/cmake/setup_deal_ii.cmake +++ b/cmake/setup_deal_ii.cmake @@ -65,33 +65,33 @@ # # ######################################################################## -SET_IF_EMPTY(DEAL_II_PACKAGE_NAME "deal.II") +set_if_empty(DEAL_II_PACKAGE_NAME "deal.II") -SET_IF_EMPTY(DEAL_II_PACKAGE_VENDOR +set_if_empty(DEAL_II_PACKAGE_VENDOR "The deal.II Authors " ) -SET_IF_EMPTY(DEAL_II_PACKAGE_DESCRIPTION +set_if_empty(DEAL_II_PACKAGE_DESCRIPTION "Library for solving partial differential equations with the finite element method" ) -FILE(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" _version LIMIT_COUNT 1) -SET_IF_EMPTY(DEAL_II_PACKAGE_VERSION "${_version}") +file(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" _version LIMIT_COUNT 1) +set_if_empty(DEAL_II_PACKAGE_VERSION "${_version}") # # We expect a version number of the form "X.Y.Z" or "X.Y.Z-bla", where X, Y, Z # are always numbers and bla is a short string ("pre", "rc0", "rc1", etc.). # -STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" +string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" DEAL_II_VERSION_MAJOR "${DEAL_II_PACKAGE_VERSION}" ) -STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" +string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_VERSION_MINOR "${DEAL_II_PACKAGE_VERSION}" ) -STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" +string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" DEAL_II_VERSION_SUBMINOR "${DEAL_II_PACKAGE_VERSION}" ) -SET(DEAL_II_VERSION ${DEAL_II_VERSION_MAJOR}.${DEAL_II_VERSION_MINOR}.${DEAL_II_VERSION_SUBMINOR}) +set(DEAL_II_VERSION ${DEAL_II_VERSION_MAJOR}.${DEAL_II_VERSION_MINOR}.${DEAL_II_VERSION_SUBMINOR}) ######################################################################## @@ -100,45 +100,45 @@ SET(DEAL_II_VERSION ${DEAL_II_VERSION_MAJOR}.${DEAL_II_VERSION_MINOR}.${DEAL_II_ # # ######################################################################## -SET(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PACKAGE_NAME}") +set(DEAL_II_PROJECT_CONFIG_NAME "${DEAL_II_PACKAGE_NAME}") -STRING(REPLACE "." "_" _base_name "${DEAL_II_PACKAGE_NAME}") -SET_IF_EMPTY(DEAL_II_BASE_NAME "${_base_name}") -SET_IF_EMPTY(DEAL_II_DEBUG_SUFFIX ".g") -SET_IF_EMPTY(DEAL_II_RELEASE_SUFFIX "") +string(REPLACE "." "_" _base_name "${DEAL_II_PACKAGE_NAME}") +set_if_empty(DEAL_II_BASE_NAME "${_base_name}") +set_if_empty(DEAL_II_DEBUG_SUFFIX ".g") +set_if_empty(DEAL_II_RELEASE_SUFFIX "") # # Try to obey the FSHS as close as possible ... # -SET_IF_EMPTY(DEAL_II_EXECUTABLE_RELDIR "bin") -SET_IF_EMPTY(DEAL_II_INCLUDE_RELDIR "include") -SET_IF_EMPTY(DEAL_II_LIBRARY_RELDIR "lib${LIB_SUFFIX}") -SET_IF_EMPTY(DEAL_II_PKGCONF_RELDIR "${DEAL_II_LIBRARY_RELDIR}/pkgconfig") -SET_IF_EMPTY(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}") -SET_IF_EMPTY(DEAL_II_SHARE_RELDIR "share/${DEAL_II_PACKAGE_NAME}") +set_if_empty(DEAL_II_EXECUTABLE_RELDIR "bin") +set_if_empty(DEAL_II_INCLUDE_RELDIR "include") +set_if_empty(DEAL_II_LIBRARY_RELDIR "lib${LIB_SUFFIX}") +set_if_empty(DEAL_II_PKGCONF_RELDIR "${DEAL_II_LIBRARY_RELDIR}/pkgconfig") +set_if_empty(DEAL_II_PROJECT_CONFIG_RELDIR "${DEAL_II_LIBRARY_RELDIR}/cmake/${DEAL_II_PROJECT_CONFIG_NAME}") +set_if_empty(DEAL_II_SHARE_RELDIR "share/${DEAL_II_PACKAGE_NAME}") # # ... but install the documentation into prominent places: # -SET_IF_EMPTY(DEAL_II_DOCREADME_RELDIR "./") -SET_IF_EMPTY(DEAL_II_DOCHTML_RELDIR "doc") -SET_IF_EMPTY(DEAL_II_EXAMPLES_RELDIR "examples") +set_if_empty(DEAL_II_DOCREADME_RELDIR "./") +set_if_empty(DEAL_II_DOCHTML_RELDIR "doc") +set_if_empty(DEAL_II_EXAMPLES_RELDIR "examples") -IF(CMAKE_BUILD_TYPE MATCHES "Debug") - LIST(APPEND DEAL_II_BUILD_TYPES "DEBUG") -ENDIF() +if(CMAKE_BUILD_TYPE MATCHES "Debug") + list(APPEND DEAL_II_BUILD_TYPES "DEBUG") +endif() -IF(CMAKE_BUILD_TYPE MATCHES "Release") - LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE") -ENDIF() +if(CMAKE_BUILD_TYPE MATCHES "Release") + list(APPEND DEAL_II_BUILD_TYPES "RELEASE") +endif() -SET(DEAL_II_LIST_SUFFIXES +set(DEAL_II_LIST_SUFFIXES DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG ) -SET(DEAL_II_STRING_SUFFIXES +set(DEAL_II_STRING_SUFFIXES EXECUTABLE CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG ) @@ -150,17 +150,17 @@ SET(DEAL_II_STRING_SUFFIXES # # ######################################################################## -IF(DEAL_II_PREFER_STATIC_LIBS) +if(DEAL_II_PREFER_STATIC_LIBS) # # Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS # is set. This will prefer static archives instead of shared libraries: # - LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) -ENDIF() + list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES) +endif() -IF(CMAKE_CROSSCOMPILING) +if(CMAKE_CROSSCOMPILING) # # Disable platform introspection when cross compiling # - SET(DEAL_II_ALLOW_PLATFORM_INTROSPECTION OFF CACHE BOOL "" FORCE) -ENDIF() + set(DEAL_II_ALLOW_PLATFORM_INTROSPECTION OFF CACHE BOOL "" FORCE) +endif() diff --git a/cmake/setup_external_macros.cmake b/cmake/setup_external_macros.cmake index 98903f3a84..e85eadfc4f 100644 --- a/cmake/setup_external_macros.cmake +++ b/cmake/setup_external_macros.cmake @@ -17,11 +17,11 @@ # Include all external (cmake) macros that we will use: # -INCLUDE(CheckCXXCompilerFlag) -INCLUDE(CheckCXXSourceCompiles) -INCLUDE(CheckCXXSourceRuns) -INCLUDE(CheckCXXSymbolExists) -INCLUDE(CheckIncludeFileCXX) +include(CheckCXXCompilerFlag) +include(CheckCXXSourceCompiles) +include(CheckCXXSourceRuns) +include(CheckCXXSymbolExists) +include(CheckIncludeFileCXX) -INCLUDE(CheckCSourceCompiles) -INCLUDE(CheckFunctionExists) +include(CheckCSourceCompiles) +include(CheckFunctionExists) diff --git a/cmake/setup_finalize.cmake b/cmake/setup_finalize.cmake index 515d999157..5f10a07523 100644 --- a/cmake/setup_finalize.cmake +++ b/cmake/setup_finalize.cmake @@ -23,118 +23,118 @@ # # Hide some cmake specific cached variables. This is annoying... # -MARK_AS_ADVANCED(file_cmd) +mark_as_advanced(file_cmd) # # Append the saved initial (cached) variables ${flags}_SAVED at the end of # ${flags}, see setup_cached_compiler_flags.cmake and the main # CMakeLists.txt for details. # -FOREACH(_flags ${DEAL_II_USED_FLAGS}) +foreach(_flags ${DEAL_II_USED_FLAGS}) # Strip leading and trailing whitespace: - STRING(STRIP "${${_flags}} ${${_flags}_SAVED}" ${_flags}) -ENDFOREACH() + string(STRIP "${${_flags}} ${${_flags}_SAVED}" ${_flags}) +endforeach() # # Sanity check: The variables defined in DEAL_II_REMOVED_FLAGS must not be # used during the configuration stage: # -FOREACH(_flag ${DEAL_II_REMOVED_FLAGS}) - IF(NOT "${${_flag}}" STREQUAL "") - MESSAGE(FATAL_ERROR +foreach(_flag ${DEAL_II_REMOVED_FLAGS}) + if(NOT "${${_flag}}" STREQUAL "") + message(FATAL_ERROR "\nInternal configuration error: The variable ${_flag} was set to a " "non empty value during the configuration! (The corresponding " "DEAL_II_* variable should have been used.)\n" "${_flag}=\"${${_flag}}\"\n" ) - ENDIF() -ENDFOREACH() + endif() +endforeach() # # Save base configuration into variables BASE_* for later use in # setup_write_config.cmake: # -FOREACH(_suffix ${DEAL_II_STRING_SUFFIXES} ${DEAL_II_LIST_SUFFIXES}) - SET(BASE_${_suffix} ${DEAL_II_${_suffix}}) -ENDFOREACH() +foreach(_suffix ${DEAL_II_STRING_SUFFIXES} ${DEAL_II_LIST_SUFFIXES}) + set(BASE_${_suffix} ${DEAL_II_${_suffix}}) +endforeach() # # Register features: # -FOREACH(_feature ${DEAL_II_FEATURES}) - IF(DEAL_II_WITH_${_feature}) - FILTER_SYSTEM_LIBRARIES(${_feature}) - REGISTER_FEATURE(${_feature}) - ENDIF() -ENDFOREACH() +foreach(_feature ${DEAL_II_FEATURES}) + if(DEAL_II_WITH_${_feature}) + filter_system_libraries(${_feature}) + register_feature(${_feature}) + endif() +endforeach() # # Deduplicate entries one more time :-] # -FOREACH(_suffix ${DEAL_II_LIST_SUFFIXES}) - IF(_suffix MATCHES "INCLUDE_DIRS$") - REMOVE_DUPLICATES(DEAL_II_${_suffix}) - ELSE() - REMOVE_DUPLICATES(DEAL_II_${_suffix} REVERSE) - ENDIF() -ENDFOREACH() +foreach(_suffix ${DEAL_II_LIST_SUFFIXES}) + if(_suffix MATCHES "INCLUDE_DIRS$") + remove_duplicates(DEAL_II_${_suffix}) + else() + remove_duplicates(DEAL_II_${_suffix} REVERSE) + endif() +endforeach() # # Sanity check: Can we compile with the final setup? # -FOREACH(build ${DEAL_II_BUILD_TYPES}) +foreach(build ${DEAL_II_BUILD_TYPES}) - MACRO(_check_linker_flags) - CHECK_COMPILER_SETUP( + macro(_check_linker_flags) + check_compiler_setup( "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}}" "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${build}}" DEAL_II_HAVE_USABLE_FLAGS_${build} ${DEAL_II_LIBRARIES} ${DEAL_II_LIBRARIES_${build}} ) - ENDMACRO() + endmacro() - MACRO(_drop_linker_flag _linker_flag _replacement_flag _variable) - MESSAGE(STATUS + macro(_drop_linker_flag _linker_flag _replacement_flag _variable) + message(STATUS "Unable to compile a simple test program. " "Trying to drop \"${_linker_flag}\" from the linker flags." ) - FOREACH(_flags + foreach(_flags DEAL_II_LINKER_FLAGS DEAL_II_LINKER_FLAGS_${build} BASE_LINKER_FLAGS BASE_LINKER_FLAGS_${build} ) - STRING(REPLACE "${_linker_flag}" "${_replacement_flag}" + string(REPLACE "${_linker_flag}" "${_replacement_flag}" ${_flags} "${${_flags}}" ) - ENDFOREACH() - SET(${_variable} FALSE CACHE INTERNAL "" FORCE) - SET(${_variable} FALSE) - ENDMACRO() + endforeach() + set(${_variable} FALSE CACHE INTERNAL "" FORCE) + set(${_variable} FALSE) + endmacro() _check_linker_flags() - IF(NOT DEAL_II_HAVE_USABLE_FLAGS_${build} AND DEAL_II_COMPILER_HAS_FUSE_LD_LLD) - SET(_replacement "") - IF(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) - SET(_replacement "-fuse-ld=gold") - ENDIF() + if(NOT DEAL_II_HAVE_USABLE_FLAGS_${build} AND DEAL_II_COMPILER_HAS_FUSE_LD_LLD) + set(_replacement "") + if(DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) + set(_replacement "-fuse-ld=gold") + endif() _drop_linker_flag( "-fuse-ld=lld" ${_replacement} DEAL_II_COMPILER_HAS_FUSE_LD_LLD ) _check_linker_flags() - ENDIF() + endif() - IF(NOT DEAL_II_HAVE_USABLE_FLAGS_${build} AND DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) + if(NOT DEAL_II_HAVE_USABLE_FLAGS_${build} AND DEAL_II_COMPILER_HAS_FUSE_LD_GOLD) _drop_linker_flag( "-fuse-ld=gold" "" DEAL_II_COMPILER_HAS_FUSE_LD_GOLD ) _check_linker_flags() - ENDIF() + endif() - IF(NOT DEAL_II_HAVE_USABLE_FLAGS_${build}) - MESSAGE(FATAL_ERROR " + if(NOT DEAL_II_HAVE_USABLE_FLAGS_${build}) + message(FATAL_ERROR " Configuration error: Cannot compile a test program with the final set of compiler and linker flags: CXX flags (${build}): ${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}} @@ -142,12 +142,12 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) LIBRARIES (${build}): ${DEAL_II_LIBRARIES};${DEAL_II_LIBRARIES_${build}} \n\n" ) - ENDIF() -ENDFOREACH() + endif() +endforeach() # # Clean up deal.IITargets.cmake in the build directory: # -FILE(REMOVE +file(REMOVE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake ) diff --git a/cmake/setup_write_config.cmake b/cmake/setup_write_config.cmake index 92bd5cae11..c57a50cb91 100644 --- a/cmake/setup_write_config.cmake +++ b/cmake/setup_write_config.cmake @@ -20,9 +20,9 @@ # # ######################################################################## -DEAL_II_QUERY_GIT_INFORMATION("DEAL_II") +deal_ii_query_git_information("DEAL_II") -FILE(WRITE ${CMAKE_BINARY_DIR}/revision.log +file(WRITE ${CMAKE_BINARY_DIR}/revision.log "### # # Git information: @@ -40,31 +40,31 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/revision.log # # ######################################################################## -SET(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log") -SET(_log_summary "${CMAKE_BINARY_DIR}/summary.log") -SET(_log_feature "${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake") -FILE(REMOVE ${_log_detailed} ${_log_summary} ${_log_feature}) +set(_log_detailed "${CMAKE_BINARY_DIR}/detailed.log") +set(_log_summary "${CMAKE_BINARY_DIR}/summary.log") +set(_log_feature "${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}FeatureConfig.cmake") +file(REMOVE ${_log_detailed} ${_log_summary} ${_log_feature}) -MACRO(_both) +macro(_both) # Write to both log files: - FILE(APPEND ${_log_detailed} "${ARGN}") - FILE(APPEND ${_log_summary} "${ARGN}") -ENDMACRO() + file(APPEND ${_log_detailed} "${ARGN}") + file(APPEND ${_log_summary} "${ARGN}") +endmacro() -MACRO(_detailed) +macro(_detailed) # Only write to detailed.log: - FILE(APPEND ${_log_detailed} "${ARGN}") -ENDMACRO() + file(APPEND ${_log_detailed} "${ARGN}") +endmacro() -MACRO(_summary) +macro(_summary) # Only write to summary.log: - FILE(APPEND ${_log_summary} "${ARGN}") -ENDMACRO() + file(APPEND ${_log_summary} "${ARGN}") +endmacro() -MACRO(_featurelog) +macro(_featurelog) # Only write to deal.IIFeatureConfig.cmake: - FILE(APPEND ${_log_feature} "${ARGN}") -ENDMACRO() + file(APPEND ${_log_feature} "${ARGN}") +endmacro() _both( "### @@ -76,44 +76,44 @@ _both( # CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR} " ) -IF("${DEAL_II_GIT_SHORTREV}" STREQUAL "") +if("${DEAL_II_GIT_SHORTREV}" STREQUAL "") _both("# (version ${DEAL_II_PACKAGE_VERSION})\n") -ELSE() +else() _both("# (version ${DEAL_II_PACKAGE_VERSION}, shortrev ${DEAL_II_GIT_SHORTREV})\n") -ENDIF() +endif() _both( "# CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR} # CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} # ${CMAKE_CXX_COMPILER} " ) -IF(DEAL_II_HAVE_CXX20) +if(DEAL_II_HAVE_CXX20) _both("# C++ language standard: C++20\n") -ELSEIF(DEAL_II_HAVE_CXX17) +elseif(DEAL_II_HAVE_CXX17) _both("# C++ language standard: C++17\n") -ELSEIF(DEAL_II_HAVE_CXX14) +elseif(DEAL_II_HAVE_CXX14) _both("# C++ language standard: C++14\n") -ENDIF() +endif() -IF(CMAKE_C_COMPILER_WORKS) +if(CMAKE_C_COMPILER_WORKS) _detailed("# CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n") -ENDIF() -IF(CMAKE_Fortran_COMPILER_WORKS) +endif() +if(CMAKE_Fortran_COMPILER_WORKS) _detailed("# CMAKE_Fortran_COMPILER: ${CMAKE_Fortran_COMPILER}\n") -ENDIF() +endif() _detailed("# CMAKE_GENERATOR: ${CMAKE_GENERATOR}\n") -IF(CMAKE_CROSSCOMPILING) +if(CMAKE_CROSSCOMPILING) _both( "#\n# CROSSCOMPILING!\n" ) -ENDIF() +endif() -IF(DEAL_II_STATIC_EXECUTABLE) +if(DEAL_II_STATIC_EXECUTABLE) _both( "#\n# STATIC LINKAGE!\n" ) -ENDIF() +endif() _both("#\n") @@ -122,162 +122,162 @@ _detailed( # DEAL_II_CXX_FLAGS: ${BASE_CXX_FLAGS} " ) -IF(CMAKE_BUILD_TYPE MATCHES "Release") +if(CMAKE_BUILD_TYPE MATCHES "Release") _detailed("# DEAL_II_CXX_FLAGS_RELEASE: ${BASE_CXX_FLAGS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") +endif() +if(CMAKE_BUILD_TYPE MATCHES "Debug") _detailed("# DEAL_II_CXX_FLAGS_DEBUG: ${BASE_CXX_FLAGS_DEBUG}\n") -ENDIF() +endif() _detailed("# DEAL_II_LINKER_FLAGS: ${BASE_LINKER_FLAGS}\n") -IF(CMAKE_BUILD_TYPE MATCHES "Release") +if(CMAKE_BUILD_TYPE MATCHES "Release") _detailed("# DEAL_II_LINKER_FLAGS_RELEASE: ${BASE_LINKER_FLAGS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") +endif() +if(CMAKE_BUILD_TYPE MATCHES "Debug") _detailed("# DEAL_II_LINKER_FLAGS_DEBUG: ${BASE_LINKER_FLAGS_DEBUG}\n") -ENDIF() +endif() _detailed("# DEAL_II_DEFINITIONS: ${BASE_DEFINITIONS}\n") -IF(CMAKE_BUILD_TYPE MATCHES "Release") +if(CMAKE_BUILD_TYPE MATCHES "Release") _detailed("# DEAL_II_DEFINITIONS_RELEASE: ${BASE_DEFINITIONS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") +endif() +if(CMAKE_BUILD_TYPE MATCHES "Debug") _detailed("# DEAL_II_DEFINITIONS_DEBUG: ${BASE_DEFINITIONS_DEBUG}\n") -ENDIF() +endif() _detailed("# DEAL_II_USER_DEFINITIONS: ${BASE_DEFINITIONS}\n") -IF(CMAKE_BUILD_TYPE MATCHES "Release") +if(CMAKE_BUILD_TYPE MATCHES "Release") _detailed("# DEAL_II_USER_DEFINITIONS_REL: ${BASE_DEFINITIONS_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") +endif() +if(CMAKE_BUILD_TYPE MATCHES "Debug") _detailed("# DEAL_II_USER_DEFINITIONS_DEB: ${BASE_DEFINITIONS_DEBUG}\n") -ENDIF() +endif() _detailed("# DEAL_II_INCLUDE_DIRS ${BASE_INCLUDE_DIRS}\n") _detailed("# DEAL_II_USER_INCLUDE_DIRS: ${BASE_USER_INCLUDE_DIRS}\n") _detailed("# DEAL_II_BUNDLED_INCLUDE_DIRS: ${BASE_BUNDLED_INCLUDE_DIRS}\n") _detailed("# DEAL_II_LIBRARIES: ${BASE_LIBRARIES}\n") -IF(CMAKE_BUILD_TYPE MATCHES "Release") +if(CMAKE_BUILD_TYPE MATCHES "Release") _detailed("# DEAL_II_LIBRARIES_RELEASE: ${BASE_LIBRARIES_RELEASE}\n") -ENDIF() -IF(CMAKE_BUILD_TYPE MATCHES "Debug") +endif() +if(CMAKE_BUILD_TYPE MATCHES "Debug") _detailed("# DEAL_II_LIBRARIES_DEBUG: ${BASE_LIBRARIES_DEBUG}\n") -ENDIF() +endif() _detailed("# DEAL_II_VECTORIZATION_WIDTH_IN_BITS: ${DEAL_II_VECTORIZATION_WIDTH_IN_BITS}\n") -IF(DEAL_II_HAVE_CXX20) +if(DEAL_II_HAVE_CXX20) _detailed("# DEAL_II_HAVE_CXX20\n") -ELSEIF(DEAL_II_HAVE_CXX17) +elseif(DEAL_II_HAVE_CXX17) _detailed("# DEAL_II_HAVE_CXX17\n") -ELSEIF(DEAL_II_HAVE_CXX14) +elseif(DEAL_II_HAVE_CXX14) _detailed("# DEAL_II_HAVE_CXX14\n") -ENDIF() +endif() _detailed("#\n") -IF(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) +if(NOT DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS) _both("# WARNING: DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS is set to OFF\n") -ENDIF() +endif() _both("# Configured Features (") -IF(DEFINED DEAL_II_ALLOW_BUNDLED) +if(DEFINED DEAL_II_ALLOW_BUNDLED) _both("DEAL_II_ALLOW_BUNDLED = ${DEAL_II_ALLOW_BUNDLED}, ") -ENDIF() -IF(DEAL_II_FORCE_AUTODETECTION) +endif() +if(DEAL_II_FORCE_AUTODETECTION) _both("!!! DEAL_II_FORCE_AUTODETECTION=ON !!!, ") -ENDIF() +endif() _both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n") -SET(_deal_ii_features_sorted ${DEAL_II_FEATURES}) -LIST(SORT _deal_ii_features_sorted) -FOREACH(_feature ${_deal_ii_features_sorted}) - SET(_var DEAL_II_WITH_${_feature}) +set(_deal_ii_features_sorted ${DEAL_II_FEATURES}) +list(SORT _deal_ii_features_sorted) +foreach(_feature ${_deal_ii_features_sorted}) + set(_var DEAL_II_WITH_${_feature}) - IF(${${_var}}) + if(${${_var}}) # # The feature is enabled: # - IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED) + if(FEATURE_${_feature}_EXTERNAL_CONFIGURED) _both("# ${_var} set up with external dependencies\n") - ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED) - IF(DEAL_II_FORCE_BUNDLED_${_feature}) + elseif(FEATURE_${_feature}_BUNDLED_CONFIGURED) + if(DEAL_II_FORCE_BUNDLED_${_feature}) _both("# ${_var} set up with bundled packages (forced)\n") - ELSE() + else() _both("# ${_var} set up with bundled packages\n") - ENDIF() - ELSE() + endif() + else() _both("# ${_var} = ${${_var}}\n") - ENDIF() + endif() # # Print out version number: # - IF(DEFINED ${_feature}_VERSION) + if(DEFINED ${_feature}_VERSION) _detailed("# ${_feature}_VERSION = ${${_feature}_VERSION}\n") - ENDIF() + endif() # # Special version numbers: # - IF(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) + if(_feature MATCHES "THREADS" AND DEFINED TBB_VERSION) _detailed("# TBB_VERSION = ${TBB_VERSION}\n") - ENDIF() + endif() - IF(_feature MATCHES "KOKKOS") + if(_feature MATCHES "KOKKOS") _detailed("# KOKKOS_BACKENDS = ${Kokkos_DEVICES}\n") _detailed("# KOKKOS_ARCHITECTURES = ${Kokkos_ARCH}\n") - ENDIF() + endif() # # Print out ${_feature}_DIR: # - IF(NOT "${${_feature}_DIR}" STREQUAL "") + if(NOT "${${_feature}_DIR}" STREQUAL "") _detailed("# ${_feature}_DIR = ${${_feature}_DIR}\n") - _featurelog("SET(DEAL_II_${_feature}_DIR \"${${_feature}_DIR}\")\n") - ENDIF() + _featurelog("set(DEAL_II_${_feature}_DIR \"${${_feature}_DIR}\")\n") + endif() # # Print the feature configuration: # - FOREACH(_var2 + foreach(_var2 C_COMPILER CXX_COMPILER Fortran_COMPILER WITH_64BIT_BLAS_INDICES ${DEAL_II_STRING_SUFFIXES} ${DEAL_II_LIST_SUFFIXES} ) - IF(DEFINED ${_feature}_${_var2}) + if(DEFINED ${_feature}_${_var2}) _detailed("# ${_feature}_${_var2} = ${${_feature}_${_var2}}\n") - _featurelog("SET(DEAL_II_${_feature}_${_var2} \"${${_feature}_${_var2}}\")\n") - ENDIF() - ENDFOREACH() - ELSE() + _featurelog("set(DEAL_II_${_feature}_${_var2} \"${${_feature}_${_var2}}\")\n") + endif() + endforeach() + else() # FEATURE is disabled _both("# ( ${_var} = ${${_var}} )\n") - ENDIF() -ENDFOREACH() + endif() +endforeach() _both( "#\n# Component configuration:\n" ) -FOREACH(_component ${DEAL_II_COMPONENTS}) - SET(_var DEAL_II_COMPONENT_${_component}) - IF(${${_var}}) +foreach(_component ${DEAL_II_COMPONENTS}) + set(_var DEAL_II_COMPONENT_${_component}) + if(${${_var}}) _both("# ${_var}\n") - ELSE() + else() _both("# ( ${_var} = ${${_var}} )\n") - ENDIF() -ENDFOREACH() + endif() +endforeach() _summary( "#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log #\n# Run $ " ) -IF(CMAKE_GENERATOR MATCHES "Ninja") +if(CMAKE_GENERATOR MATCHES "Ninja") _summary("ninja ") -ELSE() +else() _summary("make ") -ENDIF() +endif() _summary("info to print a help message with a list of top level targets\n") _both("#\n###") diff --git a/contrib/python-bindings/CMakeLists.txt b/contrib/python-bindings/CMakeLists.txt index 9d745f35c9..f13894b6b4 100644 --- a/contrib/python-bindings/CMakeLists.txt +++ b/contrib/python-bindings/CMakeLists.txt @@ -13,55 +13,55 @@ ## ## --------------------------------------------------------------------- -IF(DEAL_II_COMPONENT_PYTHON_BINDINGS) +if(DEAL_II_COMPONENT_PYTHON_BINDINGS) - MESSAGE(STATUS "") - MESSAGE(STATUS "Setting up python bindings") + message(STATUS "") + message(STATUS "Setting up python bindings") # # Find Python: # # Since CMake 3.12, FindPythonInterp is deprecated. if (CMAKE_VERSION VERSION_LESS 3.12) - INCLUDE(FindPythonInterp) + include(FindPythonInterp) else() - FIND_PACKAGE(Python3) - SET(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) - SET(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR}) - SET(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + find_package(Python3) + set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) + set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR}) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) endif() - INCLUDE(FindPythonLibs) + include(FindPythonLibs) - IF(FEATURE_BOOST_BUNDLED_CONFIGURED) - MESSAGE(FATAL_ERROR + if(FEATURE_BOOST_BUNDLED_CONFIGURED) + message(FATAL_ERROR "DEAL_II_COMPONENT_PYTHON_BINDINGS has unmet configuration requirements: " "Python bindings require an external boost library, but deal.II was " "configured with bundled boost." ) - ENDIF() + endif() # # As of 1.67, boost requires specifying the suffix for the python # component manually. # - UNSET(Boost_FOUND) + unset(Boost_FOUND) # On case-insensitive file systems, FindBOOST.cmake and FindBoost.cmake are indistinguishable. # Make sure FindBoost.cmake from CMake installation is found. - LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - SET(Boost_USE_DEBUG_RUNTIME FALSE) - IF(${BOOST_VERSION} VERSION_LESS 1.67) - FIND_PACKAGE(Boost 1.59 COMPONENTS python REQUIRED) - ELSE() - FIND_PACKAGE(Boost 1.67 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED) - ENDIF() - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) + list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) + set(Boost_USE_DEBUG_RUNTIME FALSE) + if(${BOOST_VERSION} VERSION_LESS 1.67) + find_package(Boost 1.59 COMPONENTS python REQUIRED) + else() + find_package(Boost 1.67 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED) + endif() + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) - IF(NOT Boost_FOUND) - MESSAGE(FATAL_ERROR + if(NOT Boost_FOUND) + message(FATAL_ERROR "DEAL_II_COMPONENT_PYTHON_BINDINGS has unmet configuration requirements: " "The external boost library does not provide Boost.Python" ) - ENDIF() + endif() # # FIXME: Once finalized, reconsider moving this definitions into @@ -81,19 +81,19 @@ IF(DEAL_II_COMPONENT_PYTHON_BINDINGS) # **) We do a best effort guess on site-packages location... # - SET_IF_EMPTY(PYTHON_BINDINGS_BASE_NAME "PyDealII") - SET_IF_EMPTY(PYTHON_BINDINGS_DEBUG_NAME "Debug") - SET_IF_EMPTY(PYTHON_BINDINGS_RELEASE_NAME "Release") + set_if_empty(PYTHON_BINDINGS_BASE_NAME "PyDealII") + set_if_empty(PYTHON_BINDINGS_DEBUG_NAME "Debug") + set_if_empty(PYTHON_BINDINGS_RELEASE_NAME "Release") - SET_IF_EMPTY(DEAL_II_PYTHON_RELDIR + set_if_empty(DEAL_II_PYTHON_RELDIR "${DEAL_II_LIBRARY_RELDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/${PYTHON_BINDINGS_BASE_NAME}" ) - ADD_SUBDIRECTORY(source) + add_subdirectory(source) - ADD_SUBDIRECTORY(tests) + add_subdirectory(tests) - MESSAGE(STATUS "Setting up python bindings - Done") - MESSAGE(STATUS "") + message(STATUS "Setting up python bindings - Done") + message(STATUS "") -ENDIF(DEAL_II_COMPONENT_PYTHON_BINDINGS) +endif(DEAL_II_COMPONENT_PYTHON_BINDINGS) diff --git a/contrib/python-bindings/source/CMakeLists.txt b/contrib/python-bindings/source/CMakeLists.txt index 2f399c63b7..43f6a75356 100644 --- a/contrib/python-bindings/source/CMakeLists.txt +++ b/contrib/python-bindings/source/CMakeLists.txt @@ -13,7 +13,7 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_BINARY_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/ ${DEAL_II_BUNDLED_INCLUDE_DIRS} @@ -27,9 +27,9 @@ INCLUDE_DIRECTORIES( # DEAL_II_BUILD_TYPES (usually PyDealIIDebug and PyDealIIRelease) # -INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS}) +include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS}) -SET(_src +set(_src wrappers.cc export_tria_accessor.cc export_cell_accessor.cc @@ -48,12 +48,12 @@ SET(_src reference_cell_wrapper.cc ) -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) +foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) PYTHON_ADD_MODULE(PyDealII_${_build_lowercase} ${_src}) - SET_TARGET_PROPERTIES(PyDealII_${_build_lowercase} PROPERTIES + set_target_properties(PyDealII_${_build_lowercase} PROPERTIES OUTPUT_NAME "${PYTHON_BINDINGS_${_build}_NAME}" LINK_FLAGS "${DEAL_II_LINKER_FLAGS} ${DEAL_II_LINKER_FLAGS_${_build}}" LINKER_LANGUAGE "CXX" @@ -62,46 +62,46 @@ FOREACH(_build ${DEAL_II_BUILD_TYPES}) ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_PYTHON_RELDIR}" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_PYTHON_RELDIR}" ) - IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - SET_TARGET_PROPERTIES(PyDealII_${_build_lowercase} PROPERTIES + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set_target_properties(PyDealII_${_build_lowercase} PROPERTIES MACOSX_RPATH OFF BUILD_WITH_INSTALL_RPATH OFF INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_PYTHON_RELDIR}" ) - ENDIF() + endif() - TARGET_LINK_LIBRARIES(PyDealII_${_build_lowercase} + target_link_libraries(PyDealII_${_build_lowercase} ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ) - EXPORT(TARGETS PyDealII_${_build_lowercase} + export(TARGETS PyDealII_${_build_lowercase} FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake APPEND ) - INSTALL(TARGETS PyDealII_${_build_lowercase} + install(TARGETS PyDealII_${_build_lowercase} COMPONENT python_bindings EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets LIBRARY DESTINATION ${DEAL_II_PYTHON_RELDIR} ARCHIVE DESTINATION ${DEAL_II_PYTHON_RELDIR} ) - ADD_DEPENDENCIES(python_bindings PyDealII_${_build_lowercase}) -ENDFOREACH() + add_dependencies(python_bindings PyDealII_${_build_lowercase}) +endforeach() # # Copy python sources to binary directory and set up installation: # -SET(_python_sources +set(_python_sources __init__.py ) -FILE(COPY ${_python_sources} +file(COPY ${_python_sources} DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_PYTHON_RELDIR} ) -INSTALL(FILES ${_python_sources} +install(FILES ${_python_sources} DESTINATION ${DEAL_II_PYTHON_RELDIR} COMPONENT python_bindings ) diff --git a/contrib/python-bindings/tests/CMakeLists.txt b/contrib/python-bindings/tests/CMakeLists.txt index 2606713efc..e242b4a799 100644 --- a/contrib/python-bindings/tests/CMakeLists.txt +++ b/contrib/python-bindings/tests/CMakeLists.txt @@ -16,15 +16,15 @@ # # Make sure that the tests are picked up by a global CTest call # -FILE(APPEND ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "SUBDIRS(contrib/python-bindings/tests)\n") -ENABLE_TESTING() +file(APPEND ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "subdirs(contrib/python-bindings/tests)\n") +enable_testing() -FILE(GLOB _tests "${CMAKE_CURRENT_SOURCE_DIR}/*.py") -FOREACH(_test_path ${_tests}) - GET_FILENAME_COMPONENT(_test ${_test_path} NAME_WE) - GET_FILENAME_COMPONENT(_test_directory ${_test_path} DIRECTORY) - ADD_TEST(NAME python-bindings/${_test} COMMAND ${PYTHON_EXECUTABLE} ${_test_path}) - SET_TESTS_PROPERTIES(python-bindings/${_test} PROPERTIES ENVIRONMENT +file(GLOB _tests "${CMAKE_CURRENT_SOURCE_DIR}/*.py") +foreach(_test_path ${_tests}) + get_filename_component(_test ${_test_path} NAME_WE) + get_filename_component(_test_directory ${_test_path} DIRECTORY) + add_test(NAME python-bindings/${_test} COMMAND ${PYTHON_EXECUTABLE} ${_test_path}) + set_tests_properties(python-bindings/${_test} PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/${DEAL_II_PYTHON_RELDIR}/../:$ENV{PYTHONPATH};DEAL_II_PYTHON_TESTPATH=${_test_directory}" ) -ENDFOREACH() +endforeach() diff --git a/contrib/utilities/CMakeLists.txt b/contrib/utilities/CMakeLists.txt index 880df1f895..5ffaa1e2d4 100644 --- a/contrib/utilities/CMakeLists.txt +++ b/contrib/utilities/CMakeLists.txt @@ -17,13 +17,13 @@ # At the present time we only install one script from this directory. # -SET(_scripts +set(_scripts ${CMAKE_CURRENT_SOURCE_DIR}/indent.py ) -FILE(COPY ${_scripts} +file(COPY ${_scripts} DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts ) -INSTALL(FILES ${_scripts} +install(FILES ${_scripts} DESTINATION ${DEAL_II_SHARE_RELDIR}/scripts COMPONENT library ) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 28c13cd31e..3a80c5f706 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -16,18 +16,18 @@ # # Set up all necessary bits for the documentation # -IF(DEAL_II_COMPONENT_DOCUMENTATION) +if(DEAL_II_COMPONENT_DOCUMENTATION) - MESSAGE(STATUS "") - MESSAGE(STATUS "Setting up documentation") + message(STATUS "") + message(STATUS "Setting up documentation") - ADD_SUBDIRECTORY(news) - ADD_SUBDIRECTORY(doxygen) + add_subdirectory(news) + add_subdirectory(doxygen) # # Install the static elements of the html documentation: # - INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${DEAL_II_DOCHTML_RELDIR} COMPONENT documentation PATTERN "CMakeLists.txt" EXCLUDE @@ -35,16 +35,16 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION) PATTERN "news" EXCLUDE ) - MESSAGE(STATUS "Setting up documentation - Done") - MESSAGE(STATUS "") + message(STATUS "Setting up documentation - Done") + message(STATUS "") -ENDIF(DEAL_II_COMPONENT_DOCUMENTATION) +endif(DEAL_II_COMPONENT_DOCUMENTATION) # # Always install a minimalistic README and LICENSE file: # -INSTALL(FILES +install(FILES ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/LICENSE.md DESTINATION ${DEAL_II_DOCREADME_RELDIR} @@ -55,7 +55,7 @@ INSTALL(FILES # Install summary.log an detailed.log # -INSTALL(FILES +install(FILES ${CMAKE_BINARY_DIR}/summary.log ${CMAKE_BINARY_DIR}/detailed.log DESTINATION ${DEAL_II_DOCREADME_RELDIR} @@ -66,9 +66,9 @@ INSTALL(FILES # Add a dummy target to make documentation files known to IDEs. # -FILE(GLOB _misc +file(GLOB _misc ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/headers/*.h ) -ADD_LIBRARY(doxygen_headers OBJECT ${_misc}) -SET_TARGET_PROPERTIES(doxygen_headers PROPERTIES LINKER_LANGUAGE C) +add_library(doxygen_headers OBJECT ${_misc}) +set_target_properties(doxygen_headers PROPERTIES LINKER_LANGUAGE C) diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt index 29c082e97f..fe8c67820c 100644 --- a/doc/doxygen/CMakeLists.txt +++ b/doc/doxygen/CMakeLists.txt @@ -17,22 +17,22 @@ # Generate the source documentation via doxygen: # -FIND_PACKAGE(Perl) -FIND_PACKAGE(Doxygen) +find_package(Perl) +find_package(Doxygen) # # Do we have all necessary dependencies? # -IF(NOT PERL_FOUND) - MESSAGE(FATAL_ERROR +if(NOT PERL_FOUND) + message(FATAL_ERROR "Could not find a perl installation which is required for building the documentation" ) -ENDIF() -IF(NOT DOXYGEN_FOUND) - MESSAGE(FATAL_ERROR +endif() +if(NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Could not find doxygen which is required for building the documentation" ) -ENDIF() +endif() ######################################################################## @@ -41,8 +41,8 @@ ENDIF() # ######################################################################## -ADD_SUBDIRECTORY(tutorial) -ADD_SUBDIRECTORY(code-gallery) +add_subdirectory(tutorial) +add_subdirectory(code-gallery) ######################################################################## @@ -54,10 +54,10 @@ ADD_SUBDIRECTORY(code-gallery) # # Prepare auxiliary files for doxygen: # -IF(DEAL_II_DOXYGEN_USE_MATHJAX) - SET(_use_mathjax YES) - IF(NOT DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX) - DEAL_II_FIND_PATH(MATHJAX_PATH MathJax.js +if(DEAL_II_DOXYGEN_USE_MATHJAX) + set(_use_mathjax YES) + if(NOT DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX) + deal_ii_find_path(MATHJAX_PATH MathJax.js PATHS ${MATHJAX_ROOT} $ENV{MATHJAX_ROOT} "${CMAKE_PREFIX_PATH}/share/javascript/mathjax" @@ -66,20 +66,20 @@ IF(DEAL_II_DOXYGEN_USE_MATHJAX) "/usr/share/yelp/mathjax" DOC "Root path of MathJax.js" ) - IF(MATHJAX_PATH MATCHES "MATHJAX_PATH-NOTFOUND") - MESSAGE(FATAL_ERROR "MathJax was not found.") - ENDIF() - ENDIF() - IF(MATHJAX_PATH AND NOT DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX) - SET(_mathjax_relpath ${MATHJAX_PATH}) - MESSAGE(STATUS "Using local MathJax: " ${MATHJAX_PATH}) - ELSE() - SET(_mathjax_relpath "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/") - MESSAGE(STATUS "Using web-based MathJax: " ${_mathjax_relpath}) - ENDIF() -ELSE() - SET(_use_mathjax NO) -ENDIF() + if(MATHJAX_PATH MATCHES "MATHJAX_PATH-NOTFOUND") + message(FATAL_ERROR "MathJax was not found.") + endif() + endif() + if(MATHJAX_PATH AND NOT DEAL_II_DOXYGEN_USE_ONLINE_MATHJAX) + set(_mathjax_relpath ${MATHJAX_PATH}) + message(STATUS "Using local MathJax: " ${MATHJAX_PATH}) + else() + set(_mathjax_relpath "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/") + message(STATUS "Using web-based MathJax: " ${_mathjax_relpath}) + endif() +else() + set(_use_mathjax NO) +endif() # Collect where the build system will write the .inst files after @@ -91,24 +91,24 @@ ENDIF() # the build directory to it # # See options.dox.in where ${_inst_in_dirs} is later added to INCLUDE_PATH. -FILE(GLOB _inst_in_files +file(GLOB _inst_in_files "${CMAKE_SOURCE_DIR}/source/*/*.inst.in") -STRING(REPLACE "${CMAKE_SOURCE_DIR}/source/" "" _inst_in_dirs_x "${_inst_in_files}") -STRING(REGEX REPLACE "/[a-zA-Z0-9_\\.]*.inst.in" "/" _inst_in_dirs_y "${_inst_in_dirs_x}") -LIST(REMOVE_DUPLICATES _inst_in_dirs_y) -SET(_inst_in_dirs "") -FOREACH (_dir ${_inst_in_dirs_y}) - SET(_inst_in_dirs "${_inst_in_dirs} ${CMAKE_BINARY_DIR}/source/${_dir}") -ENDFOREACH() +string(REPLACE "${CMAKE_SOURCE_DIR}/source/" "" _inst_in_dirs_x "${_inst_in_files}") +string(REGEX REPLACE "/[a-zA-Z0-9_\\.]*.inst.in" "/" _inst_in_dirs_y "${_inst_in_dirs_x}") +list(REMOVE_DUPLICATES _inst_in_dirs_y) +set(_inst_in_dirs "") +foreach (_dir ${_inst_in_dirs_y}) + set(_inst_in_dirs "${_inst_in_dirs} ${CMAKE_BINARY_DIR}/source/${_dir}") +endforeach() -MESSAGE(STATUS "Additional doxygen include paths: ${_inst_in_dirs}") +message(STATUS "Additional doxygen include paths: ${_inst_in_dirs}") # make sure doxygen sees the extra.sty stylefile: -SET(_extra_packages "${CMAKE_CURRENT_SOURCE_DIR}/extra") +set(_extra_packages "${CMAKE_CURRENT_SOURCE_DIR}/extra") # Generate the input files for doxygen using template .in files in which # we have to substitute some CMake variables -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/options.dox.in ${CMAKE_CURRENT_BINARY_DIR}/options.dox ) @@ -116,33 +116,33 @@ CONFIGURE_FILE( # Figure out the last copyright date of any of the deal.II source # files. We will use this then to set the copyright date of the # doxygen-generated HTML files. -SET(_last_year "1997") -FILE(GLOB _source_files +set(_last_year "1997") +file(GLOB _source_files "${CMAKE_SOURCE_DIR}/source/*/*.cc" "${CMAKE_SOURCE_DIR}/include/deal.II/*/*.h" "${CMAKE_SOURCE_DIR}/examples/*/*.cc") -FOREACH (_source ${_source_files}) - FILE(READ "${_source}" contents) - STRING(REGEX MATCH "Copyright .C. +([0-9]+ - )?([0-9]+)" _copyright "${contents}") - IF (NOT _copright STREQUAL "") - STRING(REGEX MATCH "[0-9]+\$" _year "${_copyright}") +foreach (_source ${_source_files}) + file(READ "${_source}" contents) + string(REGEX MATCH "Copyright .C. +([0-9]+ - )?([0-9]+)" _copyright "${contents}") + if (NOT _copright STREQUAL "") + string(REGEX MATCH "[0-9]+\$" _year "${_copyright}") - IF (NOT _year STREQUAL "" AND _year GREATER _last_year) - SET (_last_year "${_year}") - ENDIF() - ENDIF() -ENDFOREACH() -SET(DEAL_II_PACKAGE_YEAR ${_last_year}) -MESSAGE(STATUS "doxygen output will have copyright date ${_last_year}") + if (NOT _year STREQUAL "" AND _year GREATER _last_year) + set (_last_year "${_year}") + endif() + endif() +endforeach() +set(DEAL_II_PACKAGE_YEAR ${_last_year}) +message(STATUS "doxygen output will have copyright date ${_last_year}") # Put the copyright year into the correct files -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/scripts/mod_header.pl.in ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_header.pl ) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/scripts/mod_footer.pl.in ${CMAKE_CURRENT_BINARY_DIR}/scripts/mod_footer.pl ) @@ -158,7 +158,7 @@ CONFIGURE_FILE( # To work around this, do a 'touch' operation on them first to ensure they're # there before we call "doxygen -w". # -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/header.html ${CMAKE_CURRENT_BINARY_DIR}/footer.html COMMAND ${CMAKE_COMMAND} -E touch header.html @@ -176,7 +176,7 @@ ADD_CUSTOM_COMMAND( # Finalize the doxygen configuration: # -SET(_doxygen_input +set(_doxygen_input ${CMAKE_CURRENT_SOURCE_DIR}/headers/ ) @@ -184,7 +184,7 @@ file(GLOB _changelog_files ${CMAKE_SOURCE_DIR}/doc/news/*.h ) -LIST(APPEND _doxygen_input +list(APPEND _doxygen_input ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/source/ ${CMAKE_BINARY_DIR}/include/ @@ -194,7 +194,7 @@ LIST(APPEND _doxygen_input ) # Add other directories in which to find images -SET(_doxygen_image_path +set(_doxygen_image_path ${CMAKE_CURRENT_SOURCE_DIR}/images ) @@ -209,64 +209,64 @@ file(GLOB _doxygen_depend # that they are in fact generated. This would not work if they # are captured via a GLOB since they may not exist (and so not # be captured via the GLOB) at the time cmake runs -LIST(APPEND _doxygen_depend +list(APPEND _doxygen_depend ${CMAKE_BINARY_DIR}/include/deal.II/base/config.h ${CMAKE_CURRENT_BINARY_DIR}/tutorial/tutorial.h ) # Add the changelog (a CMake custom target) as a dependency for doxygen too -LIST(APPEND _doxygen_depend changelog) +list(APPEND _doxygen_depend changelog) # find all tutorial programs so we can add dependencies as appropriate -FILE(GLOB _deal_ii_steps +file(GLOB _deal_ii_steps ${CMAKE_SOURCE_DIR}/examples/step-* ) -FOREACH(_step ${_deal_ii_steps}) - GET_FILENAME_COMPONENT(_step "${_step}" NAME) - LIST(APPEND _doxygen_depend +foreach(_step ${_deal_ii_steps}) + get_filename_component(_step "${_step}" NAME) + list(APPEND _doxygen_depend ${CMAKE_CURRENT_BINARY_DIR}/tutorial/${_step}.h ) - LIST(APPEND _doxygen_input + list(APPEND _doxygen_input ${CMAKE_CURRENT_BINARY_DIR}/tutorial/${_step}.h ) -ENDFOREACH() +endforeach() # Also find all code gallery programs (if available) for the same reason. # The logic here follows the same as in code-gallery/CMakeLists.txt -SET_IF_EMPTY(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery) -IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) - FILE(GLOB _code_gallery_names +set_if_empty(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery) +if (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) + file(GLOB _code_gallery_names "${DEAL_II_CODE_GALLERY_DIRECTORY}/*/doc/author") - STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}") + string(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}") - FOREACH(_step ${_code_gallery_names}) - GET_FILENAME_COMPONENT(_step "${_step}" NAME) + foreach(_step ${_code_gallery_names}) + get_filename_component(_step "${_step}" NAME) - LIST(APPEND _doxygen_depend + list(APPEND _doxygen_depend ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/${_step}.h ) - LIST(APPEND _doxygen_input + list(APPEND _doxygen_input ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/${_step}.h ) - ENDFOREACH() -ENDIF() + endforeach() +endif() # always make the doxygen run depend on the code-gallery.h file # (whether generated from the code gallery or copied from # no-code-gallery.h; both happen in code-gallery/CMakeLists.txt) -LIST(APPEND _doxygen_input +list(APPEND _doxygen_input ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/code-gallery.h ) -LIST(APPEND _doxygen_depend +list(APPEND _doxygen_depend ${CMAKE_CURRENT_BINARY_DIR}/code-gallery/code-gallery.h ) -TO_STRING(_doxygen_image_path_string ${_doxygen_image_path}) -TO_STRING(_doxygen_input_string ${_doxygen_input}) +to_string(_doxygen_image_path_string ${_doxygen_image_path}) +to_string(_doxygen_input_string ${_doxygen_input}) -FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/options.dox" +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/options.dox" " INPUT=${_doxygen_input_string} IMAGE_PATH=${_doxygen_image_path_string} @@ -274,15 +274,15 @@ FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/options.dox" ) # If we use a reasonably modern doxygen version, make sure it is run in parallel -IF(NOT (${DOXYGEN_VERSION} VERSION_LESS 1.9)) - FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/options.dox" +if(NOT (${DOXYGEN_VERSION} VERSION_LESS 1.9)) + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/options.dox" " NUM_PROC_THREADS = 0 DOT_NUM_THREADS = 0 " ) - MESSAGE(STATUS "Letting doxygen run with multiple threads") -ENDIF() + message(STATUS "Letting doxygen run with multiple threads") +endif() @@ -292,7 +292,7 @@ ENDIF() # ######################################################################## -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/doxygen.log COMMAND ${DOXYGEN_EXECUTABLE} @@ -317,25 +317,25 @@ ADD_CUSTOM_COMMAND( COMMENT "Generating documentation via doxygen." VERBATIM ) -ADD_CUSTOM_TARGET(doxygen ALL +add_custom_target(doxygen ALL DEPENDS ${CMAKE_BINARY_DIR}/doxygen.log ) -ADD_DEPENDENCIES(documentation doxygen) +add_dependencies(documentation doxygen) -INSTALL(FILES +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/deal.tag DESTINATION ${DEAL_II_DOCHTML_RELDIR}/doxygen COMPONENT documentation ) -INSTALL(FILES +install(FILES ${CMAKE_SOURCE_DIR}/doc/deal.ico ${CMAKE_SOURCE_DIR}/doc/doxygen/custom.js DESTINATION ${DEAL_II_DOCHTML_RELDIR}/doxygen/deal.II COMPONENT documentation ) -INSTALL(DIRECTORY +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deal.II DESTINATION ${DEAL_II_DOCHTML_RELDIR}/doxygen COMPONENT documentation diff --git a/doc/doxygen/code-gallery/CMakeLists.txt b/doc/doxygen/code-gallery/CMakeLists.txt index 8b6cd889d0..66df644340 100644 --- a/doc/doxygen/code-gallery/CMakeLists.txt +++ b/doc/doxygen/code-gallery/CMakeLists.txt @@ -19,7 +19,7 @@ # A target for the preparation of all the stuff happening in here... # -ADD_CUSTOM_TARGET(code-gallery) +add_custom_target(code-gallery) # @@ -28,10 +28,10 @@ ADD_CUSTOM_TARGET(code-gallery) # a top-level code-gallery/ directory alongside the tutorial/ # directory # -SET_IF_EMPTY(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery) -IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) +set_if_empty(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery) +if (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) - MESSAGE(STATUS "Setting up code gallery documentation from ${DEAL_II_CODE_GALLERY_DIRECTORY}.") + message(STATUS "Setting up code gallery documentation from ${DEAL_II_CODE_GALLERY_DIRECTORY}.") # Collect the names of all code gallery projects. To # do so, find all 'author' files, then strip the last two @@ -40,23 +40,23 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) # For unclear reasons, the glob returns these files as # "/a/b/c/name//doc//author", so make sure we eat the # double slashes in the second step - FILE(GLOB _code_gallery_names + file(GLOB _code_gallery_names "${DEAL_II_CODE_GALLERY_DIRECTORY}/*/doc/author") - STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}") + string(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}") - FOREACH(_step ${_code_gallery_names}) - GET_FILENAME_COMPONENT(_step "${_step}" NAME) - LIST(APPEND _code_gallery_names_sans_dir "${_step}") - ENDFOREACH() + foreach(_step ${_code_gallery_names}) + get_filename_component(_step "${_step}" NAME) + list(APPEND _code_gallery_names_sans_dir "${_step}") + endforeach() # Describe how to build code-gallery.h. Make sure we properly # track dependencies on the input files, by assuming that the PERL # script is going to read all of the files in the doc/ subdirectories - FILE(GLOB _code_gallery_h_deps + file(GLOB _code_gallery_h_deps "${DEAL_II_CODE_GALLERY_DIRECTORY}/*/doc/*") - STRING(REPLACE "//" "/" _code_gallery_h_deps "${_code_gallery_h_deps}") + string(REPLACE "//" "/" _code_gallery_h_deps "${_code_gallery_h_deps}") - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h COMMAND ${PERL_EXECUTABLE} ARGS @@ -70,31 +70,31 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) ${CMAKE_CURRENT_SOURCE_DIR}/code-gallery.h.in ${_code_gallery_h_deps} ) - ADD_CUSTOM_TARGET(build_code-gallery_h + add_custom_target(build_code-gallery_h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h ${_code_gallery_h_deps} COMMENT "Building code-gallery.h") - ADD_DEPENDENCIES(code-gallery build_code-gallery_h) + add_dependencies(code-gallery build_code-gallery_h) # Now set up targets for each of the code gallery programs - FOREACH(_step ${_code_gallery_names}) - GET_FILENAME_COMPONENT(_step "${_step}" NAME) - MESSAGE(STATUS " Setting up ${_step}") + foreach(_step ${_code_gallery_names}) + get_filename_component(_step "${_step}" NAME) + message(STATUS " Setting up ${_step}") # Get all source files so we can let the perl script work on # them and so we properly describe the dependencies. exclude # meta-files necessary to describe each code gallery project - FILE(GLOB_RECURSE _src_files + file(GLOB_RECURSE _src_files ${DEAL_II_CODE_GALLERY_DIRECTORY}/${_step}/*) - STRING(REPLACE "${DEAL_II_CODE_GALLERY_DIRECTORY}/${_step}/" "" _relative_src_files + string(REPLACE "${DEAL_II_CODE_GALLERY_DIRECTORY}/${_step}/" "" _relative_src_files "${_src_files}") - LIST(REMOVE_ITEM _relative_src_files doc/author) - LIST(REMOVE_ITEM _relative_src_files doc/tooltip) - LIST(REMOVE_ITEM _relative_src_files doc/dependencies) - LIST(REMOVE_ITEM _relative_src_files doc/builds-on) + list(REMOVE_ITEM _relative_src_files doc/author) + list(REMOVE_ITEM _relative_src_files doc/tooltip) + list(REMOVE_ITEM _relative_src_files doc/dependencies) + list(REMOVE_ITEM _relative_src_files doc/builds-on) # Also remove files that were created by running 'cmake' in the @@ -103,19 +103,19 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) # # We would really like to also exclude executables, but there is # no option to cmake's 'IF' command to test for that :-( - FOREACH(_file ${_relative_src_files}) - IF(IS_DIRECTORY ${_file} + foreach(_file ${_relative_src_files}) + if(IS_DIRECTORY ${_file} OR ${_file} MATCHES "CMakeFiles/.*" OR ${_file} MATCHES "CMakeCache.txt") - LIST(REMOVE_ITEM _relative_src_files ${_file}) - ENDIF() - ENDFOREACH() + list(REMOVE_ITEM _relative_src_files ${_file}) + endif() + endforeach() - MESSAGE(STATUS " Source files: ${_relative_src_files}") + message(STATUS " Source files: ${_relative_src_files}") - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h COMMAND ${PERL_EXECUTABLE} ARGS @@ -135,29 +135,29 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) # Copy files of interest (non-metadata) to the build directory # so we can link to them, and schedule them for installation - FILE(COPY ${DEAL_II_CODE_GALLERY_DIRECTORY}/${_step} + file(COPY ${DEAL_II_CODE_GALLERY_DIRECTORY}/${_step} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ PATTERN REGEX "doc/tooltip|doc/dependencies|doc/builds-on" EXCLUDE ) - INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_step} + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_step} DESTINATION ${DEAL_II_EXAMPLES_RELDIR}/code-gallery COMPONENT examples ) # Create a target for this program and add it to the top-level # target of this directory - ADD_CUSTOM_TARGET(code-gallery_${_step} + add_custom_target(code-gallery_${_step} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h COMMENT "Building doxygen input file for code gallery program <${_step}>" ) - ADD_DEPENDENCIES(code-gallery code-gallery_${_step}) + add_dependencies(code-gallery code-gallery_${_step}) - ENDFOREACH() + endforeach() # Now also install the directory in which the script puts copies of everything # that isn't explicitly annotated and sent through doxygen. - INSTALL(DIRECTORY + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${DEAL_II_DOCHTML_RELDIR}/doxygen COMPONENT documentation @@ -166,15 +166,15 @@ IF (EXISTS ${DEAL_II_CODE_GALLERY_DIRECTORY}/README.md) ) -ELSE() +else() # no copy of the code gallery is available. say so. but also # install a file that creates a doxygen page we can link to # nonetheless, so we don't get bad doxygen references - MESSAGE(STATUS "Setting up code gallery documentation.") - MESSAGE(STATUS " Skipping as no code gallery exists in ${DEAL_II_CODE_GALLERY_DIRECTORY}.") + message(STATUS "Setting up code gallery documentation.") + message(STATUS " Skipping as no code gallery exists in ${DEAL_II_CODE_GALLERY_DIRECTORY}.") - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/no-code-gallery.h ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/no-code-gallery.h @@ -182,10 +182,10 @@ ELSE() # Make the custom command for code-gallery.h visible to the parent CMakeLists.txt by attaching to the code-gallery # custom target: - ADD_CUSTOM_TARGET(build_code-gallery_h + add_custom_target(build_code-gallery_h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/code-gallery.h COMMENT "Building code-gallery.h") - ADD_DEPENDENCIES(code-gallery build_code-gallery_h) + add_dependencies(code-gallery build_code-gallery_h) -ENDIF() +endif() diff --git a/doc/doxygen/tutorial/CMakeLists.txt b/doc/doxygen/tutorial/CMakeLists.txt index a70b75590b..5326c1e92f 100644 --- a/doc/doxygen/tutorial/CMakeLists.txt +++ b/doc/doxygen/tutorial/CMakeLists.txt @@ -16,7 +16,7 @@ # Collect all of the directory names for the tutorial programs -FILE(GLOB _deal_ii_steps +file(GLOB _deal_ii_steps ${CMAKE_SOURCE_DIR}/examples/step-* ) @@ -27,10 +27,10 @@ FILE(GLOB _deal_ii_steps # For unclear reasons, the glob returns these files as # "/a/b/c/name//doc//author", so make sure we eat the # double slashes in the second step -SET_IF_EMPTY(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery) -FILE(GLOB _code_gallery_names +set_if_empty(DEAL_II_CODE_GALLERY_DIRECTORY ${CMAKE_SOURCE_DIR}/code-gallery) +file(GLOB _code_gallery_names "${DEAL_II_CODE_GALLERY_DIRECTORY}/*/doc/author") -STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}") +string(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_names}") # # Define target for the tutorial. It depends on the @@ -43,7 +43,7 @@ STRING(REGEX REPLACE "/+doc/+author" "" _code_gallery_names "${_code_gallery_nam # ../CMakeLists.txt. # -ADD_CUSTOM_TARGET(tutorial) +add_custom_target(tutorial) # # Describe how to build tutorial.h. @@ -65,23 +65,23 @@ ADD_CUSTOM_TARGET(tutorial) file(GLOB _deal_ii_steps_tooltip ${CMAKE_SOURCE_DIR}/examples/step-*/doc/tooltip ) -FOREACH(_gallery ${_code_gallery_names}) - LIST(APPEND _deal_ii_code_gallery_tooltip +foreach(_gallery ${_code_gallery_names}) + list(APPEND _deal_ii_code_gallery_tooltip ${_gallery}/doc/tooltip) -ENDFOREACH() +endforeach() file(GLOB _deal_ii_steps_kind ${CMAKE_SOURCE_DIR}/examples/step-*/doc/kind ) file(GLOB _deal_ii_steps_buildson ${CMAKE_SOURCE_DIR}/examples/step-*/doc/builds-on ) -FOREACH(_gallery ${_code_gallery_names}) - LIST(APPEND _deal_ii_code_gallery_buildson +foreach(_gallery ${_code_gallery_names}) + list(APPEND _deal_ii_code_gallery_buildson ${_gallery}/doc/builds-on) -ENDFOREACH() +endforeach() -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tutorial.h COMMAND ${PERL_EXECUTABLE} ARGS @@ -99,21 +99,21 @@ ADD_CUSTOM_COMMAND( ${_deal_ii_code_gallery_tooltip} ${_deal_ii_code_gallery_buildson} ) -ADD_CUSTOM_TARGET(build_tutorial_h +add_custom_target(build_tutorial_h DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tutorial.h COMMENT "Building tutorial.h") -ADD_DEPENDENCIES(tutorial build_tutorial_h) +add_dependencies(tutorial build_tutorial_h) # # Prepare the steps for documentation generation # -FOREACH(_step ${_deal_ii_steps}) - GET_FILENAME_COMPONENT(_step "${_step}" NAME) +foreach(_step ${_deal_ii_steps}) + get_filename_component(_step "${_step}" NAME) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc COMMAND ${PERL_EXECUTABLE} ARGS @@ -126,7 +126,7 @@ FOREACH(_step ${_deal_ii_steps}) VERBATIM ) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h COMMAND ${PERL_EXECUTABLE} ARGS @@ -145,12 +145,12 @@ FOREACH(_step ${_deal_ii_steps}) ${CMAKE_SOURCE_DIR}/examples/${_step}/doc/results.dox ) - ADD_CUSTOM_TARGET(tutorial_${_step} + add_custom_target(tutorial_${_step} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_step}.h ${CMAKE_CURRENT_BINARY_DIR}/${_step}.cc COMMENT "Building doxygen input file for tutorial program <${_step}>" ) - ADD_DEPENDENCIES(tutorial tutorial_${_step}) -ENDFOREACH() + add_dependencies(tutorial tutorial_${_step}) +endforeach() diff --git a/doc/news/CMakeLists.txt b/doc/news/CMakeLists.txt index 17582f7360..9a71a62082 100644 --- a/doc/news/CMakeLists.txt +++ b/doc/news/CMakeLists.txt @@ -17,15 +17,15 @@ # # Set up all necessary bits for the changelog generation # -IF(DEAL_II_COMPONENT_DOCUMENTATION) +if(DEAL_II_COMPONENT_DOCUMENTATION) - MESSAGE(STATUS "") - MESSAGE(STATUS "Setting up changelog generation") + message(STATUS "") + message(STATUS "Setting up changelog generation") # # Generate changes.h. # - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/changes.h COMMAND ${CMAKE_COMMAND} -DOUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/changes.h -P ${CMAKE_CURRENT_SOURCE_DIR}/changes/create_changes_h.cmake @@ -41,10 +41,10 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION) ${CMAKE_CURRENT_SOURCE_DIR}/changes/incompatibilities ) - ADD_CUSTOM_TARGET(changelog ALL + add_custom_target(changelog ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/changes.h ) - ADD_DEPENDENCIES(documentation changelog) + add_dependencies(documentation changelog) -ENDIF(DEAL_II_COMPONENT_DOCUMENTATION) +endif(DEAL_II_COMPONENT_DOCUMENTATION) diff --git a/doc/news/changes/create_changes_h.cmake b/doc/news/changes/create_changes_h.cmake index 69081f1f3f..7d70ff0d79 100644 --- a/doc/news/changes/create_changes_h.cmake +++ b/doc/news/changes/create_changes_h.cmake @@ -14,36 +14,36 @@ ## --------------------------------------------------------------------- # Auxiliary functions -FUNCTION(CAT IN_FILE OUT_FILE INDENT) - FILE(READ ${IN_FILE} CONTENTS) - IF(${INDENT} MATCHES "TRUE") - FILE(STRINGS ${IN_FILE} LINESTMP) - FOREACH(LINETMP ${LINESTMP}) - FILE(APPEND ${OUT_FILE} " ${LINETMP}\n") - ENDFOREACH() - ELSE() - FILE(APPEND ${OUT_FILE} "${CONTENTS}") - ENDIF() -ENDFUNCTION() +function(CAT IN_FILE OUT_FILE INDENT) + file(READ ${IN_FILE} CONTENTS) + if(${INDENT} MATCHES "TRUE") + file(STRINGS ${IN_FILE} LINESTMP) + foreach(LINETMP ${LINESTMP}) + file(APPEND ${OUT_FILE} " ${LINETMP}\n") + endforeach() + else() + file(APPEND ${OUT_FILE} "${CONTENTS}") + endif() +endfunction() -FUNCTION(PROCESS IN_DIR OUT_FILE) - FILE(APPEND ${OUT_FILE} "
    \n") - FILE(GLOB ENTRY_LIST ${IN_DIR}/[0-9]*) - LIST(SORT ENTRY_LIST) - LIST(REVERSE ENTRY_LIST) - FOREACH(ENTRY ${ENTRY_LIST}) - FILE(APPEND ${OUT_FILE} "\n
  1. \n") +function(PROCESS IN_DIR OUT_FILE) + file(APPEND ${OUT_FILE} "
      \n") + file(GLOB ENTRY_LIST ${IN_DIR}/[0-9]*) + list(SORT ENTRY_LIST) + list(REVERSE ENTRY_LIST) + foreach(ENTRY ${ENTRY_LIST}) + file(APPEND ${OUT_FILE} "\n
    1. \n") CAT(${ENTRY} ${OUT_FILE} "TRUE") - FILE(APPEND ${OUT_FILE} "
    2. \n") - ENDFOREACH() - FILE(APPEND ${OUT_FILE} "\n
    \n") -ENDFUNCTION() + file(APPEND ${OUT_FILE} "
  2. \n") + endforeach() + file(APPEND ${OUT_FILE} "\n
\n") +endfunction() # Generate 'changes.h'. # First, create a file 'changes.h.in' based on all changelog fragments. -SET(OUTPUT_FILE_TEMP "${OUTPUT_FILE}.in") -FILE(WRITE ${OUTPUT_FILE_TEMP} "") +set(OUTPUT_FILE_TEMP "${OUTPUT_FILE}.in") +file(WRITE ${OUTPUT_FILE_TEMP} "") CAT (${CMAKE_CURRENT_SOURCE_DIR}/header ${OUTPUT_FILE_TEMP} "FALSE") CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_incompatibilities @@ -63,5 +63,5 @@ CAT (${CMAKE_CURRENT_SOURCE_DIR}/footer # Copy it over to 'changes.h' but only touch the time stamp # if the file actually changed (this is what CONFIGURE_FILE does). -MESSAGE(STATUS "Generating changelog file: ${OUTPUT_FILE}") -CONFIGURE_FILE(${OUTPUT_FILE_TEMP} ${OUTPUT_FILE} COPYONLY) +message(STATUS "Generating changelog file: ${OUTPUT_FILE}") +configure_file(${OUTPUT_FILE_TEMP} ${OUTPUT_FILE} COPYONLY) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9171fb3ca2..f12009ea79 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,10 +13,10 @@ ## ## --------------------------------------------------------------------- -IF(DEAL_II_COMPONENT_EXAMPLES) - MESSAGE(STATUS "Setting up examples") +if(DEAL_II_COMPONENT_EXAMPLES) + message(STATUS "Setting up examples") - INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${DEAL_II_EXAMPLES_RELDIR} COMPONENT examples FILES_MATCHING @@ -47,51 +47,51 @@ IF(DEAL_II_COMPONENT_EXAMPLES) PATTERN "input/DTMB-5415_bulbous_bow.iges" # step-54 ) - IF(DEAL_II_COMPILE_EXAMPLES) + if(DEAL_II_COMPILE_EXAMPLES) # # Make sure that there are no deprecated functions used in the tutorials. # - STRIP_FLAG(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") + strip_flag(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations") # # Set up all executables: # - FILE(GLOB _steps + file(GLOB _steps ${CMAKE_CURRENT_SOURCE_DIR}/step-*/step-*.cc ${CMAKE_CURRENT_SOURCE_DIR}/step-*/step-*.cu) - FOREACH(_step ${_steps}) - GET_FILENAME_COMPONENT(_name ${_step} NAME_WE) - GET_FILENAME_COMPONENT(_directory ${_step} DIRECTORY) + foreach(_step ${_steps}) + get_filename_component(_name ${_step} NAME_WE) + get_filename_component(_directory ${_step} DIRECTORY) # # Extract dependency information from CMakeLists.txt file. # - SET(_setup FALSE) - IF(EXISTS "${_directory}/CMakeLists.txt") - FILE(STRINGS "${_directory}/CMakeLists.txt" _dependency_string + set(_setup FALSE) + if(EXISTS "${_directory}/CMakeLists.txt") + file(STRINGS "${_directory}/CMakeLists.txt" _dependency_string REGEX "^if.*DEAL_II.* # keep in one line$" ) - STRING(REPLACE "IF(" "" _dependency_string "${_dependency_string}") - STRING(REPLACE ") # keep in one line" "" _dependency_string "${_dependency_string}") - IF("${_dependency_string}" STREQUAL "") - SET(_setup TRUE) - ELSE() + string(REPLACE "if(" "" _dependency_string "${_dependency_string}") + string(REPLACE ") # keep in one line" "" _dependency_string "${_dependency_string}") + if("${_dependency_string}" STREQUAL "") + set(_setup TRUE) + else() # if the dependency string evaluates to TRUE then the example # CMakeLists.txt encounters a fatal error - we want the opposite logic # here so add a NOT. - EVALUATE_EXPRESSION(" - IF(NOT (${_dependency_string})) - SET(_setup TRUE) - ENDIF()") - ENDIF() - ENDIF() + evaluate_expression(" + if(NOT (${_dependency_string})) + set(_setup TRUE) + endif()") + endif() + endif() - IF(_setup) - FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) - ADD_EXECUTABLE(${_name}.${_build_lowercase} ${_step}) - DEAL_II_INSOURCE_SETUP_TARGET(${_name}.${_build_lowercase} ${_build}) - SET_TARGET_PROPERTIES(${_name}.${_build_lowercase} + if(_setup) + foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) + add_executable(${_name}.${_build_lowercase} ${_step}) + deal_ii_insource_setup_target(${_name}.${_build_lowercase} ${_build}) + set_target_properties(${_name}.${_build_lowercase} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) @@ -100,45 +100,45 @@ IF(DEAL_II_COMPONENT_EXAMPLES) # exectuble on installation, make sure that we add an additional # rpath to the library location as well: # - IF(CMAKE_INSTALL_RPATH_USE_LINK_PATH) - SET_TARGET_PROPERTIES(${_name}.${_build_lowercase} + if(CMAKE_INSTALL_RPATH_USE_LINK_PATH) + set_target_properties(${_name}.${_build_lowercase} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}" ) - ENDIF() + endif() - ADD_DEPENDENCIES(examples ${_name}.${_build_lowercase}) - INSTALL(TARGETS ${_name}.${_build_lowercase} + add_dependencies(examples ${_name}.${_build_lowercase}) + install(TARGETS ${_name}.${_build_lowercase} DESTINATION ${DEAL_II_EXAMPLES_RELDIR}/${_name} ) - ENDFOREACH() + endforeach() - ELSE() + else() - MESSAGE(STATUS " ${_name} - dependencies not satisfied") - ENDIF() + message(STATUS " ${_name} - dependencies not satisfied") + endif() - ENDFOREACH() + endforeach() # the same as above but for the examples folder - FILE(GLOB _steps + file(GLOB _steps ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/*.cc) - FOREACH(_step ${_steps}) - GET_FILENAME_COMPONENT(_name ${_step} NAME_WE) + foreach(_step ${_steps}) + get_filename_component(_name ${_step} NAME_WE) - FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) - ADD_EXECUTABLE(${_name}.${_build_lowercase} ${_step}) - DEAL_II_INSOURCE_SETUP_TARGET(${_name}.${_build_lowercase} ${_build}) + foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) + add_executable(${_name}.${_build_lowercase} ${_step}) + deal_ii_insource_setup_target(${_name}.${_build_lowercase} ${_build}) - SET_TARGET_PROPERTIES(${_name}.${_build_lowercase} + set_target_properties(${_name}.${_build_lowercase} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) - ENDFOREACH() - ENDFOREACH() - ENDIF() + endforeach() + endforeach() + endif() - MESSAGE(STATUS "Setting up examples - Done") + message(STATUS "Setting up examples - Done") -ENDIF() +endif() diff --git a/examples/step-1/CMakeLists.txt b/examples/step-1/CMakeLists.txt index ecb6fa4852..d69da84d90 100644 --- a/examples/step-1/CMakeLists.txt +++ b/examples/step-1/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-1") +set(TARGET "step-1") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-10/CMakeLists.txt b/examples/step-10/CMakeLists.txt index af3936fccc..2ff6ab07c4 100644 --- a/examples/step-10/CMakeLists.txt +++ b/examples/step-10/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-10") +set(TARGET "step-10") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-11/CMakeLists.txt b/examples/step-11/CMakeLists.txt index e2b0206cd7..e02608e593 100644 --- a/examples/step-11/CMakeLists.txt +++ b/examples/step-11/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-11") +set(TARGET "step-11") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-12/CMakeLists.txt b/examples/step-12/CMakeLists.txt index e3e47ce550..8b4606b2b6 100644 --- a/examples/step-12/CMakeLists.txt +++ b/examples/step-12/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-12") +set(TARGET "step-12") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-12b/CMakeLists.txt b/examples/step-12b/CMakeLists.txt index e5195ba21a..42fcc4f571 100644 --- a/examples/step-12b/CMakeLists.txt +++ b/examples/step-12b/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-12b") +set(TARGET "step-12b") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-13/CMakeLists.txt b/examples/step-13/CMakeLists.txt index fbe4c449bf..568ac7963f 100644 --- a/examples/step-13/CMakeLists.txt +++ b/examples/step-13/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-13") +set(TARGET "step-13") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-14/CMakeLists.txt b/examples/step-14/CMakeLists.txt index 60c67ac571..68a53b23cb 100644 --- a/examples/step-14/CMakeLists.txt +++ b/examples/step-14/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-14") +set(TARGET "step-14") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-15/CMakeLists.txt b/examples/step-15/CMakeLists.txt index 27f8699f54..ef2b16b849 100644 --- a/examples/step-15/CMakeLists.txt +++ b/examples/step-15/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-15") +set(TARGET "step-15") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-16/CMakeLists.txt b/examples/step-16/CMakeLists.txt index 63190c0e1d..0f732cfc21 100644 --- a/examples/step-16/CMakeLists.txt +++ b/examples/step-16/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-16") +set(TARGET "step-16") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-16b/CMakeLists.txt b/examples/step-16b/CMakeLists.txt index 23457043a9..7711717547 100644 --- a/examples/step-16b/CMakeLists.txt +++ b/examples/step-16b/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-16b") +set(TARGET "step-16b") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-17/CMakeLists.txt b/examples/step-17/CMakeLists.txt index dc2a79fe79..c8fd83acad 100644 --- a/examples/step-17/CMakeLists.txt +++ b/examples/step-17/CMakeLists.txt @@ -3,43 +3,43 @@ ## # Set the name of the project and target: -SET(TARGET "step-17") +set(TARGET "step-17") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF () +endif () # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_PETSC OR DEAL_II_PETSC_WITH_COMPLEX) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_PETSC OR DEAL_II_PETSC_WITH_COMPLEX) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_PETSC_WITH_COMPLEX = OFF @@ -48,8 +48,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_PETSC_WITH_COMPLEX = ${DEAL_II_PETSC_WITH_COMPLEX} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-18/CMakeLists.txt b/examples/step-18/CMakeLists.txt index 0f8ff76ea8..25db4b20d6 100644 --- a/examples/step-18/CMakeLists.txt +++ b/examples/step-18/CMakeLists.txt @@ -3,43 +3,43 @@ ## # Set the name of the project and target: -SET(TARGET "step-18") +set(TARGET "step-18") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF () +endif () # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_PETSC OR DEAL_II_PETSC_WITH_COMPLEX) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_PETSC OR DEAL_II_PETSC_WITH_COMPLEX) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MPI = ON DEAL_II_WITH_PETSC = ON @@ -50,8 +50,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_PETSC_WITH_COMPLEX = ${DEAL_II_PETSC_WITH_COMPLEX} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-19/CMakeLists.txt b/examples/step-19/CMakeLists.txt index 07e13d7a06..70480d5424 100644 --- a/examples/step-19/CMakeLists.txt +++ b/examples/step-19/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-19") +set(TARGET "step-19") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 QUIET +find_package(deal.II 9.5.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-2/CMakeLists.txt b/examples/step-2/CMakeLists.txt index 33b0b97acd..eea4a93a9e 100644 --- a/examples/step-2/CMakeLists.txt +++ b/examples/step-2/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-2") +set(TARGET "step-2") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-20/CMakeLists.txt b/examples/step-20/CMakeLists.txt index 96c0283073..6dff86b5d5 100644 --- a/examples/step-20/CMakeLists.txt +++ b/examples/step-20/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-20") +set(TARGET "step-20") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-21/CMakeLists.txt b/examples/step-21/CMakeLists.txt index 5ea0ea0a83..6923d50d1b 100644 --- a/examples/step-21/CMakeLists.txt +++ b/examples/step-21/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-21") +set(TARGET "step-21") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-22/CMakeLists.txt b/examples/step-22/CMakeLists.txt index 9d6a493db8..7182acfa57 100644 --- a/examples/step-22/CMakeLists.txt +++ b/examples/step-22/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-22") +set(TARGET "step-22") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-23/CMakeLists.txt b/examples/step-23/CMakeLists.txt index a0c564d192..ec05609349 100644 --- a/examples/step-23/CMakeLists.txt +++ b/examples/step-23/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-23") +set(TARGET "step-23") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-24/CMakeLists.txt b/examples/step-24/CMakeLists.txt index 87770c7e15..7ad7c26f5d 100644 --- a/examples/step-24/CMakeLists.txt +++ b/examples/step-24/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-24") +set(TARGET "step-24") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-25/CMakeLists.txt b/examples/step-25/CMakeLists.txt index d607e18e0f..1bb24ecc8c 100644 --- a/examples/step-25/CMakeLists.txt +++ b/examples/step-25/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-25") +set(TARGET "step-25") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-26/CMakeLists.txt b/examples/step-26/CMakeLists.txt index a168e83b56..cee6621f5d 100644 --- a/examples/step-26/CMakeLists.txt +++ b/examples/step-26/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-26") +set(TARGET "step-26") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-27/CMakeLists.txt b/examples/step-27/CMakeLists.txt index e7400ecaf4..d6a675a50e 100644 --- a/examples/step-27/CMakeLists.txt +++ b/examples/step-27/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-27") +set(TARGET "step-27") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-28/CMakeLists.txt b/examples/step-28/CMakeLists.txt index dd3cda3f29..d28ada0310 100644 --- a/examples/step-28/CMakeLists.txt +++ b/examples/step-28/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-28") +set(TARGET "step-28") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-29/CMakeLists.txt b/examples/step-29/CMakeLists.txt index 8f354b9ed4..7b30f82463 100644 --- a/examples/step-29/CMakeLists.txt +++ b/examples/step-29/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-29") +set(TARGET "step-29") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-3/CMakeLists.txt b/examples/step-3/CMakeLists.txt index 4a188060d5..4427d29068 100644 --- a/examples/step-3/CMakeLists.txt +++ b/examples/step-3/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-3") +set(TARGET "step-3") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-30/CMakeLists.txt b/examples/step-30/CMakeLists.txt index 29b1634a56..589555e824 100644 --- a/examples/step-30/CMakeLists.txt +++ b/examples/step-30/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-30") +set(TARGET "step-30") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-31/CMakeLists.txt b/examples/step-31/CMakeLists.txt index 763c5bd0b8..02b9b69283 100644 --- a/examples/step-31/CMakeLists.txt +++ b/examples/step-31/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-31") +set(TARGET "step-31") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_TRILINOS = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-32/CMakeLists.txt b/examples/step-32/CMakeLists.txt index 6c7d0f68ef..14e98eb49a 100644 --- a/examples/step-32/CMakeLists.txt +++ b/examples/step-32/CMakeLists.txt @@ -3,45 +3,45 @@ ## # Set the name of the project and target: -SET(TARGET "step-32") +set(TARGET "step-32") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Define the output that should be cleaned: -SET(CLEAN_UP_FILES *.vtu *.pvtu *.visit) +set(CLEAN_UP_FILES *.vtu *.pvtu *.visit) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON @@ -52,8 +52,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-33/CMakeLists.txt b/examples/step-33/CMakeLists.txt index bc445aa416..93e0d84278 100644 --- a/examples/step-33/CMakeLists.txt +++ b/examples/step-33/CMakeLists.txt @@ -3,45 +3,45 @@ ## # Set the name of the project and target: -SET(TARGET "step-33") +set(TARGET "step-33") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # A custom command line to run the program -SET(TARGET_RUN ${TARGET} input.prm) +set(TARGET_RUN ${TARGET} input.prm) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_TRILINOS_WITH_SACADO OR NOT DEAL_II_WITH_MUPARSER) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_TRILINOS_WITH_SACADO OR NOT DEAL_II_WITH_MUPARSER) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MUPARSER = ON DEAL_II_TRILINOS_WITH_SACADO = ON @@ -50,8 +50,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_TRILINOS_WITH_SACADO = ${DEAL_II_TRILINOS_WITH_SACADO} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-34/CMakeLists.txt b/examples/step-34/CMakeLists.txt index 73eccf5dd9..bc3d29e8a4 100644 --- a/examples/step-34/CMakeLists.txt +++ b/examples/step-34/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-34") +set(TARGET "step-34") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MUPARSER) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MUPARSER) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MUPARSER = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_MUPARSER = ${DEAL_II_WITH_MUPARSER} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-35/CMakeLists.txt b/examples/step-35/CMakeLists.txt index 5566a6874f..229d44196e 100644 --- a/examples/step-35/CMakeLists.txt +++ b/examples/step-35/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-35") +set(TARGET "step-35") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-36/CMakeLists.txt b/examples/step-36/CMakeLists.txt index 4ff815e0f3..f8eb57fac7 100644 --- a/examples/step-36/CMakeLists.txt +++ b/examples/step-36/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-36") +set(TARGET "step-36") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_SLEPC OR DEAL_II_PETSC_WITH_COMPLEX) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_SLEPC OR DEAL_II_PETSC_WITH_COMPLEX) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_WITH_SLEPC = ON @@ -49,8 +49,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_PETSC_WITH_COMPLEX = ${DEAL_II_PETSC_WITH_COMPLEX} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-37/CMakeLists.txt b/examples/step-37/CMakeLists.txt index ab2dd87fae..6c11c9d8c5 100644 --- a/examples/step-37/CMakeLists.txt +++ b/examples/step-37/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-37") +set(TARGET "step-37") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_LAPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_LAPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_LAPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_LAPACK = ${DEAL_II_WITH_LAPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-38/CMakeLists.txt b/examples/step-38/CMakeLists.txt index c5943c5193..603fb9db41 100644 --- a/examples/step-38/CMakeLists.txt +++ b/examples/step-38/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-38") +set(TARGET "step-38") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-39/CMakeLists.txt b/examples/step-39/CMakeLists.txt index 9a97569a7f..1690ebf40f 100644 --- a/examples/step-39/CMakeLists.txt +++ b/examples/step-39/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-39") +set(TARGET "step-39") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-4/CMakeLists.txt b/examples/step-4/CMakeLists.txt index afab7bf669..25d74b7470 100644 --- a/examples/step-4/CMakeLists.txt +++ b/examples/step-4/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-4") +set(TARGET "step-4") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-40/CMakeLists.txt b/examples/step-40/CMakeLists.txt index 23dddc5fc8..64b27cfda1 100644 --- a/examples/step-40/CMakeLists.txt +++ b/examples/step-40/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-40") +set(TARGET "step-40") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_PETSC_WITH_COMPLEX = OFF @@ -54,9 +54,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these This conflicts with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-41/CMakeLists.txt b/examples/step-41/CMakeLists.txt index 913f189c02..74e20d7d08 100644 --- a/examples/step-41/CMakeLists.txt +++ b/examples/step-41/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-41") +set(TARGET "step-41") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_TRILINOS = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-42/CMakeLists.txt b/examples/step-42/CMakeLists.txt index 76cd34cbf8..d7bd147119 100644 --- a/examples/step-42/CMakeLists.txt +++ b/examples/step-42/CMakeLists.txt @@ -3,45 +3,45 @@ ## # Set the name of the project and target: -SET(TARGET "step-42") +set(TARGET "step-42") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Define the output that should be cleaned: -SET(CLEAN_UP_FILES *.vtu *.pvtu *.visit) +set(CLEAN_UP_FILES *.vtu *.pvtu *.visit) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON @@ -52,9 +52,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) +deal_ii_initialize_cached_variables() +project(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_invoke_autopilot() diff --git a/examples/step-43/CMakeLists.txt b/examples/step-43/CMakeLists.txt index 34d26a252a..6a39b0f003 100644 --- a/examples/step-43/CMakeLists.txt +++ b/examples/step-43/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-43") +set(TARGET "step-43") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_TRILINOS = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-44/CMakeLists.txt b/examples/step-44/CMakeLists.txt index 5bae74d24a..36b1f6a27e 100644 --- a/examples/step-44/CMakeLists.txt +++ b/examples/step-44/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-44") +set(TARGET "step-44") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-45/CMakeLists.txt b/examples/step-45/CMakeLists.txt index 4ec820a708..6b260ef794 100644 --- a/examples/step-45/CMakeLists.txt +++ b/examples/step-45/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-45") +set(TARGET "step-45") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON @@ -49,8 +49,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-46/CMakeLists.txt b/examples/step-46/CMakeLists.txt index 13a6691737..6a33819006 100644 --- a/examples/step-46/CMakeLists.txt +++ b/examples/step-46/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-46") +set(TARGET "step-46") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-47/CMakeLists.txt b/examples/step-47/CMakeLists.txt index 4e54919e34..1821160b46 100644 --- a/examples/step-47/CMakeLists.txt +++ b/examples/step-47/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-47") +set(TARGET "step-47") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-48/CMakeLists.txt b/examples/step-48/CMakeLists.txt index d9a142b47f..e6b2560fdc 100644 --- a/examples/step-48/CMakeLists.txt +++ b/examples/step-48/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-48") +set(TARGET "step-48") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-49/CMakeLists.txt b/examples/step-49/CMakeLists.txt index b76d2005c7..c7d88d3a1a 100644 --- a/examples/step-49/CMakeLists.txt +++ b/examples/step-49/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-49") +set(TARGET "step-49") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-5/CMakeLists.txt b/examples/step-5/CMakeLists.txt index 2a906d1831..66a345a897 100644 --- a/examples/step-5/CMakeLists.txt +++ b/examples/step-5/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-5") +set(TARGET "step-5") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-50/CMakeLists.txt b/examples/step-50/CMakeLists.txt index c5b4e52a32..5d94ab41cc 100644 --- a/examples/step-50/CMakeLists.txt +++ b/examples/step-50/CMakeLists.txt @@ -3,45 +3,45 @@ ## # Set the name of the project and target: -SET(TARGET "step-50") +set(TARGET "step-50") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Define the output that should be cleaned: -SET(CLEAN_UP_FILES *.vtu *.pvtu *.visit) +set(CLEAN_UP_FILES *.vtu *.pvtu *.visit) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_PETSC_WITH_COMPLEX = OFF @@ -57,8 +57,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these This conflicts with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-51/CMakeLists.txt b/examples/step-51/CMakeLists.txt index a4a2a97879..f206490c18 100644 --- a/examples/step-51/CMakeLists.txt +++ b/examples/step-51/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-51") +set(TARGET "step-51") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-52/CMakeLists.txt b/examples/step-52/CMakeLists.txt index c67c3ce04e..f8e614ba25 100644 --- a/examples/step-52/CMakeLists.txt +++ b/examples/step-52/CMakeLists.txt @@ -3,53 +3,53 @@ ## # Set the name of the project and target: -SET(TARGET "step-52") +set(TARGET "step-52") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Define the output that should be cleaned: -SET(CLEAN_UP_FILES *.vtu) +set(CLEAN_UP_FILES *.vtu) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-53/CMakeLists.txt b/examples/step-53/CMakeLists.txt index acff42a9e7..9a7e2853aa 100644 --- a/examples/step-53/CMakeLists.txt +++ b/examples/step-53/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-53") +set(TARGET "step-53") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_ZLIB) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_ZLIB) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_ZLIB = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_ZLIB = ${DEAL_II_WITH_ZLIB} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-54/CMakeLists.txt b/examples/step-54/CMakeLists.txt index 94cb9ae51a..f768662c44 100644 --- a/examples/step-54/CMakeLists.txt +++ b/examples/step-54/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-54") +set(TARGET "step-54") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_OPENCASCADE) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_OPENCASCADE) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_OPENCASCADE = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_OPENCASCADE = ${DEAL_II_WITH_OPENCASCADE} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-55/CMakeLists.txt b/examples/step-55/CMakeLists.txt index 89006eb627..0ed249fa78 100644 --- a/examples/step-55/CMakeLists.txt +++ b/examples/step-55/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-55") +set(TARGET "step-55") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_PETSC_WITH_COMPLEX = OFF @@ -54,9 +54,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these This conflicts with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-56/CMakeLists.txt b/examples/step-56/CMakeLists.txt index f1b16cc349..3934181f0d 100644 --- a/examples/step-56/CMakeLists.txt +++ b/examples/step-56/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-56") +set(TARGET "step-56") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-57/CMakeLists.txt b/examples/step-57/CMakeLists.txt index 31b871a6c8..99105edc50 100644 --- a/examples/step-57/CMakeLists.txt +++ b/examples/step-57/CMakeLists.txt @@ -3,51 +3,51 @@ ## # Set the name of the project and target: -SET(TARGET "step-57") +set(TARGET "step-57") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-58/CMakeLists.txt b/examples/step-58/CMakeLists.txt index a7d146f094..89447d4052 100644 --- a/examples/step-58/CMakeLists.txt +++ b/examples/step-58/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-58") +set(TARGET "step-58") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT (DEAL_II_WITH_UMFPACK AND DEAL_II_WITH_COMPLEX_VALUES)) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT (DEAL_II_WITH_UMFPACK AND DEAL_II_WITH_COMPLEX_VALUES)) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON DEAL_II_WITH_COMPLEX_VALUES = ON @@ -47,9 +47,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_COMPLEX_VALUES = ${DEAL_II_WITH_COMPLEX_VALUES} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-59/CMakeLists.txt b/examples/step-59/CMakeLists.txt index f8323a5fb5..bdf7bc8d1d 100644 --- a/examples/step-59/CMakeLists.txt +++ b/examples/step-59/CMakeLists.txt @@ -3,50 +3,50 @@ ## # Set the name of the project and target: -SET(TARGET "step-59") +set(TARGET "step-59") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_LAPACK) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_LAPACK) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_LAPACK = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_LAPACK = ${DEAL_II_WITH_LAPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-6/CMakeLists.txt b/examples/step-6/CMakeLists.txt index e5a6337866..b2b74a0ef0 100644 --- a/examples/step-6/CMakeLists.txt +++ b/examples/step-6/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-6") +set(TARGET "step-6") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-60/CMakeLists.txt b/examples/step-60/CMakeLists.txt index cf0eed825e..acf7e0ff52 100644 --- a/examples/step-60/CMakeLists.txt +++ b/examples/step-60/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-60") +set(TARGET "step-60") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_UMFPACK OR NOT DEAL_II_WITH_MUPARSER) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_UMFPACK OR NOT DEAL_II_WITH_MUPARSER) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MUPARSER = ON DEAL_II_WITH_UMFPACK = ON @@ -47,9 +47,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_UMFPACK = ${DEAL_II_WITH_UMFPACK} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-61/CMakeLists.txt b/examples/step-61/CMakeLists.txt index d0abfdd1a0..363aec3255 100644 --- a/examples/step-61/CMakeLists.txt +++ b/examples/step-61/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-61") +set(TARGET "step-61") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-62/CMakeLists.txt b/examples/step-62/CMakeLists.txt index cadc1474b8..de6a67c841 100644 --- a/examples/step-62/CMakeLists.txt +++ b/examples/step-62/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-62") +set(TARGET "step-62") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT (DEAL_II_WITH_PETSC AND DEAL_II_PETSC_WITH_COMPLEX AND DEAL_II_WITH_P4EST AND DEAL_II_WITH_HDF5)) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT (DEAL_II_WITH_PETSC AND DEAL_II_PETSC_WITH_COMPLEX AND DEAL_II_WITH_P4EST AND DEAL_II_WITH_HDF5)) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_PETSC_WITH_COMPLEX = ON @@ -52,8 +52,8 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these This conflicts with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-63/CMakeLists.txt b/examples/step-63/CMakeLists.txt index 4448a22d0b..1add483558 100644 --- a/examples/step-63/CMakeLists.txt +++ b/examples/step-63/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-63") +set(TARGET "step-63") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-64/CMakeLists.txt b/examples/step-64/CMakeLists.txt index b133b03014..8c25348bea 100644 --- a/examples/step-64/CMakeLists.txt +++ b/examples/step-64/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-64") +set(TARGET "step-64") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.10) +cmake_minimum_required(VERSION 3.10) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_CUDA) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_CUDA) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON @@ -49,9 +49,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_CUDA = ${DEAL_II_WITH_CUDA} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-65/CMakeLists.txt b/examples/step-65/CMakeLists.txt index 84bc6f0639..6b69b95e85 100644 --- a/examples/step-65/CMakeLists.txt +++ b/examples/step-65/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-65") +set(TARGET "step-65") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-66/CMakeLists.txt b/examples/step-66/CMakeLists.txt index bb4c9661eb..40bda629d4 100644 --- a/examples/step-66/CMakeLists.txt +++ b/examples/step-66/CMakeLists.txt @@ -3,39 +3,39 @@ ## # Set the name of the project and target: -SET(TARGET "step-66") +set(TARGET "step-66") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 QUIET +find_package(deal.II 9.5.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -IF(NOT DEAL_II_WITH_LAPACK OR NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_LAPACK OR NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_LAPACK = ON DEAL_II_WITH_MPI = ON @@ -46,9 +46,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_P4EST = ${DEAL_II_WITH_P4EST} which conflict with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-67/CMakeLists.txt b/examples/step-67/CMakeLists.txt index 87b191963a..dc8e418473 100644 --- a/examples/step-67/CMakeLists.txt +++ b/examples/step-67/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-67") +set(TARGET "step-67") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-68/CMakeLists.txt b/examples/step-68/CMakeLists.txt index 24d9145503..cd5216c4e6 100644 --- a/examples/step-68/CMakeLists.txt +++ b/examples/step-68/CMakeLists.txt @@ -3,51 +3,51 @@ ## # Set the name of the project and target: -SET(TARGET "step-68") +set(TARGET "step-68") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 QUIET +find_package(deal.II 9.5.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_P4EST = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_P4EST = ${DEAL_II_WITH_P4EST} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-69/CMakeLists.txt b/examples/step-69/CMakeLists.txt index 1dad2e5956..388e9e3ee2 100644 --- a/examples/step-69/CMakeLists.txt +++ b/examples/step-69/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-69") +set(TARGET "step-69") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_MPI OR NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_MPI = ON DEAL_II_WITH_P4EST = ON @@ -47,9 +47,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_P4EST = ${DEAL_II_WITH_P4EST} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-7/CMakeLists.txt b/examples/step-7/CMakeLists.txt index aee54fb980..f44497b09c 100644 --- a/examples/step-7/CMakeLists.txt +++ b/examples/step-7/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-7") +set(TARGET "step-7") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-70/CMakeLists.txt b/examples/step-70/CMakeLists.txt index 9600cdbb2b..c166dea2ce 100644 --- a/examples/step-70/CMakeLists.txt +++ b/examples/step-70/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-70") +set(TARGET "step-70") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT ((DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) OR DEAL_II_WITH_TRILINOS) OR NOT DEAL_II_WITH_P4EST) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_PETSC = ON DEAL_II_PETSC_WITH_COMPLEX = OFF @@ -54,9 +54,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these This conflicts with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-71/CMakeLists.txt b/examples/step-71/CMakeLists.txt index ca6ab9b925..4fc5426859 100644 --- a/examples/step-71/CMakeLists.txt +++ b/examples/step-71/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-71") +set(TARGET "step-71") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 QUIET +find_package(deal.II 9.5.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT ((DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_SACADO) AND DEAL_II_WITH_SYMENGINE)) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT ((DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_SACADO) AND DEAL_II_WITH_SYMENGINE)) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_TRILINOS = ON DEAL_II_TRILINOS_WITH_SACADO = ON @@ -51,9 +51,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these which conflict with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-72/CMakeLists.txt b/examples/step-72/CMakeLists.txt index d8af480c26..8c06ea263c 100644 --- a/examples/step-72/CMakeLists.txt +++ b/examples/step-72/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-72") +set(TARGET "step-72") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 QUIET +find_package(deal.II 9.5.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT (DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_SACADO)) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT (DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_SACADO)) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_TRILINOS = ON DEAL_II_TRILINOS_WITH_SACADO = ON @@ -48,9 +48,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these which conflict with the requirements. One or both of the aforementioned combinations of prerequisites are not met by your installation, but at least one is required for this tutorial step." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-74/CMakeLists.txt b/examples/step-74/CMakeLists.txt index 5e0c188f7d..313380804a 100644 --- a/examples/step-74/CMakeLists.txt +++ b/examples/step-74/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-74") +set(TARGET "step-74") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-75/CMakeLists.txt b/examples/step-75/CMakeLists.txt index 5902164468..15c2fdbe53 100644 --- a/examples/step-75/CMakeLists.txt +++ b/examples/step-75/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-75") +set(TARGET "step-75") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_P4EST OR NOT DEAL_II_WITH_TRILINOS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_P4EST = ON DEAL_II_WITH_TRILINOS = ON @@ -47,9 +47,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_TRILINOS = ${DEAL_II_WITH_TRILINOS} which conflict with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.gmv *.gnuplot *.gpl *.eps *.pov *.vtk *.ucd *.d2 *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-76/CMakeLists.txt b/examples/step-76/CMakeLists.txt index d7e814188e..e2735090a5 100644 --- a/examples/step-76/CMakeLists.txt +++ b/examples/step-76/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-76") +set(TARGET "step-76") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-77/CMakeLists.txt b/examples/step-77/CMakeLists.txt index 748b88ce5d..e0822df683 100644 --- a/examples/step-77/CMakeLists.txt +++ b/examples/step-77/CMakeLists.txt @@ -3,47 +3,47 @@ ## # Set the name of the project and target: -SET(TARGET "step-77") +set(TARGET "step-77") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -IF(NOT DEAL_II_WITH_SUNDIALS) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT DEAL_II_WITH_SUNDIALS) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_SUNDIALS = ON However, the deal.II library found at ${DEAL_II_PATH} was configured with these options: DEAL_II_WITH_SUNDIALS = ${DEAL_II_WITH_SUNDIALS} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-78/CMakeLists.txt b/examples/step-78/CMakeLists.txt index 32b0236269..2b363c73dd 100644 --- a/examples/step-78/CMakeLists.txt +++ b/examples/step-78/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-78") +set(TARGET "step-78") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-79/CMakeLists.txt b/examples/step-79/CMakeLists.txt index 1081e883dc..bb68743e48 100644 --- a/examples/step-79/CMakeLists.txt +++ b/examples/step-79/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-79") +set(TARGET "step-79") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-8/CMakeLists.txt b/examples/step-8/CMakeLists.txt index 341b664de8..eec5979b0c 100644 --- a/examples/step-8/CMakeLists.txt +++ b/examples/step-8/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-8") +set(TARGET "step-8") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-81/CMakeLists.txt b/examples/step-81/CMakeLists.txt index d28e396a5a..511ad4f33f 100644 --- a/examples/step-81/CMakeLists.txt +++ b/examples/step-81/CMakeLists.txt @@ -3,42 +3,42 @@ ## # Set the name of the project and target: -SET(TARGET "step-81") +set(TARGET "step-81") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.1.0) -FIND_PACKAGE(deal.II 9.2.0 +find_package(deal.II 9.2.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() # # Are all dependencies fulfilled? # -IF(NOT (DEAL_II_WITH_UMFPACK AND DEAL_II_WITH_COMPLEX_VALUES)) # keep in one line - MESSAGE(FATAL_ERROR " +if(NOT (DEAL_II_WITH_UMFPACK AND DEAL_II_WITH_COMPLEX_VALUES)) # keep in one line + message(FATAL_ERROR " Error! This tutorial requires a deal.II library that was configured with the following options: DEAL_II_WITH_UMFPACK = ON DEAL_II_WITH_COMPLEX_VALUES = ON @@ -47,9 +47,9 @@ However, the deal.II library found at ${DEAL_II_PATH} was configured with these DEAL_II_WITH_COMPLEX_VALUES = ${DEAL_II_WITH_COMPLEX_VALUES} This conflicts with the requirements." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -SET(CLEAN_UP_FILES *.log *.vtu *.pvtu) -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +set(CLEAN_UP_FILES *.log *.vtu *.pvtu) +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-82/CMakeLists.txt b/examples/step-82/CMakeLists.txt index 39ba4b6edc..912f9f870b 100644 --- a/examples/step-82/CMakeLists.txt +++ b/examples/step-82/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-82") +set(TARGET "step-82") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-85/CMakeLists.txt b/examples/step-85/CMakeLists.txt index 34558a7eca..997f33b77d 100644 --- a/examples/step-85/CMakeLists.txt +++ b/examples/step-85/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-85") +set(TARGET "step-85") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/examples/step-9/CMakeLists.txt b/examples/step-9/CMakeLists.txt index 5d9bc59cbd..eea0c4a350 100644 --- a/examples/step-9/CMakeLists.txt +++ b/examples/step-9/CMakeLists.txt @@ -3,37 +3,37 @@ ## # Set the name of the project and target: -SET(TARGET "step-9") +set(TARGET "step-9") # Declare all source files the target consists of. Here, this is only # the one step-X.cc file, but as you expand your project you may wish # to add other source files as well. If your project becomes much larger, # you may want to either replace the following statement by something like -# FILE(GLOB_RECURSE TARGET_SRC "source/*.cc") -# FILE(GLOB_RECURSE TARGET_INC "include/*.h") -# SET(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) +# file(GLOB_RECURSE TARGET_SRC "source/*.cc") +# file(GLOB_RECURSE TARGET_INC "include/*.h") +# set(TARGET_SRC ${TARGET_SRC} ${TARGET_INC}) # or switch altogether to the large project CMakeLists.txt file discussed # in the "CMake in user projects" page accessible from the "User info" # page of the documentation. -SET(TARGET_SRC +set(TARGET_SRC ${TARGET}.cc ) # Usually, you will not need to modify anything beyond this point... -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -FIND_PACKAGE(deal.II 9.5.0 +find_package(deal.II 9.5.0 HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" +if(NOT ${deal.II_FOUND}) + message(FATAL_ERROR "\n" "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n" "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" "or set an environment variable \"DEAL_II_DIR\" that contains this path." ) -ENDIF() +endif() -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() +deal_ii_initialize_cached_variables() +project(${TARGET}) +deal_ii_invoke_autopilot() diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index fdb895fb17..e369991d66 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -16,11 +16,11 @@ # # Configure config.h and revision.h # -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/config.h ) -CONFIGURE_FILE( +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/revision.h.in ${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/revision.h ) @@ -28,7 +28,7 @@ CONFIGURE_FILE( # # Add a rule for how to install the header files: # -INSTALL(DIRECTORY deal.II +install(DIRECTORY deal.II DESTINATION ${DEAL_II_INCLUDE_RELDIR} COMPONENT library FILES_MATCHING PATTERN "*.h" @@ -37,7 +37,7 @@ INSTALL(DIRECTORY deal.II # # and don't forget to install all generated header files, too: # -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deal.II +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deal.II DESTINATION ${DEAL_II_INCLUDE_RELDIR} COMPONENT library FILES_MATCHING PATTERN "*.h" diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ee539b26b9..5302be899e 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -13,13 +13,13 @@ ## ## --------------------------------------------------------------------- -MESSAGE(STATUS "Setting up library") +message(STATUS "Setting up library") # # This happens surprisingly often: # -IF("${DEAL_II_PACKAGE_NAME}" STREQUAL "") - MESSAGE(FATAL_ERROR +if("${DEAL_II_PACKAGE_NAME}" STREQUAL "") + message(FATAL_ERROR "\nWrong source directory specified.\n" "You pointed cmake to the subdirectory \"source\" instead of the base " "directory (the one containing the file \"README.md\"). Make sure that " @@ -29,13 +29,13 @@ IF("${DEAL_II_PACKAGE_NAME}" STREQUAL "") " $ cmake [...options...] ../\n" "(path not ending in \".../source\")" ) -ENDIF() +endif() # # Compile the deal.II library # -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_BINARY_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/ ${DEAL_II_BUNDLED_INCLUDE_DIRS} @@ -51,46 +51,46 @@ INCLUDE_DIRECTORIES( # end of everything (e.g. numerics/vectors.cc takes several minutes to # compile...) # -ADD_SUBDIRECTORY(numerics) -ADD_SUBDIRECTORY(fe) -ADD_SUBDIRECTORY(dofs) -ADD_SUBDIRECTORY(lac) -ADD_SUBDIRECTORY(base) -ADD_SUBDIRECTORY(cgal) -ADD_SUBDIRECTORY(gmsh) -ADD_SUBDIRECTORY(grid) -ADD_SUBDIRECTORY(hp) -ADD_SUBDIRECTORY(multigrid) -ADD_SUBDIRECTORY(distributed) -ADD_SUBDIRECTORY(algorithms) -ADD_SUBDIRECTORY(integrators) -ADD_SUBDIRECTORY(matrix_free) -ADD_SUBDIRECTORY(meshworker) -ADD_SUBDIRECTORY(opencascade) -ADD_SUBDIRECTORY(particles) -ADD_SUBDIRECTORY(differentiation) -ADD_SUBDIRECTORY(physics) -ADD_SUBDIRECTORY(optimization/rol) -ADD_SUBDIRECTORY(non_matching) -ADD_SUBDIRECTORY(sundials) -ADD_SUBDIRECTORY(arborx) - -FOREACH(build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${build} build_lowercase) +add_subdirectory(numerics) +add_subdirectory(fe) +add_subdirectory(dofs) +add_subdirectory(lac) +add_subdirectory(base) +add_subdirectory(cgal) +add_subdirectory(gmsh) +add_subdirectory(grid) +add_subdirectory(hp) +add_subdirectory(multigrid) +add_subdirectory(distributed) +add_subdirectory(algorithms) +add_subdirectory(integrators) +add_subdirectory(matrix_free) +add_subdirectory(meshworker) +add_subdirectory(opencascade) +add_subdirectory(particles) +add_subdirectory(differentiation) +add_subdirectory(physics) +add_subdirectory(optimization/rol) +add_subdirectory(non_matching) +add_subdirectory(sundials) +add_subdirectory(arborx) + +foreach(build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${build} build_lowercase) # # Combine all ${build} OBJECT targets to a ${build} library: # - GET_PROPERTY(_objects GLOBAL PROPERTY DEAL_II_OBJECTS_${build}) + get_property(_objects GLOBAL PROPERTY DEAL_II_OBJECTS_${build}) - ADD_LIBRARY(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + add_library(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} dummy.cc # Workaround for a bug in the Xcode generator ${_objects} ) - ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}) + add_dependencies(library ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}) - SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + set_target_properties(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} PROPERTIES VERSION "${DEAL_II_PACKAGE_VERSION}" # @@ -108,14 +108,14 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) - IF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set_target_properties(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} PROPERTIES MACOSX_RPATH OFF BUILD_WITH_INSTALL_RPATH OFF INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}" ) - ENDIF() + endif() # Under Windows (MSVC) cmake will always generate multi-configuration # projects. When building on the command line with 'cmake --build .', @@ -125,8 +125,8 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) # so we just hard-wire the location here. We only really need to set static # lib locations for _DEBUG (no support for dynamic linking, _RELEASE will be # ignored), but we do it anyhow. - IF (DEAL_II_MSVC) - SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + if (DEAL_II_MSVC) + set_target_properties(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}" LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}" @@ -135,34 +135,34 @@ FOREACH(build ${DEAL_II_BUILD_TYPES}) LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${DEAL_II_LIBRARY_RELDIR}" RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${DEAL_II_EXECUTABLE_RELDIR}" ) - ENDIF() + endif() - TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + target_link_libraries(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} ${DEAL_II_LIBRARIES_${build}} ${DEAL_II_LIBRARIES} ) - FILE(MAKE_DIRECTORY + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR} ) - EXPORT(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + export(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} FILE ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake APPEND ) - INSTALL(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} + install(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} COMPONENT library EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} LIBRARY DESTINATION ${DEAL_II_LIBRARY_RELDIR} ARCHIVE DESTINATION ${DEAL_II_LIBRARY_RELDIR} ) -ENDFOREACH() +endforeach() -INSTALL(EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets +install(EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR} COMPONENT library ) -MESSAGE(STATUS "Setting up library - Done") +message(STATUS "Setting up library - Done") diff --git a/source/algorithms/CMakeLists.txt b/source/algorithms/CMakeLists.txt index 04b0bff6cb..d38d501474 100644 --- a/source/algorithms/CMakeLists.txt +++ b/source/algorithms/CMakeLists.txt @@ -13,21 +13,21 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src general_data_storage.cc operator.cc timestep_control.cc ) -SET(_inst +set(_inst operator.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/algorithms/*.h ) -DEAL_II_ADD_LIBRARY(obj_algorithms OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_algorithms "${_inst}") +deal_ii_add_library(obj_algorithms OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_algorithms "${_inst}") diff --git a/source/arborx/CMakeLists.txt b/source/arborx/CMakeLists.txt index fa08009cde..65c200bf58 100644 --- a/source/arborx/CMakeLists.txt +++ b/source/arborx/CMakeLists.txt @@ -13,19 +13,19 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src access_traits.cc ) -SET(_inst +set(_inst access_traits.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/arborx/*.h ) -DEAL_II_ADD_LIBRARY(obj_arborx OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_arborx "${_inst}") +deal_ii_add_library(obj_arborx OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_arborx "${_inst}") diff --git a/source/base/CMakeLists.txt b/source/base/CMakeLists.txt index 82000c1cc7..b9f07473ef 100644 --- a/source/base/CMakeLists.txt +++ b/source/base/CMakeLists.txt @@ -13,14 +13,14 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) # # All source/base files are sufficiently small that they may be added to the # unity build file (see the developer documentation on DEAL_II_UNITY_BUILD # for more information). # -SET(_unity_include_src +set(_unity_include_src auto_derivative_function.cc bounding_box.cc conditional_ostream.cc @@ -105,30 +105,30 @@ SET(_unity_include_src vectorization.cc ) -SET(_separate_src +set(_separate_src data_out_base.cc symmetric_tensor.cc ) # Add CUDA wrapper files -IF(DEAL_II_WITH_CUDA) - SET(_separate_src +if(DEAL_II_WITH_CUDA) + set(_separate_src ${_separate_src} cuda.cc partitioner_cuda.cc ) -ENDIF() +endif() # determined by profiling -SET(_n_includes_per_unity_file 29) +set(_n_includes_per_unity_file 29) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst bounding_box.inst.in data_out_base.inst.in function.inst.in @@ -152,11 +152,11 @@ SET(_inst time_stepping.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/base/*.h ) -DEAL_II_ADD_LIBRARY(obj_base OBJECT ${_src} ${_header} ${_inst} +deal_ii_add_library(obj_base OBJECT ${_src} ${_header} ${_inst} ${CMAKE_BINARY_DIR}/include/deal.II/base/config.h ) -EXPAND_INSTANTIATIONS(obj_base "${_inst}") +expand_instantiations(obj_base "${_inst}") diff --git a/source/cgal/CMakeLists.txt b/source/cgal/CMakeLists.txt index 3d16483339..c47b4e5bab 100644 --- a/source/cgal/CMakeLists.txt +++ b/source/cgal/CMakeLists.txt @@ -14,24 +14,24 @@ ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src surface_mesh.cc intersections.cc ) -SET(_inst +set(_inst surface_mesh.inst.in intersections.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/cgal/*.h ) -DEAL_II_ADD_LIBRARY(obj_cgal OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_cgal "${_inst}") +deal_ii_add_library(obj_cgal OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_cgal "${_inst}") diff --git a/source/differentiation/CMakeLists.txt b/source/differentiation/CMakeLists.txt index a1d894ae2e..c1672f813e 100644 --- a/source/differentiation/CMakeLists.txt +++ b/source/differentiation/CMakeLists.txt @@ -13,5 +13,5 @@ ## ## --------------------------------------------------------------------- -ADD_SUBDIRECTORY(ad) -ADD_SUBDIRECTORY(sd) +add_subdirectory(ad) +add_subdirectory(sd) diff --git a/source/differentiation/ad/CMakeLists.txt b/source/differentiation/ad/CMakeLists.txt index ad2996bf4a..92861074f7 100644 --- a/source/differentiation/ad/CMakeLists.txt +++ b/source/differentiation/ad/CMakeLists.txt @@ -13,16 +13,16 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src ad_drivers.cc ad_helpers.cc adolc_number_types.cc sacado_number_types.cc ) -SET(_inst +set(_inst ad_drivers.inst.in ad_drivers.inst1.in ad_drivers.inst2.in @@ -34,9 +34,9 @@ SET(_inst sacado_number_types.inst2.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/differentiation/ad/*.h ) -DEAL_II_ADD_LIBRARY(obj_differentiation_ad OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_differentiation_ad "${_inst}") +deal_ii_add_library(obj_differentiation_ad OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_differentiation_ad "${_inst}") diff --git a/source/differentiation/sd/CMakeLists.txt b/source/differentiation/sd/CMakeLists.txt index 380ffa0af8..5de96d1ca6 100644 --- a/source/differentiation/sd/CMakeLists.txt +++ b/source/differentiation/sd/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src symengine_math.cc symengine_number_types.cc symengine_number_visitor_internal.cc @@ -26,15 +26,15 @@ SET(_src symengine_utilities.cc ) -SET(_inst +set(_inst symengine_number_visitor_internal.inst.in symengine_optimizer.inst.in symengine_tensor_operations.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/differentiation/sd/*.h ) -DEAL_II_ADD_LIBRARY(obj_differentiation_sd OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_differentiation_sd "${_inst}") +deal_ii_add_library(obj_differentiation_sd OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_differentiation_sd "${_inst}") diff --git a/source/distributed/CMakeLists.txt b/source/distributed/CMakeLists.txt index 7754496a0e..1964c91bb8 100644 --- a/source/distributed/CMakeLists.txt +++ b/source/distributed/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src grid_refinement.cc cell_weights.cc cell_data_transfer.cc @@ -29,19 +29,19 @@ SET(_unity_include_src field_transfer.cc ) -SET(_separate_src +set(_separate_src ) # concatenate all unity inclusion files in one file -SET(_n_includes_per_unity_file 15) +set(_n_includes_per_unity_file 15) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst grid_refinement.inst.in cell_weights.inst.in cell_data_transfer.inst.in @@ -55,9 +55,9 @@ SET(_inst p4est_wrappers.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/distributed/*.h ) -DEAL_II_ADD_LIBRARY(obj_distributed OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_distributed "${_inst}") +deal_ii_add_library(obj_distributed OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_distributed "${_inst}") diff --git a/source/dofs/CMakeLists.txt b/source/dofs/CMakeLists.txt index 2fbdbb5ac5..14d583940a 100644 --- a/source/dofs/CMakeLists.txt +++ b/source/dofs/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src block_info.cc dof_faces.cc dof_handler.cc @@ -23,7 +23,7 @@ SET(_unity_include_src number_cache.cc ) -SET(_separate_src +set(_separate_src dof_accessor.cc dof_accessor_get.cc dof_accessor_set.cc @@ -35,15 +35,15 @@ SET(_separate_src ) # concatenate all unity inclusion files in one file -SET(_n_includes_per_unity_file 15) +set(_n_includes_per_unity_file 15) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst block_info.inst.in dof_accessor_get.inst.in dof_accessor.inst.in @@ -57,9 +57,9 @@ SET(_inst dof_tools_sparsity.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/dofs/*.h ) -DEAL_II_ADD_LIBRARY(obj_dofs OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_dofs "${_inst}") +deal_ii_add_library(obj_dofs OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_dofs "${_inst}") diff --git a/source/fe/CMakeLists.txt b/source/fe/CMakeLists.txt index c335b309e5..177a8c2df8 100644 --- a/source/fe/CMakeLists.txt +++ b/source/fe/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src block_mask.cc component_mask.cc fe_abf.cc @@ -67,7 +67,7 @@ SET(_unity_include_src mapping_manifold.cc ) -SET(_separate_src +set(_separate_src fe_values.cc fe_values_inst2.cc fe_values_inst3.cc @@ -84,15 +84,15 @@ SET(_separate_src ) # determined by profiling -SET(_n_includes_per_unity_file 10) +set(_n_includes_per_unity_file 10) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst fe_abf.inst.in fe_bdm.inst.in fe_bernstein.inst.in @@ -144,9 +144,9 @@ SET(_inst mapping_manifold.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/fe/*.h ) -DEAL_II_ADD_LIBRARY(obj_fe OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_fe "${_inst}") +deal_ii_add_library(obj_fe OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_fe "${_inst}") diff --git a/source/gmsh/CMakeLists.txt b/source/gmsh/CMakeLists.txt index 75cc1e8451..66d853f3a3 100644 --- a/source/gmsh/CMakeLists.txt +++ b/source/gmsh/CMakeLists.txt @@ -13,19 +13,19 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src utilities.cc ) -SET(_inst +set(_inst utilities.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/gmsh/*.h ) -DEAL_II_ADD_LIBRARY(obj_gmsh OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_gmsh "${_inst}") +deal_ii_add_library(obj_gmsh OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_gmsh "${_inst}") diff --git a/source/grid/CMakeLists.txt b/source/grid/CMakeLists.txt index 0d13509ef3..8dd189f274 100644 --- a/source/grid/CMakeLists.txt +++ b/source/grid/CMakeLists.txt @@ -13,7 +13,7 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) # # Work around an issue where gcc emits a note that the warning @@ -24,15 +24,15 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) # -Wno-misleading-indentation on the command line for the # grid_generator_cgal.cc compilation unit. # -IF(DEAL_II_WITH_CGAL) - ENABLE_IF_SUPPORTED(_flag "-Wno-misleading-indentation") - SET_PROPERTY(SOURCE "grid_generator_cgal.cc" +if(DEAL_II_WITH_CGAL) + enable_if_supported(_flag "-Wno-misleading-indentation") + set_property(SOURCE "grid_generator_cgal.cc" APPEND_STRING PROPERTY COMPILE_FLAGS " ${_flag}" ) -ENDIF() +endif() -SET(_unity_include_src +set(_unity_include_src cell_id.cc grid_refinement.cc grid_reordering.cc @@ -48,7 +48,7 @@ SET(_unity_include_src tria_objects.cc ) -SET(_separate_src +set(_separate_src grid_generator.cc grid_generator_cgal.cc grid_generator_from_name.cc @@ -63,15 +63,15 @@ SET(_separate_src ) # include all files in the unity file -SET(_n_includes_per_unity_file 20) +set(_n_includes_per_unity_file 20) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst cell_id.inst.in grid_generator_cgal.inst.in grid_generator_from_name.inst.in @@ -93,9 +93,9 @@ SET(_inst tria_objects.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/grid/*.h ) -DEAL_II_ADD_LIBRARY(obj_grid OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_grid "${_inst}") +deal_ii_add_library(obj_grid OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_grid "${_inst}") diff --git a/source/hp/CMakeLists.txt b/source/hp/CMakeLists.txt index 49fb57b821..0f310715af 100644 --- a/source/hp/CMakeLists.txt +++ b/source/hp/CMakeLists.txt @@ -13,37 +13,37 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src fe_collection.cc fe_values.cc mapping_collection.cc refinement.cc ) -SET(_separate_src +set(_separate_src ) # concatenate all unity inclusion files in one file -SET(_n_includes_per_unity_file 15) +set(_n_includes_per_unity_file 15) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst fe_collection.inst.in fe_values.inst.in mapping_collection.inst.in refinement.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/hp/*.h ) -DEAL_II_ADD_LIBRARY(obj_hp OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_hp "${_inst}") +deal_ii_add_library(obj_hp OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_hp "${_inst}") diff --git a/source/integrators/CMakeLists.txt b/source/integrators/CMakeLists.txt index 46b6789d0f..e0381dde06 100644 --- a/source/integrators/CMakeLists.txt +++ b/source/integrators/CMakeLists.txt @@ -13,13 +13,13 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/integrators/*.h ) -DEAL_II_ADD_LIBRARY(obj_integrators OBJECT ${_src} ${_header}) +deal_ii_add_library(obj_integrators OBJECT ${_src} ${_header}) diff --git a/source/lac/CMakeLists.txt b/source/lac/CMakeLists.txt index 3d907f8be1..b12138d840 100644 --- a/source/lac/CMakeLists.txt +++ b/source/lac/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src affine_constraints.cc block_sparse_matrix.cc block_sparse_matrix_ez.cc @@ -51,7 +51,7 @@ SET(_unity_include_src ) # make sure that files requiring the LAPACK wrappers are compiled separately. -SET(_separate_src +set(_separate_src full_matrix.cc lapack_full_matrix.cc qr.cc @@ -62,15 +62,15 @@ SET(_separate_src ) # Add CUDA wrapper files -IF(DEAL_II_WITH_CUDA) - SET(_separate_src +if(DEAL_II_WITH_CUDA) + set(_separate_src ${_separate_src} vector_memory_cuda.cc affine_constraints_cuda.cc ) -ENDIF() +endif() -SET(_inst +set(_inst affine_constraints.inst.in block_sparse_matrix.inst.in block_vector.inst.in @@ -97,8 +97,8 @@ SET(_inst # Add PETSc wrapper files. If PETSc has not been found, # then these files should be empty and there is no need # to even look at them -IF(DEAL_II_WITH_PETSC) - SET(_unity_include_src +if(DEAL_II_WITH_PETSC) + set(_unity_include_src ${_unity_include_src} petsc_full_matrix.cc petsc_matrix_base.cc @@ -112,27 +112,27 @@ IF(DEAL_II_WITH_PETSC) petsc_sparse_matrix.cc petsc_vector_base.cc ) -ENDIF() +endif() # Same for SLEPc -IF(DEAL_II_WITH_SLEPC) - SET(_unity_include_src +if(DEAL_II_WITH_SLEPC) + set(_unity_include_src ${_unity_include_src} slepc_solver.cc slepc_spectral_transformation.cc ) -ENDIF() +endif() -IF(DEAL_II_WITH_GINKGO) - SET(_unity_include_src +if(DEAL_II_WITH_GINKGO) + set(_unity_include_src ${_unity_include_src} ginkgo_solver.cc ) -ENDIF() +endif() # Also add Trilinos wrapper files -IF(DEAL_II_WITH_TRILINOS) - SET(_unity_include_src +if(DEAL_II_WITH_TRILINOS) + set(_unity_include_src ${_unity_include_src} trilinos_block_sparse_matrix.cc trilinos_block_vector.cc @@ -148,21 +148,21 @@ IF(DEAL_II_WITH_TRILINOS) trilinos_vector.cc ) - SET(_separate_src + set(_separate_src ${_separate_src} trilinos_precondition_muelu.cc ) - SET(_inst + set(_inst ${_inst} trilinos_sparse_matrix.inst.in trilinos_vector.inst.in ) -ENDIF() +endif() # Add CUDA wrapper files -IF(DEAL_II_WITH_CUDA) - SET(_separate_src +if(DEAL_II_WITH_CUDA) + set(_separate_src ${_separate_src} cuda_kernels.cc cuda_precondition.cc @@ -172,25 +172,25 @@ IF(DEAL_II_WITH_CUDA) la_parallel_vector_cuda.cc read_write_vector_cuda.cc ) -ENDIF() +endif() # determined by profiling -SET(_n_includes_per_unity_file 20) +set(_n_includes_per_unity_file 20) -IF(DEAL_II_UNITY_BUILD) +if(DEAL_II_UNITY_BUILD) # sort files so that the petsc and trilinos files are not together - LIST(SORT _unity_include_src) -ENDIF() + list(SORT _unity_include_src) +endif() -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/lac/*.h ) -DEAL_II_ADD_LIBRARY(obj_lac OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_lac "${_inst}") +deal_ii_add_library(obj_lac OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_lac "${_inst}") diff --git a/source/matrix_free/CMakeLists.txt b/source/matrix_free/CMakeLists.txt index 511a4c6fd9..4002f809d2 100644 --- a/source/matrix_free/CMakeLists.txt +++ b/source/matrix_free/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src dof_info.cc evaluation_template_factory.cc evaluation_template_factory_inst2.cc @@ -40,7 +40,7 @@ SET(_src vector_data_exchange.cc ) -SET(_inst +set(_inst evaluation_template_factory.inst.in evaluation_template_face_factory.inst.in evaluation_template_factory_hanging_nodes.inst.in @@ -50,19 +50,19 @@ SET(_inst shape_info.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/matrix_free/*.h ) -IF(DEAL_II_WITH_CUDA) - SET(_src +if(DEAL_II_WITH_CUDA) + set(_src cuda_matrix_free.cc ${_src} ) - SET(_inst + set(_inst ${_inst} ) -ENDIF() +endif() -DEAL_II_ADD_LIBRARY(obj_matrix_free OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_matrix_free "${_inst}") +deal_ii_add_library(obj_matrix_free OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_matrix_free "${_inst}") diff --git a/source/meshworker/CMakeLists.txt b/source/meshworker/CMakeLists.txt index 601bad051f..dd31a12d2a 100644 --- a/source/meshworker/CMakeLists.txt +++ b/source/meshworker/CMakeLists.txt @@ -13,24 +13,24 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src mesh_worker.cc mesh_worker_info.cc mesh_worker_vector_selector.cc scratch_data.cc ) -SET(_inst +set(_inst mesh_worker_info.inst.in mesh_worker_vector_selector.inst.in scratch_data.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/meshworker/*.h ) -DEAL_II_ADD_LIBRARY(obj_meshworker OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_meshworker "${_inst}") +deal_ii_add_library(obj_meshworker OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_meshworker "${_inst}") diff --git a/source/multigrid/CMakeLists.txt b/source/multigrid/CMakeLists.txt index dd7706fa86..bd11cf289f 100644 --- a/source/multigrid/CMakeLists.txt +++ b/source/multigrid/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src mg_base.cc mg_level_global_transfer.cc mg_transfer_block.cc @@ -26,21 +26,21 @@ SET(_unity_include_src multigrid.cc ) -SET(_separate_src +set(_separate_src mg_tools.cc mg_transfer_matrix_free.cc ) # concatenate all unity inclusion files in one file -SET(_n_includes_per_unity_file 15) +set(_n_includes_per_unity_file 15) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst mg_base.inst.in mg_level_global_transfer.inst.in mg_tools.inst.in @@ -53,9 +53,9 @@ SET(_inst multigrid.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/multigrid/*.h ) -DEAL_II_ADD_LIBRARY(obj_multigrid OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_multigrid "${_inst}") +deal_ii_add_library(obj_multigrid OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_multigrid "${_inst}") diff --git a/source/non_matching/CMakeLists.txt b/source/non_matching/CMakeLists.txt index ac2937a3cb..10385cb64a 100644 --- a/source/non_matching/CMakeLists.txt +++ b/source/non_matching/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src fe_immersed_values.cc fe_values.cc mesh_classifier.cc @@ -24,7 +24,7 @@ SET(_src immersed_surface_quadrature.cc ) - SET(_inst + set(_inst fe_immersed_values.inst.in fe_values.inst.in mesh_classifier.inst.in @@ -32,9 +32,9 @@ SET(_src coupling.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/non_matching/*.h ) -DEAL_II_ADD_LIBRARY(obj_non_matching OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_non_matching "${_inst}") +deal_ii_add_library(obj_non_matching OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_non_matching "${_inst}") diff --git a/source/numerics/CMakeLists.txt b/source/numerics/CMakeLists.txt index fe5df3f8fe..b3f277c35c 100644 --- a/source/numerics/CMakeLists.txt +++ b/source/numerics/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_unity_include_src +set(_unity_include_src data_out.cc data_out_faces.cc data_out_rotation.cc @@ -33,7 +33,7 @@ SET(_unity_include_src vector_tools_rhs.cc ) -SET(_separate_src +set(_separate_src cell_data_transfer.cc data_out_dof_data.cc data_out_dof_data_inst2.cc @@ -64,15 +64,15 @@ SET(_separate_src ) # determined by profiling -SET(_n_includes_per_unity_file 8) +set(_n_includes_per_unity_file 8) -SETUP_SOURCE_LIST("${_unity_include_src}" +setup_source_list("${_unity_include_src}" "${_separate_src}" ${_n_includes_per_unity_file} _src ) -SET(_inst +set(_inst cell_data_transfer.inst.in data_out_dof_data.inst.in data_out_dof_data_codim.inst.in @@ -108,9 +108,9 @@ SET(_inst vector_tools_rhs.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/numerics/*.h ) -DEAL_II_ADD_LIBRARY(obj_numerics OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_numerics "${_inst}") +deal_ii_add_library(obj_numerics OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_numerics "${_inst}") diff --git a/source/opencascade/CMakeLists.txt b/source/opencascade/CMakeLists.txt index 3fce7063f7..444da92ddf 100644 --- a/source/opencascade/CMakeLists.txt +++ b/source/opencascade/CMakeLists.txt @@ -13,21 +13,21 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src utilities.cc manifold_lib.cc ) -SET(_inst +set(_inst manifold_lib.inst.in utilities.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/opencascade/*.h ) -DEAL_II_ADD_LIBRARY(obj_opencascade OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_opencascade "${_inst}") +deal_ii_add_library(obj_opencascade OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_opencascade "${_inst}") diff --git a/source/optimization/rol/CMakeLists.txt b/source/optimization/rol/CMakeLists.txt index 1b93819841..4c08aa314d 100644 --- a/source/optimization/rol/CMakeLists.txt +++ b/source/optimization/rol/CMakeLists.txt @@ -13,17 +13,17 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src ) -SET(_inst +set(_inst ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/optimization/rol/*.h ) -DEAL_II_ADD_LIBRARY(obj_rol OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_rol "${_inst}") +deal_ii_add_library(obj_rol OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_rol "${_inst}") diff --git a/source/particles/CMakeLists.txt b/source/particles/CMakeLists.txt index b92cf37918..c01bc32183 100644 --- a/source/particles/CMakeLists.txt +++ b/source/particles/CMakeLists.txt @@ -14,9 +14,9 @@ ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src data_out.cc particle.cc particle_handler.cc @@ -25,7 +25,7 @@ SET(_src utilities.cc ) -SET(_inst +set(_inst data_out.inst.in particle.inst.in particle_handler.inst.in @@ -33,9 +33,9 @@ SET(_inst utilities.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/particles/*.h ) -DEAL_II_ADD_LIBRARY(obj_particle OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_particle "${_inst}") +deal_ii_add_library(obj_particle OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_particle "${_inst}") diff --git a/source/physics/CMakeLists.txt b/source/physics/CMakeLists.txt index 78c4589ab8..2288388548 100644 --- a/source/physics/CMakeLists.txt +++ b/source/physics/CMakeLists.txt @@ -14,21 +14,21 @@ ## --------------------------------------------------------------------- # Expand instantiations in subdirectories -ADD_SUBDIRECTORY("elasticity") +add_subdirectory("elasticity") -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src transformations.cc ) -SET(_inst +set(_inst transformations.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/physics/*.h ) -DEAL_II_ADD_LIBRARY(obj_physics OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_physics "${_inst}") +deal_ii_add_library(obj_physics OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_physics "${_inst}") diff --git a/source/physics/elasticity/CMakeLists.txt b/source/physics/elasticity/CMakeLists.txt index c9803576cc..e1774024a5 100644 --- a/source/physics/elasticity/CMakeLists.txt +++ b/source/physics/elasticity/CMakeLists.txt @@ -14,21 +14,21 @@ ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src kinematics.cc standard_tensors.cc ) -SET(_inst +set(_inst kinematics.inst.in standard_tensors.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/physics/elasticity/*.h ) -DEAL_II_ADD_LIBRARY(obj_physics_elasticity OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_physics_elasticity "${_inst}") +deal_ii_add_library(obj_physics_elasticity OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_physics_elasticity "${_inst}") diff --git a/source/sundials/CMakeLists.txt b/source/sundials/CMakeLists.txt index 35458673a3..06b4d08143 100644 --- a/source/sundials/CMakeLists.txt +++ b/source/sundials/CMakeLists.txt @@ -13,9 +13,9 @@ ## ## --------------------------------------------------------------------- -INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) -SET(_src +set(_src arkode.cc ida.cc copy.cc @@ -24,13 +24,13 @@ SET(_src sunlinsol_wrapper.cc ) -SET(_inst +set(_inst n_vector.inst.in ) -FILE(GLOB _header +file(GLOB _header ${CMAKE_SOURCE_DIR}/include/deal.II/sundials/*.h ) -DEAL_II_ADD_LIBRARY(obj_sundials OBJECT ${_src} ${_header} ${_inst}) -EXPAND_INSTANTIATIONS(obj_sundials "${_inst}") +deal_ii_add_library(obj_sundials OBJECT ${_src} ${_header} ${_inst}) +expand_instantiations(obj_sundials "${_inst}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e6c1b79053..9484516605 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,172 +21,172 @@ # prune_tests - remove all testsuite subprojects # -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.3.0) -MACRO(SET_IF_EMPTY _variable) - IF("${${_variable}}" STREQUAL "") - SET(${_variable} ${ARGN}) - ENDIF() -ENDMACRO() +macro(SET_IF_EMPTY _variable) + if("${${_variable}}" STREQUAL "") + set(${_variable} ${ARGN}) + endif() +endmacro() -SET_IF_EMPTY(MAKEOPTS $ENV{MAKEOPTS}) -SET_IF_EMPTY(DEAL_II_DIR $ENV{DEAL_II_DIR}) +set_if_empty(MAKEOPTS $ENV{MAKEOPTS}) +set_if_empty(DEAL_II_DIR $ENV{DEAL_II_DIR}) # # A bit of necessary setup if tests are configured as a stand-alone # project: # -IF(NOT DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) - FIND_PACKAGE(deal.II 9.3.0 REQUIRED HINTS ${DEAL_II_DIR}) - DEAL_II_INITIALIZE_CACHED_VARIABLES() - PROJECT(TESTSUITE CXX) - FILE(WRITE ${CMAKE_BINARY_DIR}/detailed.log +if(NOT DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) + find_package(deal.II 9.3.0 REQUIRED HINTS ${DEAL_II_DIR}) + deal_ii_initialize_cached_variables() + project(TESTSUITE CXX) + file(WRITE ${CMAKE_BINARY_DIR}/detailed.log "# CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} on platform ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}" ) -ENDIF() +endif() # # A bit of necessary setup if tests are included via ADD_SUBDIRECTORY from # the top-level CMake project: # -IF(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) +if(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) # # We have to repeat the policy statement here because the new # CMAKE_MINIMUM_REQUIRED call resets our previous policy set in the main # CMakeLists.txt file. # - IF("${CMAKE_VERSION}" VERSION_LESS "3.11" AND POLICY CMP0037) + if("${CMAKE_VERSION}" VERSION_LESS "3.11" AND POLICY CMP0037) # allow to override "test" target for quick tests - CMAKE_POLICY(SET CMP0037 OLD) - ENDIF() + cmake_policy(SET CMP0037 OLD) + endif() # # If this CMakeLists.txt file is called from within the deal.II build # system, set up quick tests as well: # - ADD_SUBDIRECTORY(quick_tests) + add_subdirectory(quick_tests) - MESSAGE(STATUS "Setting up testsuite") + message(STATUS "Setting up testsuite") # # Write minimalistic CTestTestfile.cmake files to CMAKE_BINARY_DIR and # CMAKE_BINARY_DIR/tests: # - FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "SUBDIRS(tests)\n") + file(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "subdirs(tests)\n") - SET(_options "-DDEAL_II_DIR=${CMAKE_BINARY_DIR}") + set(_options "-DDEAL_II_DIR=${CMAKE_BINARY_DIR}") -ELSE() +else() - MESSAGE(STATUS "This is CMake ${CMAKE_VERSION}") - MESSAGE(STATUS "") + message(STATUS "This is CMake ${CMAKE_VERSION}") + message(STATUS "") - IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - MESSAGE(FATAL_ERROR "The testsuite cannot be configured in-source. " + if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + message(FATAL_ERROR "The testsuite cannot be configured in-source. " "Please create a separate build directory!" ) - ENDIF() + endif() - FIND_PACKAGE(deal.II 9.3.0 REQUIRED HINTS ${DEAL_II_DIR} $ENV{DEAL_II_DIR}) - PROJECT(testsuite NONE) - SET(_options "-DDEAL_II_DIR=${DEAL_II_PATH}") -ENDIF() + find_package(deal.II 9.3.0 REQUIRED HINTS ${DEAL_II_DIR} $ENV{DEAL_II_DIR}) + project(testsuite NONE) + set(_options "-DDEAL_II_DIR=${DEAL_II_PATH}") +endif() -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "") # # Always undefine the following variables in the setup_tests target: # -FOREACH(_var +foreach(_var DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT TEST_MPI_RANK_LIMIT TEST_THREAD_LIMIT ENABLE_PERFORMANCE_TESTS TESTING_ENVIRONMENT ) - LIST(APPEND _options "-U${_var}") - IF(NOT "${${_var}}" STREQUAL "") - LIST(APPEND _options "-D${_var}=${${_var}}") - ENDIF() -ENDFOREACH() + list(APPEND _options "-U${_var}") + if(NOT "${${_var}}" STREQUAL "") + list(APPEND _options "-D${_var}=${${_var}}") + endif() +endforeach() # # Find all testsuite subprojects, i.e., every directory that contains a # CMakeLists.txt file (with the exception of "quick_tests"). # -SET(_categories) -FILE(GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} +set(_categories) +file(GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/* ) -FOREACH(_dir ${_dirs}) - IF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt AND +foreach(_dir ${_dirs}) + if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt AND NOT ${_dir} MATCHES quick_tests) - LIST(APPEND _categories ${_dir}) - ENDIF() -ENDFOREACH() + list(APPEND _categories ${_dir}) + endif() +endforeach() # # Custom targets for the testsuite: # # Setup tests: -ADD_CUSTOM_TARGET(setup_tests) +add_custom_target(setup_tests) # Remove all tests: -ADD_CUSTOM_TARGET(prune_tests) +add_custom_target(prune_tests) -FOREACH(_category ${_categories}) - SET(_category_dir ${CMAKE_CURRENT_SOURCE_DIR}/${_category}) +foreach(_category ${_categories}) + set(_category_dir ${CMAKE_CURRENT_SOURCE_DIR}/${_category}) - FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_category}) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_category}) - IF(DEAL_II_MSVC) - SET(_command ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir}) - ELSE() + if(DEAL_II_MSVC) + set(_command ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir}) + else() # Do not pass the generator with -G so that we use make instead of ninja # for the test projects. This is because calling ninja several times in # parallel for the same project will break the configuration. - SET(_command ${CMAKE_COMMAND} ${_options} ${_category_dir} > /dev/null) - ENDIF() + set(_command ${CMAKE_COMMAND} ${_options} ${_category_dir} > /dev/null) + endif() - ADD_CUSTOM_TARGET(setup_tests_${_category} + add_custom_target(setup_tests_${_category} COMMAND ${_command} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_category} COMMENT "Processing tests/${_category}" ) - ADD_DEPENDENCIES(setup_tests setup_tests_${_category}) + add_dependencies(setup_tests setup_tests_${_category}) - ADD_CUSTOM_TARGET(prune_tests_${_category} + add_custom_target(prune_tests_${_category} COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/${_category} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${_category} COMMENT "Processing tests/${_category}" ) - ADD_DEPENDENCIES(prune_tests prune_tests_${_category}) + add_dependencies(prune_tests prune_tests_${_category}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake - "SUBDIRS(${_category})\n" + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake + "subdirs(${_category})\n" ) -ENDFOREACH() +endforeach() -IF(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) +if(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY) # # Add a dummy target to make files known to IDEs like qtcreator # - FILE(GLOB _misc + file(GLOB _misc ${CMAKE_CURRENT_SOURCE_DIR}/*.cc ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*/*.cc ${CMAKE_CURRENT_SOURCE_DIR}/*/*.h ) - ADD_CUSTOM_TARGET(dummy_tests_files + add_custom_target(dummy_tests_files SOURCES ${_misc} ) - MESSAGE(STATUS "Setting up testsuite - Done") -ENDIF() + message(STATUS "Setting up testsuite - Done") +endif() diff --git a/tests/a-framework/CMakeLists.txt b/tests/a-framework/CMakeLists.txt index 0b61801b17..dd839da7a0 100644 --- a/tests/a-framework/CMakeLists.txt +++ b/tests/a-framework/CMakeLists.txt @@ -1,53 +1,53 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) -ADD_EXECUTABLE(dummy.release dummy.cc) -ADD_EXECUTABLE(dummy.debug dummy.cc) -SET(TEST_TARGET_RELEASE dummy.release) -SET(TEST_TARGET_DEBUG dummy.debug) +add_executable(dummy.release dummy.cc) +add_executable(dummy.debug dummy.cc) +set(TEST_TARGET_RELEASE dummy.release) +set(TEST_TARGET_DEBUG dummy.debug) -DEAL_II_PICKUP_TESTS() +deal_ii_pickup_tests() # # Limit concurrency between the two parameter file tests. # -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build) - IF(TARGET parameter_file_2.${_build}.diff AND +foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build) + if(TARGET parameter_file_2.${_build}.diff AND TARGET parameter_file_1.${_build}.diff ) - SET_TESTS_PROPERTIES(a-framework/parameter_file_2.${_build} PROPERTIES + set_tests_properties(a-framework/parameter_file_2.${_build} PROPERTIES DEPENDS a-framework/parameter_file_1.${_build} ) - ENDIF() -ENDFOREACH() + endif() +endforeach() # # And a configure test: # -FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) +foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - SET(_target a-framework-configure.${_build_lowercase}) - SET(_test a-framework/configure.${_build_lowercase}) + set(_target a-framework-configure.${_build_lowercase}) + set(_test a-framework/configure.${_build_lowercase}) # Respect TEST_PICKUP_REGEX: - IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR + if( "${TEST_PICKUP_REGEX}" STREQUAL "" OR _test MATCHES "${TEST_PICKUP_REGEX}" ) - ADD_CUSTOM_TARGET(${_target} + add_custom_target(${_target} COMMAND echo "${_test}: CONFIGURE failed." && exit 1 ) - ADD_TEST(NAME ${_test} + add_test(NAME ${_test} COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_test} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DEXPECT=CONFIGURE -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - SET_TESTS_PROPERTIES(${_test} PROPERTIES + set_tests_properties(${_test} PROPERTIES LABEL "${_category}" TIMEOUT ${TEST_TIME_LIMIT} ) - ENDIF() -ENDFOREACH() + endif() +endforeach() diff --git a/tests/adolc/CMakeLists.txt b/tests/adolc/CMakeLists.txt index c4f706cdb9..a55ce476ca 100644 --- a/tests/adolc/CMakeLists.txt +++ b/tests/adolc/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_ADOLC) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_ADOLC) + deal_ii_pickup_tests() +endif() diff --git a/tests/algorithms/CMakeLists.txt b/tests/algorithms/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/algorithms/CMakeLists.txt +++ b/tests/algorithms/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/all-headers/CMakeLists.txt b/tests/all-headers/CMakeLists.txt index 66cbd1eb74..739ce1c73c 100644 --- a/tests/all-headers/CMakeLists.txt +++ b/tests/all-headers/CMakeLists.txt @@ -13,14 +13,14 @@ ## ## --------------------------------------------------------------------- -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) # # Set up test environment (does not pick up anything): # -DEAL_II_PICKUP_TESTS() +deal_ii_pickup_tests() # # Header tests are special: @@ -30,35 +30,35 @@ DEAL_II_PICKUP_TESTS() # header file. We omit linking to save some time. # -SET(_category all-headers) +set(_category all-headers) # # Glob together all header files and strip SOURCE_DIR/include/deal.II to # get a correct relative path: # -IF(DEAL_II_BUILD_DIR) - LIST(GET DEAL_II_INCLUDE_DIRS 1 _include_dir) -ELSE() - LIST(GET DEAL_II_INCLUDE_DIRS 0 _include_dir) -ENDIF() -FILE(GLOB_RECURSE _headers RELATIVE ${_include_dir}/deal.II +if(DEAL_II_BUILD_DIR) + list(GET DEAL_II_INCLUDE_DIRS 1 _include_dir) +else() + list(GET DEAL_II_INCLUDE_DIRS 0 _include_dir) +endif() +file(GLOB_RECURSE _headers RELATIVE ${_include_dir}/deal.II ${_include_dir}/deal.II/*.h ) # Do not test bundled headers to avoid issues when tests are run # for an already installed library -STRING(REGEX REPLACE "bundled/[^;]+;?" "" _headers "${_headers}") +string(REGEX REPLACE "bundled/[^;]+;?" "" _headers "${_headers}") -FOREACH(_header ${_headers}) - FOREACH(_build ${DEAL_II_BUILD_TYPES}) - STRING(TOLOWER ${_build} _build_lowercase) +foreach(_header ${_headers}) + foreach(_build ${DEAL_II_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) - SET(_test ${_category}/${_header}.${_build_lowercase}) - STRING(REGEX REPLACE "\\/" "-" _target ${_header}.${_build_lowercase}) + set(_test ${_category}/${_header}.${_build_lowercase}) + string(REGEX REPLACE "\\/" "-" _target ${_header}.${_build_lowercase}) # Respect TEST_PICKUP_REGEX: - IF( "${TEST_PICKUP_REGEX}" STREQUAL "" OR + if( "${TEST_PICKUP_REGEX}" STREQUAL "" OR _test MATCHES "${TEST_PICKUP_REGEX}" ) # @@ -67,39 +67,39 @@ FOREACH(_header ${_headers}) # interrupt_guard.cc is removed by run_test.cmake due to an # interruption. # - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}_interrupt_guard.cc COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${_target}_interrupt_guard.cc ) # Add an object library for each header file and build configuration: - ADD_LIBRARY(${_target} OBJECT EXCLUDE_FROM_ALL test_header.cc + add_library(${_target} OBJECT EXCLUDE_FROM_ALL test_header.cc ${CMAKE_CURRENT_BINARY_DIR}/${_target}_interrupt_guard.cc ) - DEAL_II_SETUP_TARGET(${_target} ${_build}) - SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + deal_ii_setup_target(${_target} ${_build}) + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS HEADER= ) - ADD_CUSTOM_TARGET(${_target}.build + add_custom_target(${_target}.build COMMAND echo "${_test}: BUILD successful." && echo "${_test}: PASSED." ) - ADD_DEPENDENCIES(${_target}.build ${_target}) + add_dependencies(${_target}.build ${_target}) # And finally add the test: - ADD_TEST(NAME ${_test} + add_test(NAME ${_test} COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.build -DTEST=${_test} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_target}_interrupt_guard.cc -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - SET_TESTS_PROPERTIES(${_test} PROPERTIES + set_tests_properties(${_test} PROPERTIES LABEL "${_category}" TIMEOUT ${TEST_TIME_LIMIT} ) - ENDIF() - ENDFOREACH() -ENDFOREACH() + endif() + endforeach() +endforeach() diff --git a/tests/aniso/CMakeLists.txt b/tests/aniso/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/aniso/CMakeLists.txt +++ b/tests/aniso/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/arborx/CMakeLists.txt b/tests/arborx/CMakeLists.txt index e324e7283c..9055d1013a 100644 --- a/tests/arborx/CMakeLists.txt +++ b/tests/arborx/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_ARBORX) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_ARBORX) + deal_ii_pickup_tests() +endif() diff --git a/tests/arpack/CMakeLists.txt b/tests/arpack/CMakeLists.txt index f9a4110f03..d78fbb7347 100644 --- a/tests/arpack/CMakeLists.txt +++ b/tests/arpack/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_ARPACK) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_ARPACK) + deal_ii_pickup_tests() +endif() diff --git a/tests/base/CMakeLists.txt b/tests/base/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/base/CMakeLists.txt +++ b/tests/base/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/belos/CMakeLists.txt b/tests/belos/CMakeLists.txt index 9f5a104c42..357ccbdd88 100644 --- a/tests/belos/CMakeLists.txt +++ b/tests/belos/CMakeLists.txt @@ -1,7 +1,7 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) -IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_BELOS) - DEAL_II_PICKUP_TESTS() -ENDIF() +if(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_BELOS) + deal_ii_pickup_tests() +endif() diff --git a/tests/bits/CMakeLists.txt b/tests/bits/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/bits/CMakeLists.txt +++ b/tests/bits/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/boost/CMakeLists.txt b/tests/boost/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/boost/CMakeLists.txt +++ b/tests/boost/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/cgal/CMakeLists.txt b/tests/cgal/CMakeLists.txt index 9c78c28903..45aaf1aeb9 100644 --- a/tests/cgal/CMakeLists.txt +++ b/tests/cgal/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_CGAL) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.1.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_CGAL) + deal_ii_pickup_tests() +endif() diff --git a/tests/codim_one/CMakeLists.txt b/tests/codim_one/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/codim_one/CMakeLists.txt +++ b/tests/codim_one/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/cuda/CMakeLists.txt b/tests/cuda/CMakeLists.txt index dcb04d09af..5f40b355cb 100644 --- a/tests/cuda/CMakeLists.txt +++ b/tests/cuda/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_CUDA) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_CUDA) + deal_ii_pickup_tests() +endif() diff --git a/tests/data_out/CMakeLists.txt b/tests/data_out/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/data_out/CMakeLists.txt +++ b/tests/data_out/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/distributed_grids/CMakeLists.txt b/tests/distributed_grids/CMakeLists.txt index ca755f8da2..2e53cb53a3 100644 --- a/tests/distributed_grids/CMakeLists.txt +++ b/tests/distributed_grids/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_P4EST) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_P4EST) + deal_ii_pickup_tests() +endif() diff --git a/tests/dofs/CMakeLists.txt b/tests/dofs/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/dofs/CMakeLists.txt +++ b/tests/dofs/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/epetraext/CMakeLists.txt b/tests/epetraext/CMakeLists.txt index 486d9202e1..9d2d40892c 100644 --- a/tests/epetraext/CMakeLists.txt +++ b/tests/epetraext/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_EPETRAEXT) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_EPETRAEXT) + deal_ii_pickup_tests() +endif() diff --git a/tests/examples/CMakeLists.txt b/tests/examples/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/examples/CMakeLists.txt +++ b/tests/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/fe/CMakeLists.txt b/tests/fe/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/fe/CMakeLists.txt +++ b/tests/fe/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/feinterface/CMakeLists.txt b/tests/feinterface/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/feinterface/CMakeLists.txt +++ b/tests/feinterface/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/full_matrix/CMakeLists.txt b/tests/full_matrix/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/full_matrix/CMakeLists.txt +++ b/tests/full_matrix/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/fullydistributed_grids/CMakeLists.txt b/tests/fullydistributed_grids/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/fullydistributed_grids/CMakeLists.txt +++ b/tests/fullydistributed_grids/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/ginkgo/CMakeLists.txt b/tests/ginkgo/CMakeLists.txt index 42fc2ca13d..2082449268 100644 --- a/tests/ginkgo/CMakeLists.txt +++ b/tests/ginkgo/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_GINKGO) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_GINKGO) + deal_ii_pickup_tests() +endif() diff --git a/tests/gla/CMakeLists.txt b/tests/gla/CMakeLists.txt index 0e4ac7914f..6330291a55 100644 --- a/tests/gla/CMakeLists.txt +++ b/tests/gla/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST AND DEAL_II_WITH_PETSC AND DEAL_II_WITH_TRILINOS) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST AND DEAL_II_WITH_PETSC AND DEAL_II_WITH_TRILINOS) + deal_ii_pickup_tests() +endif() diff --git a/tests/gmsh/CMakeLists.txt b/tests/gmsh/CMakeLists.txt index ce0bc9ee5f..08b92c772b 100644 --- a/tests/gmsh/CMakeLists.txt +++ b/tests/gmsh/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_GMSH) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_GMSH) + deal_ii_pickup_tests() +endif() diff --git a/tests/grid/CMakeLists.txt b/tests/grid/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/grid/CMakeLists.txt +++ b/tests/grid/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/hp/CMakeLists.txt b/tests/hp/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/hp/CMakeLists.txt +++ b/tests/hp/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/integrators/CMakeLists.txt b/tests/integrators/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/integrators/CMakeLists.txt +++ b/tests/integrators/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/lac/CMakeLists.txt b/tests/lac/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/lac/CMakeLists.txt +++ b/tests/lac/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/lapack/CMakeLists.txt b/tests/lapack/CMakeLists.txt index fe0c136ae9..8b2c74758f 100644 --- a/tests/lapack/CMakeLists.txt +++ b/tests/lapack/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_LAPACK) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_LAPACK) + deal_ii_pickup_tests() +endif() diff --git a/tests/manifold/CMakeLists.txt b/tests/manifold/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/manifold/CMakeLists.txt +++ b/tests/manifold/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/mappings/CMakeLists.txt b/tests/mappings/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/mappings/CMakeLists.txt +++ b/tests/mappings/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/matrix_free/CMakeLists.txt b/tests/matrix_free/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/matrix_free/CMakeLists.txt +++ b/tests/matrix_free/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/meshworker/CMakeLists.txt b/tests/meshworker/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/meshworker/CMakeLists.txt +++ b/tests/meshworker/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/metis/CMakeLists.txt b/tests/metis/CMakeLists.txt index fd094cb31e..5820231b0e 100644 --- a/tests/metis/CMakeLists.txt +++ b/tests/metis/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_METIS) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_METIS) + deal_ii_pickup_tests() +endif() diff --git a/tests/mpi/CMakeLists.txt b/tests/mpi/CMakeLists.txt index 663b664e82..65df410fd4 100644 --- a/tests/mpi/CMakeLists.txt +++ b/tests/mpi/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_MPI) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_MPI) + deal_ii_pickup_tests() +endif() diff --git a/tests/multigrid-global-coarsening/CMakeLists.txt b/tests/multigrid-global-coarsening/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/multigrid-global-coarsening/CMakeLists.txt +++ b/tests/multigrid-global-coarsening/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/multigrid/CMakeLists.txt b/tests/multigrid/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/multigrid/CMakeLists.txt +++ b/tests/multigrid/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/multithreading/CMakeLists.txt b/tests/multithreading/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/multithreading/CMakeLists.txt +++ b/tests/multithreading/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/non_matching/CMakeLists.txt b/tests/non_matching/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/non_matching/CMakeLists.txt +++ b/tests/non_matching/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/numerics/CMakeLists.txt b/tests/numerics/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/numerics/CMakeLists.txt +++ b/tests/numerics/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/opencascade/CMakeLists.txt b/tests/opencascade/CMakeLists.txt index 99a32abfea..fc09d53c17 100644 --- a/tests/opencascade/CMakeLists.txt +++ b/tests/opencascade/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_OPENCASCADE) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_OPENCASCADE) + deal_ii_pickup_tests() +endif() diff --git a/tests/optimization/CMakeLists.txt b/tests/optimization/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/optimization/CMakeLists.txt +++ b/tests/optimization/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/parameter_handler/CMakeLists.txt b/tests/parameter_handler/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/parameter_handler/CMakeLists.txt +++ b/tests/parameter_handler/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/particles/CMakeLists.txt b/tests/particles/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/particles/CMakeLists.txt +++ b/tests/particles/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/performance/CMakeLists.txt b/tests/performance/CMakeLists.txt index 101b1166f1..6a909c1c22 100644 --- a/tests/performance/CMakeLists.txt +++ b/tests/performance/CMakeLists.txt @@ -1,37 +1,37 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) # # Try to locate valgrind: # -FIND_PROGRAM(VALGRIND_EXECUTABLE +find_program(VALGRIND_EXECUTABLE NAMES valgrind HINTS ${VALGRIND_DIR} PATH_SUFFIXES bin ) -FIND_PATH(VALGRIND_INCLUDE_DIR valgrind/callgrind.h +find_path(VALGRIND_INCLUDE_DIR valgrind/callgrind.h HINTS ${VALGRIND_DIR} PATH_SUFFIXES include ) -IF( NOT VALGRIND_EXECUTABLE MATCHES "-NOTFOUND" AND +if( NOT VALGRIND_EXECUTABLE MATCHES "-NOTFOUND" AND NOT VALGRIND_INCLUDE_DIR MATCHES "-NOTFOUND" ) - MESSAGE(STATUS "Found valgrind at ${VALGRIND_EXECUTABLE}") - SET(DEAL_II_WITH_VALGRIND TRUE) - SET(_command_line + message(STATUS "Found valgrind at ${VALGRIND_EXECUTABLE}") + set(DEAL_II_WITH_VALGRIND TRUE) + set(_command_line "${VALGRIND_EXECUTABLE}" --tool=callgrind -q --combine-dumps=yes --instr-atstart=no --callgrind-out-file=callgrind.out ) -ELSE() - MESSAGE(STATUS "Could not find valgrind") - SET(DEAL_II_WITH_VALGRIND FALSE) -ENDIF() +else() + message(STATUS "Could not find valgrind") + set(DEAL_II_WITH_VALGRIND FALSE) +endif() -SET(performance_instrumentation_step_3_RUNARGS_PREFIX "${_command_line}") -SET(performance_instrumentation_step_22_RUNARGS_PREFIX "${_command_line}") +set(performance_instrumentation_step_3_RUNARGS_PREFIX "${_command_line}") +set(performance_instrumentation_step_22_RUNARGS_PREFIX "${_command_line}") -DEAL_II_PICKUP_TESTS() +deal_ii_pickup_tests() diff --git a/tests/petsc/CMakeLists.txt b/tests/petsc/CMakeLists.txt index 1cc60cc04a..53322c0020 100644 --- a/tests/petsc/CMakeLists.txt +++ b/tests/petsc/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_PETSC AND NOT DEAL_II_PETSC_WITH_COMPLEX) + deal_ii_pickup_tests() +endif() diff --git a/tests/petsc_complex/CMakeLists.txt b/tests/petsc_complex/CMakeLists.txt index 64ae324a79..23c1e1678f 100644 --- a/tests/petsc_complex/CMakeLists.txt +++ b/tests/petsc_complex/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_PETSC AND DEAL_II_PETSC_WITH_COMPLEX) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_PETSC AND DEAL_II_PETSC_WITH_COMPLEX) + deal_ii_pickup_tests() +endif() diff --git a/tests/physics/CMakeLists.txt b/tests/physics/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/physics/CMakeLists.txt +++ b/tests/physics/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt index 2e6589caff..4090328b72 100644 --- a/tests/quick_tests/CMakeLists.txt +++ b/tests/quick_tests/CMakeLists.txt @@ -16,9 +16,9 @@ # # A minimalistic set of tests: # -ENABLE_TESTING() +enable_testing() -INCLUDE_DIRECTORIES( +include_directories( ${CMAKE_BINARY_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/ ${DEAL_II_BUNDLED_INCLUDE_DIRS} @@ -26,29 +26,29 @@ INCLUDE_DIRECTORIES( ) # Use the first available build type (this prefers debug mode if available): -LIST(GET DEAL_II_BUILD_TYPES 0 _mybuild) -MESSAGE(STATUS "Setting up quick_tests in ${_mybuild} mode") +list(GET DEAL_II_BUILD_TYPES 0 _mybuild) +message(STATUS "Setting up quick_tests in ${_mybuild} mode") -SET(ALL_TESTS) # clean variable +set(ALL_TESTS) # clean variable # define a macro to set up a quick test: -MACRO(make_quicktest test_basename build_name mpi_run) - STRING(TOLOWER ${build_name} _build_lowercase) - SET(_target ${test_basename}.${_build_lowercase}) - LIST(APPEND ALL_TESTS "${_target}") - ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL ${test_basename}.cc) - DEAL_II_INSOURCE_SETUP_TARGET(${_target} ${build_name}) - - IF("${mpi_run}" STREQUAL "") - SET(_command ${_target}) - ELSE() - IF(CMAKE_SYSTEM_NAME MATCHES "Windows") - SET(_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${mpi_run} ${MPIEXEC_PREFLAGS} ${_target}) - ELSE() - SET(_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${mpi_run} ${MPIEXEC_PREFLAGS} ./${_target}) - ENDIF() - ENDIF() - ADD_CUSTOM_TARGET(${_target}.run +macro(make_quicktest test_basename build_name mpi_run) + string(TOLOWER ${build_name} _build_lowercase) + set(_target ${test_basename}.${_build_lowercase}) + list(APPEND ALL_TESTS "${_target}") + add_executable(${_target} EXCLUDE_FROM_ALL ${test_basename}.cc) + deal_ii_insource_setup_target(${_target} ${build_name}) + + if("${mpi_run}" STREQUAL "") + set(_command ${_target}) + else() + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${mpi_run} ${MPIEXEC_PREFLAGS} ${_target}) + else() + set(_command ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${mpi_run} ${MPIEXEC_PREFLAGS} ./${_target}) + endif() + endif() + add_custom_target(${_target}.run DEPENDS ${_target} COMMAND ${_command} > ${_target}-OK 2>&1 @@ -62,148 +62,148 @@ MACRO(make_quicktest test_basename build_name mpi_run) # this is a hack to make sure the -OK file is deleted # even if compilation fails. - ADD_CUSTOM_TARGET(reset-${_target}-OK + add_custom_target(reset-${_target}-OK COMMAND ${CMAKE_COMMAND} -E remove -f ${_target}-OK WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - ADD_DEPENDENCIES(${_target} reset-${_target}-OK) + add_dependencies(${_target} reset-${_target}-OK) - ADD_TEST(NAME ${_target} + add_test(NAME ${_target} COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.run -DTEST=${_target} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - SET_TESTS_PROPERTIES(${_target} PROPERTIES + set_tests_properties(${_target} PROPERTIES LABEL "sanity checks" ENVIRONMENT "OMPI_MCA_rmaps_base_oversubscribe=1") # ^^^ Allow oversubscription for MPI (needed for Openmpi@3.0) -ENDMACRO() +endmacro() # Simple assembly/solver test. This makes sure we can compile and link correctly # in debug and release. -FOREACH(_build ${DEAL_II_BUILD_TYPES}) +foreach(_build ${DEAL_II_BUILD_TYPES}) make_quicktest("step" ${_build} "") -ENDFOREACH() +endforeach() # Test whether thread affinity is well behaved make_quicktest("affinity" ${_mybuild} "") # Test if MPI is configured correctly -IF (DEAL_II_WITH_MPI) +if (DEAL_II_WITH_MPI) make_quicktest("mpi" ${_mybuild} 2) -ENDIF() +endif() # Test if TBB works correctly -IF (DEAL_II_WITH_TBB) +if (DEAL_II_WITH_TBB) make_quicktest("tbb" ${_mybuild} "") -ENDIF() +endif() # test taskflow -IF (DEAL_II_WITH_TASKFLOW) +if (DEAL_II_WITH_TASKFLOW) make_quicktest("taskflow" ${_mybuild} "") -ENDIF() +endif() # Test p4est. This test exposes a bug in OpenMPI 1.3 and 1.4 # Update to OpenMPI 1.5 or newer. -IF (DEAL_II_WITH_P4EST) +if (DEAL_II_WITH_P4EST) make_quicktest("p4est" ${_mybuild} 10) -ENDIF() +endif() # Test petsc -IF (DEAL_II_WITH_PETSC) +if (DEAL_II_WITH_PETSC) make_quicktest("step-petsc" ${_mybuild} "") -ENDIF() +endif() # Test slepc -IF (DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC) +if (DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC) make_quicktest("step-slepc" ${_mybuild} "") -ENDIF() +endif() # Test trilinos -IF (DEAL_II_WITH_TRILINOS) +if (DEAL_II_WITH_TRILINOS) make_quicktest("step-trilinos" ${_mybuild} "") -ENDIF() +endif() # Test metis -IF (DEAL_II_WITH_METIS AND DEAL_II_WITH_MPI) +if (DEAL_II_WITH_METIS AND DEAL_II_WITH_MPI) make_quicktest("step-metis" ${_mybuild} 2) -ENDIF() +endif() # Test LAPACK -IF (DEAL_II_WITH_LAPACK) +if (DEAL_II_WITH_LAPACK) make_quicktest("lapack" ${_mybuild} "") -ENDIF() +endif() # Test Umfpack -IF (DEAL_II_WITH_UMFPACK) +if (DEAL_II_WITH_UMFPACK) make_quicktest("umfpack" ${_mybuild} "") -ENDIF() +endif() # Test GSL -IF (DEAL_II_WITH_GSL) +if (DEAL_II_WITH_GSL) make_quicktest("gsl" ${_mybuild} "") -ENDIF() +endif() # Test HDF5 -IF (DEAL_II_WITH_HDF5) +if (DEAL_II_WITH_HDF5) make_quicktest("hdf5" ${_mybuild} "") -ENDIF() +endif() # Test Arpack -IF (DEAL_II_WITH_ARPACK AND DEAL_II_WITH_UMFPACK) +if (DEAL_II_WITH_ARPACK AND DEAL_II_WITH_UMFPACK) make_quicktest("arpack" ${_mybuild} "") -ENDIF() +endif() # Test Adol-C -IF (DEAL_II_WITH_ADOLC) +if (DEAL_II_WITH_ADOLC) make_quicktest("adolc" ${_mybuild} "") -ENDIF() +endif() # Test SUNDIALS -IF (DEAL_II_WITH_SUNDIALS) +if (DEAL_II_WITH_SUNDIALS) make_quicktest("sundials-ida" ${_mybuild} "") -ENDIF() +endif() # Test Assimp -IF (DEAL_II_WITH_ASSIMP) +if (DEAL_II_WITH_ASSIMP) make_quicktest("assimp" ${_mybuild} "") -ENDIF() +endif() # Test CUDA -IF (DEAL_II_WITH_CUDA) +if (DEAL_II_WITH_CUDA) make_quicktest("cuda" ${_mybuild} "") -ENDIF() +endif() # Test ScaLAPACK -IF (DEAL_II_WITH_SCALAPACK) +if (DEAL_II_WITH_SCALAPACK) make_quicktest("scalapack" ${_mybuild} 5) -ENDIF() +endif() # Test Zlib and Boost -IF (DEAL_II_WITH_ZLIB) +if (DEAL_II_WITH_ZLIB) make_quicktest("boost_zlib" ${_mybuild} "") -ENDIF() +endif() # Test GMSH -IF (DEAL_II_WITH_GMSH) +if (DEAL_II_WITH_GMSH) make_quicktest("gmsh" ${_mybuild} "") -ENDIF() +endif() # Test SymEngine -IF (DEAL_II_WITH_SYMENGINE) +if (DEAL_II_WITH_SYMENGINE) make_quicktest("symengine" ${_mybuild} "") -ENDIF() +endif() # Test Kokkos make_quicktest("kokkos" ${_mybuild} "") # A custom test target: -ADD_CUSTOM_TARGET(test +add_custom_target(test COMMAND ${CMAKE_COMMAND} -D ALL_TESTS="${ALL_TESTS}" -DCMAKE_BUILD_TYPE=${_mybuild} -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Running quicktests..." ) -MESSAGE(STATUS "Setting up quick_tests in ${_mybuild} mode - Done") +message(STATUS "Setting up quick_tests in ${_mybuild} mode - Done") diff --git a/tests/quick_tests/run.cmake b/tests/quick_tests/run.cmake index b3e2bb3e4d..991a82cd20 100644 --- a/tests/quick_tests/run.cmake +++ b/tests/quick_tests/run.cmake @@ -18,9 +18,9 @@ # error messages. include(ProcessorCount) PROCESSORCOUNT(_n_processors) -IF(_n_processors EQUAL 0) - SET(_n_processors "1") -ENDIF() +if(_n_processors EQUAL 0) + set(_n_processors "1") +endif() # Windows quick tests have a race condition, so disable compiling/running @@ -30,21 +30,21 @@ ENDIF() # "obj_boost_system_debug.dir\Debug\obj_boos.4A356C5C.tlog\obj_boost_system_debug.lastbuildstate". The # process cannot access the file '...' because it is being used by another # process. -IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") - SET(_n_processors "1") -ENDIF() +if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") + set(_n_processors "1") +endif() -SEPARATE_ARGUMENTS(ALL_TESTS) +separate_arguments(ALL_TESTS) -EXECUTE_PROCESS(COMMAND ${CMAKE_CTEST_COMMAND} -j${_n_processors} +execute_process(COMMAND ${CMAKE_CTEST_COMMAND} -j${_n_processors} -C ${CMAKE_BUILD_TYPE} --force-new-ctest-process --output-on-failure -O quicktests.log RESULT_VARIABLE res_var) -IF(NOT "${res_var}" STREQUAL "0") - MESSAGE(" +if(NOT "${res_var}" STREQUAL "0") + message(" *************************************************************************** ** Error: Some of the quick tests failed. ** *************************************************************************** @@ -54,39 +54,39 @@ error messages. If you are unable to fix the problems, see the FAQ or write to the mailing list linked at http://www.dealii.org\n" ) - FOREACH(test ${ALL_TESTS}) - IF (${test} MATCHES "^affinity" AND NOT EXISTS ${test}-OK) - MESSAGE(" + foreach(test ${ALL_TESTS}) + if (${test} MATCHES "^affinity" AND NOT EXISTS ${test}-OK) + message(" The affinity test can fail when you are linking in a library like BLAS which uses OpenMP. Even without calling any BLAS functions, OpenMP messes with the thread affinity which causes TBB to run single-threaded only. You can fix this by exporting OMP_NUM_THREADS=1. Also see GOMP_CPU_AFFINITY and OMP_PROC_BIND.\n" ) - ENDIF() + endif() - IF (${test} MATCHES "^step-petsc" AND NOT EXISTS ${test}-OK) - MESSAGE(" + if (${test} MATCHES "^step-petsc" AND NOT EXISTS ${test}-OK) + message(" Additional information about PETSc issues is available at:\nhttp://www.dealii.org/developer/external-libs/petsc.html\n" ) - ENDIF() + endif() - IF (${test} MATCHES "^p4est" AND NOT EXISTS ${test}-OK) - MESSAGE(" + if (${test} MATCHES "^p4est" AND NOT EXISTS ${test}-OK) + message(" The p4est test can fail if you are running an OpenMPI version before 1.5. This is a known problem and the only work around is to update to a more recent version or use a different MPI library like MPICH.\n" ) - ENDIF() + endif() - ENDFOREACH() + endforeach() - # The CMake command MESSAGE(SEND_ERROR ...) is, to the best of the authors' + # The CMake command message(SEND_ERROR ...) is, to the best of the authors' # knowledge, the only way to set the exit status of CMake to a nonzero value. - # If we used MESSAGE(SEND_ERROR ...) at the top (with the actual error + # If we used message(SEND_ERROR ...) at the top (with the actual error # message) then subsequent messages (i.e., the test specific help) would not # be printed. Hence, do it down here. - MESSAGE(SEND_ERROR "") + message(SEND_ERROR "") -ENDIF() +endif() diff --git a/tests/remote_point_evaluation/CMakeLists.txt b/tests/remote_point_evaluation/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/remote_point_evaluation/CMakeLists.txt +++ b/tests/remote_point_evaluation/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/rol/CMakeLists.txt b/tests/rol/CMakeLists.txt index c1262648cc..6d1ac048b7 100644 --- a/tests/rol/CMakeLists.txt +++ b/tests/rol/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_ROL) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_ROL) + deal_ii_pickup_tests() +endif() diff --git a/tests/run_buildtest.cmake b/tests/run_buildtest.cmake index 6bfed3231c..208dbaf969 100644 --- a/tests/run_buildtest.cmake +++ b/tests/run_buildtest.cmake @@ -1,6 +1,6 @@ -IF("${TRACK}" STREQUAL "") - SET(TRACK "Build Tests") -ENDIF() -SET(DEAL_II_COMPILE_EXAMPLES TRUE) -SET(TEST_PICKUP_REGEX "^do_not_run_any_tests") -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) +if("${TRACK}" STREQUAL "") + set(TRACK "Build Tests") +endif() +set(DEAL_II_COMPILE_EXAMPLES TRUE) +set(TEST_PICKUP_REGEX "^do_not_run_any_tests") +include(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) diff --git a/tests/run_coverage.cmake b/tests/run_coverage.cmake index 632ebf0fc4..4f9fc91a2a 100644 --- a/tests/run_coverage.cmake +++ b/tests/run_coverage.cmake @@ -1,3 +1,3 @@ -SET(TRACK "Experimental") -SET(COVERAGE TRUE) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) +set(TRACK "Experimental") +set(COVERAGE TRUE) +include(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) diff --git a/tests/run_memorycheck.cmake b/tests/run_memorycheck.cmake index d1a466ea80..8ad9716884 100644 --- a/tests/run_memorycheck.cmake +++ b/tests/run_memorycheck.cmake @@ -1,3 +1,3 @@ -SET(TRACK "Experimental") -SET(MEMORYCHECK TRUE) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) +set(TRACK "Experimental") +set(MEMORYCHECK TRUE) +include(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) diff --git a/tests/run_performance_tests.cmake b/tests/run_performance_tests.cmake index c0bbadd97b..39a53c7810 100644 --- a/tests/run_performance_tests.cmake +++ b/tests/run_performance_tests.cmake @@ -1,51 +1,51 @@ # A small macro -MACRO(SET_IF_EMPTY _variable) - IF("${${_variable}}" STREQUAL "") - SET(${_variable} ${ARGN}) - ENDIF() -ENDMACRO() +macro(SET_IF_EMPTY _variable) + if("${${_variable}}" STREQUAL "") + set(${_variable} ${ARGN}) + endif() +endmacro() # By default we simply skip test submission to CDash -SET(TRACK "Experimental") -SET_IF_EMPTY(SKIP_SUBMISSION TRUE) +set(TRACK "Experimental") +set_if_empty(SKIP_SUBMISSION TRUE) -SET(CMAKE_BUILD_TYPE Release) -SET(DEAL_II_COMPILE_EXAMPLES FALSE) +set(CMAKE_BUILD_TYPE Release) +set(DEAL_II_COMPILE_EXAMPLES FALSE) -SET(ENABLE_PERFORMANCE_TESTS TRUE) +set(ENABLE_PERFORMANCE_TESTS TRUE) # # Determine appropriate resource limits for performance tests: # -IF("${TESTING_ENVIRONMENT}" STREQUAL "whistler-node") +if("${TESTING_ENVIRONMENT}" STREQUAL "whistler-node") # Managed by Matthias - SET(CTEST_SITE "${TESTING_ENVIRONMENT}") - SET(TESTING_ENVIRONMENT "heavy") -ENDIF() + set(CTEST_SITE "${TESTING_ENVIRONMENT}") + set(TESTING_ENVIRONMENT "heavy") +endif() # # Determine appropriate resource limits for performance tests: # -SET_IF_EMPTY(TESTING_ENVIRONMENT "light") - -IF("${TESTING_ENVIRONMENT}" STREQUAL "light") - SET_IF_EMPTY(TEST_TIME_LIMIT 600) - SET_IF_EMPTY(TEST_MPI_RANK_LIMIT 2) - SET_IF_EMPTY(TEST_THREAD_LIMIT 2) -ELSEIF("${TESTING_ENVIRONMENT}" STREQUAL "medium") - SET_IF_EMPTY(TEST_TIME_LIMIT 600) - SET_IF_EMPTY(TEST_MPI_RANK_LIMIT 8) - SET_IF_EMPTY(TEST_THREAD_LIMIT 8) -ELSEIF("${TESTING_ENVIRONMENT}" STREQUAL "heavy") - SET_IF_EMPTY(TEST_TIME_LIMIT 600) - SET_IF_EMPTY(TEST_MPI_RANK_LIMIT 32) - SET_IF_EMPTY(TEST_THREAD_LIMIT 32) -ELSE() - MESSAGE(FATAL_ERROR +set_if_empty(TESTING_ENVIRONMENT "light") + +if("${TESTING_ENVIRONMENT}" STREQUAL "light") + set_if_empty(TEST_TIME_LIMIT 600) + set_if_empty(TEST_MPI_RANK_LIMIT 2) + set_if_empty(TEST_THREAD_LIMIT 2) +elseif("${TESTING_ENVIRONMENT}" STREQUAL "medium") + set_if_empty(TEST_TIME_LIMIT 600) + set_if_empty(TEST_MPI_RANK_LIMIT 8) + set_if_empty(TEST_THREAD_LIMIT 8) +elseif("${TESTING_ENVIRONMENT}" STREQUAL "heavy") + set_if_empty(TEST_TIME_LIMIT 600) + set_if_empty(TEST_MPI_RANK_LIMIT 32) + set_if_empty(TEST_THREAD_LIMIT 32) +else() + message(FATAL_ERROR "The variable TESTING_ENVIRONMENT was set to the invalid value " "»${TESTING_ENVIRONMENT}«. Valid options are light, medium, heavy.") -ENDIF() +endif() -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake) diff --git a/tests/run_testsuite.cmake b/tests/run_testsuite.cmake index b8ab84f15c..3bf2b5b0c0 100644 --- a/tests/run_testsuite.cmake +++ b/tests/run_testsuite.cmake @@ -78,7 +78,7 @@ # COVERAGE # - If set to ON deal.II will be configured with # DEAL_II_SETUP_COVERAGE=ON, CMAKE_BUILD_TYPE=Debug and the -# CTEST_COVERAGE() stage will be run. Test results must go into the +# ctest_coverage() stage will be run. Test results must go into the # "Experimental" section. # # MEMORYCHECK @@ -99,180 +99,180 @@ # For details, consult the ./README file. # -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -MESSAGE("-- This is CTest ${CMAKE_VERSION}") +cmake_minimum_required(VERSION 3.3.0) +message("-- This is CTest ${CMAKE_VERSION}") # # TRACK: Default to Experimental: # -IF("${TRACK}" STREQUAL "") - SET(TRACK "Experimental") -ENDIF() +if("${TRACK}" STREQUAL "") + set(TRACK "Experimental") +endif() -IF( NOT "${TRACK}" STREQUAL "Experimental" +if( NOT "${TRACK}" STREQUAL "Experimental" AND NOT "${TRACK}" STREQUAL "Build Tests" AND NOT "${TRACK}" STREQUAL "Regression Tests" AND NOT "${TRACK}" STREQUAL "Continuous" ) - MESSAGE(FATAL_ERROR " + message(FATAL_ERROR " Unknown TRACK \"${TRACK}\" - see the manual for valid values. " ) -ENDIF() +endif() -MESSAGE("-- TRACK: ${TRACK}") +message("-- TRACK: ${TRACK}") # # CTEST_SOURCE_DIRECTORY: # -IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "") +if("${CTEST_SOURCE_DIRECTORY}" STREQUAL "") # # If CTEST_SOURCE_DIRECTORY is not set we just assume that this script # was called residing under ./tests in the source directory # - GET_FILENAME_COMPONENT(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PATH) + get_filename_component(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PATH) - IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt) - MESSAGE(FATAL_ERROR " + if(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt) + message(FATAL_ERROR " Could not find a suitable source directory. There is no source directory \"../\" relative to the location of this script. Please, set CTEST_SOURCE_DIRECTORY manually to the appropriate source directory. " ) - ENDIF() -ENDIF() + endif() +endif() -MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}") +message("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}") # # Read in custom config files: # -CTEST_READ_CUSTOM_FILES(${CTEST_SOURCE_DIRECTORY}) +ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY}) # # CTEST_BINARY_DIRECTORY: # -IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "") +if("${CTEST_BINARY_DIRECTORY}" STREQUAL "") # # If CTEST_BINARY_DIRECTORY is not set we just use the current directory # except if it is equal to CTEST_SOURCE_DIRECTORY in which case we fail. # - SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + set(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - IF( ( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIRECTORY}" + if( ( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIRECTORY}" AND NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeCache.txt ) OR "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}" ) - MESSAGE(FATAL_ERROR " + message(FATAL_ERROR " ctest was invoked in the source directory or under ./tests and CTEST_BINARY_DIRECTORY is not set. Please either call ctest from within a designated build directory, or set CTEST_BINARY_DIRECTORY accordingly. " ) - ENDIF() -ENDIF() + endif() +endif() # # Read in custom config files: # -CTEST_READ_CUSTOM_FILES(${CTEST_BINARY_DIRECTORY}) +ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) # Make sure that for a build test the directory is empty: -FILE(GLOB _test ${CTEST_BINARY_DIRECTORY}/*) -IF( "${TRACK}" STREQUAL "Build Tests" +file(GLOB _test ${CTEST_BINARY_DIRECTORY}/*) +if( "${TRACK}" STREQUAL "Build Tests" AND NOT "${_test}" STREQUAL "" ) - MESSAGE(FATAL_ERROR " + message(FATAL_ERROR " TRACK was set to \"Build Tests\" which require an empty build directory. But files were found in \"${CTEST_BINARY_DIRECTORY}\" " ) -ENDIF() +endif() -MESSAGE("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") +message("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") # # CTEST_CMAKE_GENERATOR: # # Query Generator from build directory (if possible): -IF(EXISTS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt) - FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt _generator +if(EXISTS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt) + file(STRINGS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt _generator REGEX "^CMAKE_GENERATOR:" ) - STRING(REGEX REPLACE "^.*=" "" _generator ${_generator}) -ENDIF() + string(REGEX REPLACE "^.*=" "" _generator ${_generator}) +endif() -IF("${CTEST_CMAKE_GENERATOR}" STREQUAL "") - IF(NOT "${_generator}" STREQUAL "") - SET(CTEST_CMAKE_GENERATOR ${_generator}) - ELSE() +if("${CTEST_CMAKE_GENERATOR}" STREQUAL "") + if(NOT "${_generator}" STREQUAL "") + set(CTEST_CMAKE_GENERATOR ${_generator}) + else() # default to "Unix Makefiles" - SET(CTEST_CMAKE_GENERATOR "Unix Makefiles") - ENDIF() -ELSE() + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + endif() +else() # ensure that CTEST_CMAKE_GENERATOR (that was apparently set) is # compatible with the build directory: - IF( NOT "${CTEST_CMAKE_GENERATOR}" STREQUAL "${_generator}" + if( NOT "${CTEST_CMAKE_GENERATOR}" STREQUAL "${_generator}" AND NOT "${_generator}" STREQUAL "" ) - MESSAGE(FATAL_ERROR " + message(FATAL_ERROR " The build directory is already set up with Generator \"${_generator}\", but CTEST_CMAKE_GENERATOR was set to a different Generator \"${CTEST_CMAKE_GENERATOR}\". " ) - ENDIF() -ENDIF() + endif() +endif() -MESSAGE("-- CTEST_CMAKE_GENERATOR: ${CTEST_CMAKE_GENERATOR}") +message("-- CTEST_CMAKE_GENERATOR: ${CTEST_CMAKE_GENERATOR}") # # CTEST_SITE: # -IF("${CTEST_SITE}" STREQUAL "") - FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname) - IF(NOT "${HOSTNAME_COMMAND}" MATCHES "-NOTFOUND") - EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname) - STRING(REGEX REPLACE "\\..*$" "" _hostname ${_hostname}) - SET(CTEST_SITE "${_hostname}") - ELSE() +if("${CTEST_SITE}" STREQUAL "") + find_program(HOSTNAME_COMMAND NAMES hostname) + if(NOT "${HOSTNAME_COMMAND}" MATCHES "-NOTFOUND") + exec_program(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname) + string(REGEX REPLACE "\\..*$" "" _hostname ${_hostname}) + set(CTEST_SITE "${_hostname}") + else() # Well, no hostname available. What about: - SET(CTEST_SITE "BobMorane") - ENDIF() -ENDIF() + set(CTEST_SITE "BobMorane") + endif() +endif() -MESSAGE("-- CTEST_SITE: ${CTEST_SITE}") +message("-- CTEST_SITE: ${CTEST_SITE}") -IF(TRACK MATCHES "^Regression Tests$" AND NOT CTEST_SITE MATCHES "^tester$") - MESSAGE(FATAL_ERROR " +if(TRACK MATCHES "^Regression Tests$" AND NOT CTEST_SITE MATCHES "^tester$") + message(FATAL_ERROR " I'm sorry ${CTEST_SITE}, I'm afraid I can't do that. The TRACK \"Regression Tests\" is not for you. " ) -ENDIF() +endif() # # Assemble configuration options, we need it now: # -IF("${MAKEOPTS}" STREQUAL "") - SET(MAKEOPTS $ENV{MAKEOPTS}) -ENDIF() +if("${MAKEOPTS}" STREQUAL "") + set(MAKEOPTS $ENV{MAKEOPTS}) +endif() -IF(NOT "${CONFIG_FILE}" STREQUAL "") - SET(_options "-C${CONFIG_FILE}") -ENDIF() +if(NOT "${CONFIG_FILE}" STREQUAL "") + set(_options "-C${CONFIG_FILE}") +endif() -IF("${TRACK}" STREQUAL "Build Tests") - SET(TEST_PICKUP_REGEX "^do_not_run_any_tests") -ENDIF() +if("${TRACK}" STREQUAL "Build Tests") + set(TEST_PICKUP_REGEX "^do_not_run_any_tests") +endif() # Pass all relevant variables down to configure: -GET_CMAKE_PROPERTY(_variables VARIABLES) -FOREACH(_var ${_variables}) - IF( _var MATCHES "^(ENABLE|TEST|TESTING|DEAL_II|ALLOW|WITH|FORCE|COMPONENT)_" OR +get_cmake_property(_variables VARIABLES) +foreach(_var ${_variables}) + if( _var MATCHES "^(ENABLE|TEST|TESTING|DEAL_II|ALLOW|WITH|FORCE|COMPONENT)_" OR _var MATCHES "^(DOCUMENTATION|EXAMPLES)" OR _var MATCHES "^(ADOLC|ARBORX|ARPACK|BOOST|OPENCASCADE|MUPARSER|HDF5|KOKKOS|METIS|MPI)_" OR _var MATCHES "^(GINKGO|P4EST|PETSC|SCALAPACK|SLEPC|THREADS|TBB|TRILINOS)_" OR @@ -281,66 +281,66 @@ FOREACH(_var ${_variables}) _var MATCHES "^CMAKE_BUILD_TYPE$" OR _var MATCHES "MAKEOPTS" OR ( NOT _var MATCHES "^[_]*CMAKE" AND _var MATCHES "_DIR$" ) ) - LIST(APPEND _options "-D${_var}=${${_var}}") - ENDIF() -ENDFOREACH() + list(APPEND _options "-D${_var}=${${_var}}") + endif() +endforeach() -IF(COVERAGE) - LIST(APPEND _options "-DDEAL_II_SETUP_COVERAGE=TRUE") - LIST(APPEND _options "-DCMAKE_BUILD_TYPE=Debug") -ENDIF() +if(COVERAGE) + list(APPEND _options "-DDEAL_II_SETUP_COVERAGE=TRUE") + list(APPEND _options "-DCMAKE_BUILD_TYPE=Debug") +endif() # # CTEST_BUILD_NAME: # # Append compiler information to CTEST_BUILD_NAME: -IF(NOT EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log) +if(NOT EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log) # Apparently, ${CTEST_BINARY_DIRECTORY} is not a configured build # directory. In this case we need a trick: set up a dummy project and # query it for the compiler information. - FILE(WRITE ${CTEST_BINARY_DIRECTORY}/query_for_compiler/CMakeLists.txt " -FILE(WRITE ${CTEST_BINARY_DIRECTORY}/detailed.log + file(WRITE ${CTEST_BINARY_DIRECTORY}/query_for_compiler/CMakeLists.txt " +file(WRITE ${CTEST_BINARY_DIRECTORY}/detailed.log \"# CMAKE_CXX_COMPILER: \${CMAKE_CXX_COMPILER_ID} \${CMAKE_CXX_COMPILER_VERSION} on platform \${CMAKE_SYSTEM_NAME} \${CMAKE_SYSTEM_PROCESSOR}\" )" ) - EXECUTE_PROCESS( + execute_process( COMMAND ${CMAKE_COMMAND} ${_options} "-G${CTEST_CMAKE_GENERATOR}" . OUTPUT_QUIET ERROR_QUIET WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}/query_for_compiler ) - FILE(REMOVE_RECURSE ${CTEST_BINARY_DIRECTORY}/query_for_compiler) -ENDIF() + file(REMOVE_RECURSE ${CTEST_BINARY_DIRECTORY}/query_for_compiler) +endif() -IF(EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log) - FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/detailed.log _compiler_id +if(EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log) + file(STRINGS ${CTEST_BINARY_DIRECTORY}/detailed.log _compiler_id REGEX "CMAKE_CXX_COMPILER:" ) - STRING(REGEX REPLACE + string(REGEX REPLACE "^.*CMAKE_CXX_COMPILER: \(.*\) on platform.*$" "\\1" _compiler_id ${_compiler_id} ) - STRING(REGEX REPLACE "^\(.*\) .*$" "\\1" _compiler_name ${_compiler_id}) - STRING(REGEX REPLACE "^.* " "" _compiler_version ${_compiler_id}) - STRING(REGEX REPLACE " " "-" _compiler_id ${_compiler_id}) - IF( NOT "${_compiler_id}" STREQUAL "" OR + string(REGEX REPLACE "^\(.*\) .*$" "\\1" _compiler_name ${_compiler_id}) + string(REGEX REPLACE "^.* " "" _compiler_version ${_compiler_id}) + string(REGEX REPLACE " " "-" _compiler_id ${_compiler_id}) + if( NOT "${_compiler_id}" STREQUAL "" OR _compiler_id MATCHES "CMAKE_CXX_COMPILER" ) - SET(CTEST_BUILD_NAME "${_compiler_id}") - ENDIF() -ENDIF() + set(CTEST_BUILD_NAME "${_compiler_id}") + endif() +endif() # # Query git information: # -FIND_PACKAGE(Git) +find_package(Git) -IF(NOT GIT_FOUND) - MESSAGE(FATAL_ERROR "\nCould not find git. Bailing out.\n" +if(NOT GIT_FOUND) + message(FATAL_ERROR "\nCould not find git. Bailing out.\n" ) -ENDIF() +endif() -EXECUTE_PROCESS( +execute_process( COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY} OUTPUT_VARIABLE _git_WC_INFO @@ -348,14 +348,14 @@ EXECUTE_PROCESS( OUTPUT_STRIP_TRAILING_WHITESPACE ) -IF(NOT ${_result} EQUAL 0) - MESSAGE(FATAL_ERROR "\nCould not retrieve git information. Bailing out.\n") -ENDIF() +if(NOT ${_result} EQUAL 0) + message(FATAL_ERROR "\nCould not retrieve git information. Bailing out.\n") +endif() -STRING(REGEX REPLACE "^\"([^ ]+)\"" +string(REGEX REPLACE "^\"([^ ]+)\"" "\\1" _git_WC_SHORTREV "${_git_WC_INFO}") -EXECUTE_PROCESS( +execute_process( COMMAND ${GIT_EXECUTABLE} symbolic-ref HEAD WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY} OUTPUT_VARIABLE _git_WC_BRANCH @@ -363,38 +363,38 @@ EXECUTE_PROCESS( OUTPUT_STRIP_TRAILING_WHITESPACE ) -STRING(REGEX REPLACE "refs/heads/" "" +string(REGEX REPLACE "refs/heads/" "" _git_WC_BRANCH "${_git_WC_BRANCH}") -IF(NOT "${_git_WC_BRANCH}" STREQUAL "") - SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_git_WC_BRANCH}") -ENDIF() +if(NOT "${_git_WC_BRANCH}" STREQUAL "") + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_git_WC_BRANCH}") +endif() # # Append config file name to CTEST_BUILD_NAME: # -IF(NOT "${CONFIG_FILE}" STREQUAL "") - GET_FILENAME_COMPONENT(_conf ${CONFIG_FILE} NAME_WE) - STRING(REGEX REPLACE "#.*$" "" _conf ${_conf}) - SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}") -ENDIF() +if(NOT "${CONFIG_FILE}" STREQUAL "") + get_filename_component(_conf ${CONFIG_FILE} NAME_WE) + string(REGEX REPLACE "#.*$" "" _conf ${_conf}) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}") +endif() # # Append DESCRIPTION string to CTEST_BUILD_NAME: # -IF(NOT "${DESCRIPTION}" STREQUAL "") - SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${DESCRIPTION}") -ENDIF() +if(NOT "${DESCRIPTION}" STREQUAL "") + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${DESCRIPTION}") +endif() -MESSAGE("-- CTEST_BUILD_NAME: ${CTEST_BUILD_NAME}") +message("-- CTEST_BUILD_NAME: ${CTEST_BUILD_NAME}") # # Declare files that should be submitted as notes: # -SET(CTEST_NOTES_FILES +set(CTEST_NOTES_FILES ${CTEST_BINARY_DIRECTORY}/revision.log ${CTEST_BINARY_DIRECTORY}/summary.log ${CTEST_BINARY_DIRECTORY}/detailed.log @@ -405,97 +405,97 @@ SET(CTEST_NOTES_FILES # Setup coverage: # -IF(COVERAGE) - IF(NOT TRACK MATCHES "Experimental") - MESSAGE(FATAL_ERROR " +if(COVERAGE) + if(NOT TRACK MATCHES "Experimental") + message(FATAL_ERROR " TRACK must be set to \"Experimental\" if Coverage is enabled via COVERAGE=TRUE. " ) - ENDIF() + endif() - IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - FIND_PROGRAM(GCOV_COMMAND NAMES llvm-cov) - SET(GCOV_COMMAND "${GCOV_COMMAND} gcov") - IF(GCOV_COMMAND MATCHES "-NOTFOUND") - MESSAGE(FATAL_ERROR "Coverage enabled but could not find the + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + find_program(GCOV_COMMAND NAMES llvm-cov) + set(GCOV_COMMAND "${GCOV_COMMAND} gcov") + if(GCOV_COMMAND MATCHES "-NOTFOUND") + message(FATAL_ERROR "Coverage enabled but could not find the llvm-cov executable, which is part of LLVM.") - ENDIF() - ELSE() - FIND_PROGRAM(GCOV_COMMAND NAMES gcov) - IF(GCOV_COMMAND MATCHES "-NOTFOUND") - MESSAGE(FATAL_ERROR "Coverage enabled but could not find the + endif() + else() + find_program(GCOV_COMMAND NAMES gcov) + if(GCOV_COMMAND MATCHES "-NOTFOUND") + message(FATAL_ERROR "Coverage enabled but could not find the gcov executable, which is part of the GNU Compiler Collection.") - ENDIF() - ENDIF() + endif() + endif() - SET(CTEST_COVERAGE_COMMAND "${GCOV_COMMAND}") -ENDIF() + set(CTEST_COVERAGE_COMMAND "${GCOV_COMMAND}") +endif() -MESSAGE("-- COVERAGE: ${COVERAGE}") +message("-- COVERAGE: ${COVERAGE}") # # Setup memcheck: # -IF(MEMORYCHECK) - IF(NOT TRACK MATCHES "Experimental") - MESSAGE(FATAL_ERROR " +if(MEMORYCHECK) + if(NOT TRACK MATCHES "Experimental") + message(FATAL_ERROR " TRACK must be set to \"Experimental\" if Memcheck is enabled via MEMORYCHECK=TRUE. " ) - ENDIF() + endif() - FIND_PROGRAM(MEMORYCHECK_COMMAND NAMES valgrind) - IF(MEMORYCOMMAND MATCHES "-NOTFOUND") - MESSAGE(FATAL_ERROR " + find_program(MEMORYCHECK_COMMAND NAMES valgrind) + if(MEMORYCOMMAND MATCHES "-NOTFOUND") + message(FATAL_ERROR " Memcheck enabled but could not find the valgrind executable. Please install valgrind. " ) - ENDIF() + endif() - SET(CTEST_MEMORYCHECK_COMMAND "${MEMORYCHECK_COMMAND}") -ENDIF() + set(CTEST_MEMORYCHECK_COMMAND "${MEMORYCHECK_COMMAND}") +endif() -MESSAGE("-- MEMORYCHECK: ${MEMORYCHECK}") +message("-- MEMORYCHECK: ${MEMORYCHECK}") -MACRO(CREATE_TARGETDIRECTORIES_TXT) +macro(CREATE_TARGETDIRECTORIES_TXT) # # It gets tricky: Fake a TargetDirectories.txt containing _all_ target # directories (of the main project and all subprojects) so that the - # CTEST_COVERAGE() actually picks everything up... + # ctest_coverage() actually picks everything up... # - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt.bck ) - FILE(GLOB _subprojects ${CTEST_BINARY_DIRECTORY}/tests/*) - FOREACH(_subproject ${_subprojects}) - IF(EXISTS ${_subproject}/CMakeFiles/TargetDirectories.txt) - FILE(READ ${_subproject}/CMakeFiles/TargetDirectories.txt _var) - FILE(APPEND ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt ${_var}) - ENDIF() - ENDFOREACH() -ENDMACRO() - -MACRO(CLEAR_TARGETDIRECTORIES_TXT) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E rename + file(GLOB _subprojects ${CTEST_BINARY_DIRECTORY}/tests/*) + foreach(_subproject ${_subprojects}) + if(EXISTS ${_subproject}/CMakeFiles/TargetDirectories.txt) + file(READ ${_subproject}/CMakeFiles/TargetDirectories.txt _var) + file(APPEND ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt ${_var}) + endif() + endforeach() +endmacro() + +macro(CLEAR_TARGETDIRECTORIES_TXT) + execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt.bck ${CTEST_BINARY_DIRECTORY}/CMakeFiles/TargetDirectories.txt ) -ENDMACRO() +endmacro() -MESSAGE("-- CMake Options: ${_options}") +message("-- CMake Options: ${_options}") -IF(NOT "${MAKEOPTS}" STREQUAL "") - MESSAGE("-- MAKEOPTS: ${MAKEOPTS}") -ENDIF() +if(NOT "${MAKEOPTS}" STREQUAL "") + message("-- MAKEOPTS: ${MAKEOPTS}") +endif() ######################################################################## @@ -504,27 +504,27 @@ ENDIF() # # ######################################################################## -CTEST_START(Experimental TRACK ${TRACK}) +ctest_start(Experimental TRACK ${TRACK}) -MESSAGE("-- Running CTEST_UPDATE() to query git information") -CTEST_UPDATE(SOURCE ${CTEST_SOURCE_DIRECTORY}) +message("-- Running ctest_update() to query git information") +ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY}) -MESSAGE("-- Running CTEST_CONFIGURE()") -CTEST_CONFIGURE(OPTIONS "${_options}" RETURN_VALUE _res) +message("-- Running ctest_configure()") +ctest_configure(OPTIONS "${_options}" RETURN_VALUE _res) -IF("${_res}" STREQUAL "0") +if("${_res}" STREQUAL "0") # Only run the build stage if configure was successful: - MESSAGE("-- Running CTEST_BUILD()") - SET(CTEST_BUILD_FLAGS "${MAKEOPTS}") - CTEST_BUILD(NUMBER_ERRORS _res) + message("-- Running ctest_build()") + set(CTEST_BUILD_FLAGS "${MAKEOPTS}") + ctest_build(NUMBER_ERRORS _res) - IF("${_res}" STREQUAL "0") + if("${_res}" STREQUAL "0") # Only run tests if the build was successful: - IF(ENABLE_PERFORMANCE_TESTS) - MESSAGE("-- Running prune_tests") - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} + if(ENABLE_PERFORMANCE_TESTS) + message("-- Running prune_tests") + execute_process(COMMAND ${CMAKE_COMMAND} --build . --target prune_tests -- ${MAKEOPTS} WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} @@ -532,20 +532,20 @@ IF("${_res}" STREQUAL "0") RESULT_VARIABLE _res ) - IF(NOT "${_res}" STREQUAL "0") - MESSAGE(FATAL_ERROR " + if(NOT "${_res}" STREQUAL "0") + message(FATAL_ERROR " \"prune_tests\" target exited with an error. Bailing out. " ) - ENDIF() + endif() - SET(_target setup_tests_performance) - ELSE() - SET(_target setup_tests) - ENDIF() + set(_target setup_tests_performance) + else() + set(_target setup_tests) + endif() - MESSAGE("-- Running ${_target}") - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} + message("-- Running ${_target}") + execute_process(COMMAND ${CMAKE_COMMAND} --build . --target ${_target} -- ${MAKEOPTS} WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} @@ -553,77 +553,77 @@ IF("${_res}" STREQUAL "0") RESULT_VARIABLE _res ) - IF(NOT "${_res}" STREQUAL "0") - MESSAGE(FATAL_ERROR " + if(NOT "${_res}" STREQUAL "0") + message(FATAL_ERROR " \"setup_tests\" target exited with an error. Bailing out. " ) - ENDIF() - - IF(DEAL_II_MSVC) - SET(CTEST_BUILD_CONFIGURATION "${JOB_BUILD_CONFIGURATION}") - ENDIF() - IF(MEMORYCHECK) - MESSAGE("-- Running CTEST_MEMCHECK()") - CTEST_MEMCHECK() - ELSE() - MESSAGE("-- Running CTEST_TESTS()") - CTEST_TEST() - ENDIF(MEMORYCHECK) - - IF(COVERAGE) + endif() + + if(DEAL_II_MSVC) + set(CTEST_BUILD_CONFIGURATION "${JOB_BUILD_CONFIGURATION}") + endif() + if(MEMORYCHECK) + message("-- Running ctest_memcheck()") + ctest_memcheck() + else() + message("-- Running CTEST_TESTS()") + ctest_test() + endif(MEMORYCHECK) + + if(COVERAGE) CREATE_TARGETDIRECTORIES_TXT() - MESSAGE("-- Running CTEST_COVERAGE()") - CTEST_COVERAGE() - SET (CODE_COV_BASH "${CMAKE_CURRENT_LIST_DIR}/../contrib/utilities/programs/codecov/codecov-bash.sh") - IF (EXISTS ${CODE_COV_BASH}) - MESSAGE("-- Running codecov-bash") - EXECUTE_PROCESS(COMMAND bash "${CODE_COV_BASH}" + message("-- Running ctest_coverage()") + ctest_coverage() + set (CODE_COV_BASH "${CMAKE_CURRENT_LIST_DIR}/../contrib/utilities/programs/codecov/codecov-bash.sh") + if (EXISTS ${CODE_COV_BASH}) + message("-- Running codecov-bash") + execute_process(COMMAND bash "${CODE_COV_BASH}" "-t ac85e7ce-5316-4bc1-a237-2fe724028c7b" "-x '${GCOV_COMMAND}'" OUTPUT_QUIET) - ENDIF() + endif() CLEAR_TARGETDIRECTORIES_TXT() - ENDIF(COVERAGE) + endif(COVERAGE) - ENDIF() -ENDIF() + endif() +endif() # # Inject compiler information and svn revision into xml files: # -FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag LIMIT_COUNT 1) -SET(_path "${CTEST_BINARY_DIRECTORY}/Testing/${_tag}") -IF(NOT EXISTS ${_path}) - MESSAGE(FATAL_ERROR " +file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag LIMIT_COUNT 1) +set(_path "${CTEST_BINARY_DIRECTORY}/Testing/${_tag}") +if(NOT EXISTS ${_path}) + message(FATAL_ERROR " Unable to determine test submission files from TAG. Bailing out. " ) -ENDIF() +endif() # # Create performance test report # -IF(ENABLE_PERFORMANCE_TESTS) - MESSAGE("-- Collecting performance measurements\n") - EXECUTE_PROCESS( +if(ENABLE_PERFORMANCE_TESTS) + message("-- Collecting performance measurements\n") + execute_process( COMMAND bash "${CMAKE_CURRENT_LIST_DIR}/performance/collect_measurements" "${CTEST_SITE}" WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} ) -ENDIF() +endif() # # And finally submit: # -IF(NOT SKIP_SUBMISSION) - MESSAGE("-- Running CTEST_SUBMIT()") - CTEST_SUBMIT(RETURN_VALUE _res) +if(NOT SKIP_SUBMISSION) + message("-- Running ctest_submit()") + ctest_submit(RETURN_VALUE _res) - IF("${_res}" STREQUAL "0") - MESSAGE("-- Submission successful. Goodbye!") - ENDIF() -ENDIF() + if("${_res}" STREQUAL "0") + message("-- Submission successful. Goodbye!") + endif() +endif() # .oO( This script is freaky 606 lines long... ) diff --git a/tests/sacado/CMakeLists.txt b/tests/sacado/CMakeLists.txt index 687ee9fdba..ff37630485 100644 --- a/tests/sacado/CMakeLists.txt +++ b/tests/sacado/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_SACADO) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_SACADO) + deal_ii_pickup_tests() +endif() diff --git a/tests/scalapack/CMakeLists.txt b/tests/scalapack/CMakeLists.txt index 69a154be57..f6cbe9bf86 100644 --- a/tests/scalapack/CMakeLists.txt +++ b/tests/scalapack/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_SCALAPACK) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_SCALAPACK) + deal_ii_pickup_tests() +endif() diff --git a/tests/serialization/CMakeLists.txt b/tests/serialization/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/serialization/CMakeLists.txt +++ b/tests/serialization/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/setup_testsubproject.cmake b/tests/setup_testsubproject.cmake index 30ecc17103..5f2ba713a3 100644 --- a/tests/setup_testsubproject.cmake +++ b/tests/setup_testsubproject.cmake @@ -1,21 +1,21 @@ -FIND_PACKAGE(deal.II 9.2.0 REQUIRED HINTS ${DEAL_II_DIR}) +find_package(deal.II 9.2.0 REQUIRED HINTS ${DEAL_II_DIR}) -SET(CMAKE_BUILD_TYPE ${DEAL_II_BUILD_TYPE} CACHE STRING "" FORCE) -DEAL_II_INITIALIZE_CACHED_VARIABLES() +set(CMAKE_BUILD_TYPE ${DEAL_II_BUILD_TYPE} CACHE STRING "" FORCE) +deal_ii_initialize_cached_variables() -FOREACH(_var +foreach(_var DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT TEST_MPI_RANK_LIMIT TEST_THREAD_LIMIT ENABLE_PERFORMANCE_TESTS TESTING_ENVIRONMENT ) - SET_IF_EMPTY(${_var} "$ENV{${_var}}") - SET(${_var} "${${_var}}" CACHE STRING "" FORCE) -ENDFOREACH() + set_if_empty(${_var} "$ENV{${_var}}") + set(${_var} "${${_var}}" CACHE STRING "" FORCE) +endforeach() -PROJECT(TESTSUITE CXX) +project(TESTSUITE CXX) # # A custom target that does absolutely nothing. It is used in the main # project to trigger a "make rebuild_cache" if necessary. # -ADD_CUSTOM_TARGET(regenerate) +add_custom_target(regenerate) diff --git a/tests/sharedtria/CMakeLists.txt b/tests/sharedtria/CMakeLists.txt index 7ba24ebac7..7bf3ce0dee 100644 --- a/tests/sharedtria/CMakeLists.txt +++ b/tests/sharedtria/CMakeLists.txt @@ -1,5 +1,5 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -INCLUDE(${DEAL_II_TARGET_CONFIG}) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +include(${DEAL_II_TARGET_CONFIG}) +deal_ii_pickup_tests() diff --git a/tests/simplex/CMakeLists.txt b/tests/simplex/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/simplex/CMakeLists.txt +++ b/tests/simplex/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/slepc/CMakeLists.txt b/tests/slepc/CMakeLists.txt index 6947d4fbf0..2d680d14ec 100644 --- a/tests/slepc/CMakeLists.txt +++ b/tests/slepc/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC AND NOT DEAL_II_PETSC_WITH_COMPLEX) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC AND NOT DEAL_II_PETSC_WITH_COMPLEX) + deal_ii_pickup_tests() +endif() diff --git a/tests/slepc_complex/CMakeLists.txt b/tests/slepc_complex/CMakeLists.txt index 6d99670d51..3c4d27e0c3 100644 --- a/tests/slepc_complex/CMakeLists.txt +++ b/tests/slepc_complex/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC AND PETSC_WITH_COMPLEX) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_PETSC AND DEAL_II_WITH_SLEPC AND PETSC_WITH_COMPLEX) + deal_ii_pickup_tests() +endif() diff --git a/tests/sparsity/CMakeLists.txt b/tests/sparsity/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/sparsity/CMakeLists.txt +++ b/tests/sparsity/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/submit_results.cmake b/tests/submit_results.cmake index 071a8e6c2a..f6e9d136f9 100644 --- a/tests/submit_results.cmake +++ b/tests/submit_results.cmake @@ -26,28 +26,28 @@ # CTestConfig.cmake # -IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "") - GET_FILENAME_COMPONENT(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PATH) - IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) - SET(CTEST_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - ENDIF() -ENDIF() +if("${CTEST_SOURCE_DIRECTORY}" STREQUAL "") + get_filename_component(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PATH) + if(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) + set(CTEST_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + endif() +endif() -MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}") +message("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}") -SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +set(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -MESSAGE("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") +message("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") -FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag) -LIST(GET _tag 1 _track) +file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag) +list(GET _tag 1 _track) -IF("${_track}" STREQUAL "") - MESSAGE(FATAL_ERROR " +if("${_track}" STREQUAL "") + message(FATAL_ERROR " No test results found. Bailing out. " ) -ENDIF() +endif() -CTEST_START(Experimental TRACK ${_track} APPEND) -CTEST_SUBMIT() +ctest_start(Experimental TRACK ${_track} APPEND) +ctest_submit() diff --git a/tests/sundials/CMakeLists.txt b/tests/sundials/CMakeLists.txt index 4eb371e4b7..17379b25a6 100644 --- a/tests/sundials/CMakeLists.txt +++ b/tests/sundials/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_SUNDIALS) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_SUNDIALS) + deal_ii_pickup_tests() +endif() diff --git a/tests/symengine/CMakeLists.txt b/tests/symengine/CMakeLists.txt index cd8b9b0193..0108ac42a1 100644 --- a/tests/symengine/CMakeLists.txt +++ b/tests/symengine/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_SYMENGINE) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_SYMENGINE) + deal_ii_pickup_tests() +endif() diff --git a/tests/tensors/CMakeLists.txt b/tests/tensors/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/tensors/CMakeLists.txt +++ b/tests/tensors/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/trilinos/CMakeLists.txt b/tests/trilinos/CMakeLists.txt index cff79bdd2e..fac8285c5e 100644 --- a/tests/trilinos/CMakeLists.txt +++ b/tests/trilinos/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_TRILINOS) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_TRILINOS) + deal_ii_pickup_tests() +endif() diff --git a/tests/umfpack/CMakeLists.txt b/tests/umfpack/CMakeLists.txt index c29acd86a0..2eb72737f4 100644 --- a/tests/umfpack/CMakeLists.txt +++ b/tests/umfpack/CMakeLists.txt @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -IF(DEAL_II_WITH_UMFPACK) - DEAL_II_PICKUP_TESTS() -ENDIF() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +if(DEAL_II_WITH_UMFPACK) + deal_ii_pickup_tests() +endif() diff --git a/tests/vector/CMakeLists.txt b/tests/vector/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/vector/CMakeLists.txt +++ b/tests/vector/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/vector_tools/CMakeLists.txt b/tests/vector_tools/CMakeLists.txt index dc796d946c..b18daa7f53 100644 --- a/tests/vector_tools/CMakeLists.txt +++ b/tests/vector_tools/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) -DEAL_II_PICKUP_TESTS() +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) +deal_ii_pickup_tests() diff --git a/tests/zoltan/CMakeLists.txt b/tests/zoltan/CMakeLists.txt index 4e5276c8d3..da50a41287 100644 --- a/tests/zoltan/CMakeLists.txt +++ b/tests/zoltan/CMakeLists.txt @@ -1,7 +1,7 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0) -INCLUDE(../setup_testsubproject.cmake) -PROJECT(testsuite CXX) +cmake_minimum_required(VERSION 3.3.0) +include(../setup_testsubproject.cmake) +project(testsuite CXX) -IF(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_ZOLTAN) - DEAL_II_PICKUP_TESTS() -ENDIF() +if(DEAL_II_WITH_TRILINOS AND DEAL_II_TRILINOS_WITH_ZOLTAN) + deal_ii_pickup_tests() +endif() -- 2.39.5