From 0ab26a2839a902802e532e70b76a5dfbdcb43368 Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Mon, 27 Nov 2023 10:19:56 +0100 Subject: [PATCH] Apply to CMakeLists.txt --- cpp/CMakeLists.txt | 52 ++++++++-------- cpp/demo/hyperelasticity/CMakeLists.txt | 6 +- cpp/demo/interpolation-io/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- cpp/demo/mixed_topology/CMakeLists.txt | 2 +- cpp/demo/poisson/CMakeLists.txt | 4 +- cpp/demo/poisson_matrix_free/CMakeLists.txt | 4 +- cpp/dolfinx/common/CMakeLists.txt | 54 ++++++++--------- cpp/dolfinx/fem/CMakeLists.txt | 60 +++++++++---------- cpp/dolfinx/geometry/CMakeLists.txt | 11 ++-- cpp/dolfinx/graph/CMakeLists.txt | 16 ++--- cpp/dolfinx/io/CMakeLists.txt | 38 ++++++------ cpp/dolfinx/refinement/CMakeLists.txt | 14 ++--- cpp/test/CMakeLists.txt | 14 +++-- python/CMakeLists.txt | 27 +++++---- 15 files changed, 159 insertions(+), 147 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d4956615bf9..c371f3d2eae 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -7,8 +7,8 @@ cmake_minimum_required(VERSION 3.19) project(DOLFINX VERSION "0.8.0.0") set(DOXYGEN_DOLFINX_VERSION - ${DOLFINX_VERSION} - CACHE STRING "Version for Doxygen" FORCE + ${DOLFINX_VERSION} + CACHE STRING "Version for Doxygen" FORCE ) # ------------------------------------------------------------------------------ @@ -56,7 +56,7 @@ add_feature_info( ) option(DOLFINX_SKIP_BUILD_TESTS - "Skip build tests for testing usability of dependency packages." OFF + "Skip build tests for testing usability of dependency packages." OFF ) add_feature_info( DOLFINX_SKIP_BUILD_TESTS DOLFINX_SKIP_BUILD_TESTS @@ -65,7 +65,7 @@ add_feature_info( # Add shared library paths so shared libs in non-system paths are found option(CMAKE_INSTALL_RPATH_USE_LINK_PATH - "Add paths to linker search and installed rpath." ON + "Add paths to linker search and installed rpath." ON ) add_feature_info( CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_INSTALL_RPATH_USE_LINK_PATH @@ -104,11 +104,11 @@ find_package(MPI 3 REQUIRED) # Default build type (can be overridden by user) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE - "RelWithDebInfo" - CACHE - STRING - "Choose the type of build, options are: Debug Developer MinSizeRel Release RelWithDebInfo." - FORCE + "RelWithDebInfo" + CACHE + STRING + "Choose the type of build, options are: Debug Developer MinSizeRel Release RelWithDebInfo." + FORCE ) endif() @@ -172,11 +172,11 @@ find_package( # Check for Basix Note: Basix may be installed as a standalone C++ library, or # in the Basix Python module tree if(Python3_Interpreter_FOUND) - MESSAGE(STATUS "Checking for basix hints with ${Python3_EXECUTABLE}") + message(STATUS "Checking for basix hints with ${Python3_EXECUTABLE}") execute_process( COMMAND - ${Python3_EXECUTABLE} -c - "import basix, os, sys; sys.stdout.write(os.path.dirname(basix.__file__))" + ${Python3_EXECUTABLE} -c + "import basix, os, sys; sys.stdout.write(os.path.dirname(basix.__file__))" OUTPUT_VARIABLE BASIX_PY_DIR RESULT_VARIABLE BASIX_PY_COMMAND_RESULT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE @@ -203,7 +203,7 @@ set_package_properties( # Check for PETSc find_package(PkgConfig REQUIRED) set(ENV{PKG_CONFIG_PATH} - "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" + "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" ) pkg_search_module(PETSC REQUIRED IMPORTED_TARGET PETSc>=3.15 petsc>=3.15) @@ -215,7 +215,9 @@ check_symbol_exists(PETSC_USE_COMPLEX petscsystypes.h HAVE_PETSC_SCALAR_COMPLEX) # Setting for FeatureSummary if(PETSC_FOUND) - message(STATUS "Found PETSc version ${PETSC_VERSION}, prefix: ${PETSC_PREFIX}") + message( + STATUS "Found PETSc version ${PETSC_VERSION}, prefix: ${PETSC_PREFIX}" + ) set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND PETSc) else() set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND PETSc) @@ -237,7 +239,7 @@ find_package(HDF5 REQUIRED COMPONENTS C) if(NOT HDF5_IS_PARALLEL) message( FATAL_ERROR - "Found serial HDF5 build, MPI HDF5 build required, try setting HDF5_DIR or HDF5_ROOT" + "Found serial HDF5 build, MPI HDF5 build required, try setting HDF5_DIR or HDF5_ROOT" ) endif() @@ -287,19 +289,21 @@ set_package_properties( if(DOLFINX_ENABLE_SLEPC) find_package(PkgConfig REQUIRED) set(ENV{PKG_CONFIG_PATH} - "$ENV{SLEPC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{SLEPC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" + "$ENV{SLEPC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{SLEPC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" ) set(ENV{PKG_CONFIG_PATH} - "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" + "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PETSC_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}" ) set(ENV{PKG_CONFIG_PATH} - "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}:$ENV{PETSC_DIR}:$ENV{PKG_CONFIG_PATH}" + "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}:$ENV{PETSC_DIR}:$ENV{PKG_CONFIG_PATH}" ) pkg_search_module(SLEPC IMPORTED_TARGET slepc>=3.15) # Setting for FeatureSummary if(SLEPC_FOUND) - message(STATUS "Found SLEPc version ${SLEPC_VERSION}, prefix: ${SLEPC_PREFIX}") + message( + STATUS "Found SLEPc version ${SLEPC_VERSION}, prefix: ${SLEPC_PREFIX}" + ) set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND SLEPc) else() set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND SLEPc) @@ -322,7 +326,7 @@ set_package_properties( SCOTCH PROPERTIES TYPE OPTIONAL DESCRIPTION - "Programs and libraries for graph, mesh and hypergraph partitioning" + "Programs and libraries for graph, mesh and hypergraph partitioning" URL "https://www.labri.fr/perso/pelegrin/scotch" PURPOSE "Parallel graph partitioning" ) @@ -353,12 +357,12 @@ set_package_properties( # Check that at least one graph partitioner has been found if(NOT SCOTCH_FOUND - AND NOT PARMETIS_FOUND - AND NOT KAHIP_FOUND + AND NOT PARMETIS_FOUND + AND NOT KAHIP_FOUND ) message( FATAL_ERROR - "No graph partitioner found. SCOTCH, ParMETIS or KaHIP is required." + "No graph partitioner found. SCOTCH, ParMETIS or KaHIP is required." ) endif() @@ -417,7 +421,7 @@ configure_file( add_custom_target( uninstall "${CMAKE_COMMAND}" -P - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" ) # ------------------------------------------------------------------------------ diff --git a/cpp/demo/hyperelasticity/CMakeLists.txt b/cpp/demo/hyperelasticity/CMakeLists.txt index 2db3fc68ba6..5b8d87c6cf4 100644 --- a/cpp/demo/hyperelasticity/CMakeLists.txt +++ b/cpp/demo/hyperelasticity/CMakeLists.txt @@ -19,7 +19,7 @@ endif() include(CheckSymbolExists) set(CMAKE_REQUIRED_INCLUDES ${PETSC_INCLUDE_DIRS}) check_symbol_exists(PETSC_USE_COMPLEX petscsystypes.h PETSC_SCALAR_COMPLEX) -if (PETSC_SCALAR_COMPLEX EQUAL 1) +if(PETSC_SCALAR_COMPLEX EQUAL 1) message(STATUS "** This demo does not support complex mode") else() check_symbol_exists(PETSC_USE_REAL_DOUBLE petscsystypes.h PETSC_REAL_DOUBLE) @@ -40,7 +40,9 @@ else() set(CMAKE_INCLUDE_CURRENT_DIR ON) - add_executable(${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/hyperelasticity.c) + add_executable( + ${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/hyperelasticity.c + ) target_link_libraries(${PROJECT_NAME} dolfinx) # Do not throw error for 'multi-line comments' (these are typical in rst which diff --git a/cpp/demo/interpolation-io/CMakeLists.txt b/cpp/demo/interpolation-io/CMakeLists.txt index 759c4dd5179..bc6eee7bf83 100644 --- a/cpp/demo/interpolation-io/CMakeLists.txt +++ b/cpp/demo/interpolation-io/CMakeLists.txt @@ -1,6 +1,6 @@ # This file was generated by running # -# python cmake/scripts/generate-cmakefiles from dolfinx/cpp +# python cmake/scripts/generate-cmakefiles.py from dolfinx/cpp # cmake_minimum_required(VERSION 3.19) diff --git a/cpp/demo/interpolation_different_meshes/CMakeLists.txt b/cpp/demo/interpolation_different_meshes/CMakeLists.txt index 27eae3b3103..11cd0247a23 100644 --- a/cpp/demo/interpolation_different_meshes/CMakeLists.txt +++ b/cpp/demo/interpolation_different_meshes/CMakeLists.txt @@ -1,6 +1,6 @@ # This file was generated by running # -# python cmake/scripts/generate-cmakefiles from dolfinx/cpp +# python cmake/scripts/generate-cmakefiles.py from dolfinx/cpp # cmake_minimum_required(VERSION 3.19) diff --git a/cpp/demo/mixed_topology/CMakeLists.txt b/cpp/demo/mixed_topology/CMakeLists.txt index a3109f8979f..0c9e0b166c8 100644 --- a/cpp/demo/mixed_topology/CMakeLists.txt +++ b/cpp/demo/mixed_topology/CMakeLists.txt @@ -1,6 +1,6 @@ # This file was generated by running # -# python cmake/scripts/generate-cmakefiles from dolfinx/cpp +# python cmake/scripts/generate-cmakefiles.py from dolfinx/cpp # cmake_minimum_required(VERSION 3.19) diff --git a/cpp/demo/poisson/CMakeLists.txt b/cpp/demo/poisson/CMakeLists.txt index 076562eef9e..d9743c4d58b 100644 --- a/cpp/demo/poisson/CMakeLists.txt +++ b/cpp/demo/poisson/CMakeLists.txt @@ -45,9 +45,7 @@ add_custom_command( set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_executable( - ${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/poisson.c -) +add_executable(${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/poisson.c) target_link_libraries(${PROJECT_NAME} dolfinx) # Do not throw error for 'multi-line comments' (these are typical in rst which diff --git a/cpp/demo/poisson_matrix_free/CMakeLists.txt b/cpp/demo/poisson_matrix_free/CMakeLists.txt index 7f2b143f8c0..805ec9e72b0 100644 --- a/cpp/demo/poisson_matrix_free/CMakeLists.txt +++ b/cpp/demo/poisson_matrix_free/CMakeLists.txt @@ -45,9 +45,7 @@ add_custom_command( set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_executable( - ${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/poisson.c -) +add_executable(${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/poisson.c) target_link_libraries(${PROJECT_NAME} dolfinx) # Do not throw error for 'multi-line comments' (these are typical in rst which diff --git a/cpp/dolfinx/common/CMakeLists.txt b/cpp/dolfinx/common/CMakeLists.txt index 25f85875f5a..7ab6428d6a1 100644 --- a/cpp/dolfinx/common/CMakeLists.txt +++ b/cpp/dolfinx/common/CMakeLists.txt @@ -1,33 +1,33 @@ set(HEADERS_common - ${CMAKE_CURRENT_SOURCE_DIR}/defines.h - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_common.h - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_doc.h - ${CMAKE_CURRENT_SOURCE_DIR}/IndexMap.h - ${CMAKE_CURRENT_SOURCE_DIR}/log.h - ${CMAKE_CURRENT_SOURCE_DIR}/loguru.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/sort.h - ${CMAKE_CURRENT_SOURCE_DIR}/types.h - ${CMAKE_CURRENT_SOURCE_DIR}/math.h - ${CMAKE_CURRENT_SOURCE_DIR}/MPI.h - ${CMAKE_CURRENT_SOURCE_DIR}/Scatterer.h - ${CMAKE_CURRENT_SOURCE_DIR}/Table.h - ${CMAKE_CURRENT_SOURCE_DIR}/Timer.h - ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogger.h - ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogManager.h - ${CMAKE_CURRENT_SOURCE_DIR}/timing.h - ${CMAKE_CURRENT_SOURCE_DIR}/utils.h - PARENT_SCOPE + ${CMAKE_CURRENT_SOURCE_DIR}/defines.h + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_common.h + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_doc.h + ${CMAKE_CURRENT_SOURCE_DIR}/IndexMap.h + ${CMAKE_CURRENT_SOURCE_DIR}/log.h + ${CMAKE_CURRENT_SOURCE_DIR}/loguru.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/sort.h + ${CMAKE_CURRENT_SOURCE_DIR}/types.h + ${CMAKE_CURRENT_SOURCE_DIR}/math.h + ${CMAKE_CURRENT_SOURCE_DIR}/MPI.h + ${CMAKE_CURRENT_SOURCE_DIR}/Scatterer.h + ${CMAKE_CURRENT_SOURCE_DIR}/Table.h + ${CMAKE_CURRENT_SOURCE_DIR}/Timer.h + ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogger.h + ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogManager.h + ${CMAKE_CURRENT_SOURCE_DIR}/timing.h + ${CMAKE_CURRENT_SOURCE_DIR}/utils.h + PARENT_SCOPE ) target_sources( dolfinx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/defines.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/IndexMap.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/MPI.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/Table.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/Timer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogger.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogManager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/timing.cpp -) \ No newline at end of file + ${CMAKE_CURRENT_SOURCE_DIR}/IndexMap.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/MPI.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Table.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Timer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogger.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/TimeLogManager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timing.cpp +) diff --git a/cpp/dolfinx/fem/CMakeLists.txt b/cpp/dolfinx/fem/CMakeLists.txt index 1e22333867c..bc2e88abb0c 100644 --- a/cpp/dolfinx/fem/CMakeLists.txt +++ b/cpp/dolfinx/fem/CMakeLists.txt @@ -1,37 +1,37 @@ set(HEADERS_fem - ${CMAKE_CURRENT_SOURCE_DIR}/Constant.h - ${CMAKE_CURRENT_SOURCE_DIR}/CoordinateElement.h - ${CMAKE_CURRENT_SOURCE_DIR}/DirichletBC.h - ${CMAKE_CURRENT_SOURCE_DIR}/DofMap.h - ${CMAKE_CURRENT_SOURCE_DIR}/ElementDofLayout.h - ${CMAKE_CURRENT_SOURCE_DIR}/Expression.h - ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElement.h - ${CMAKE_CURRENT_SOURCE_DIR}/Form.h - ${CMAKE_CURRENT_SOURCE_DIR}/Function.h - ${CMAKE_CURRENT_SOURCE_DIR}/FunctionSpace.h - ${CMAKE_CURRENT_SOURCE_DIR}/assembler.h - ${CMAKE_CURRENT_SOURCE_DIR}/assemble_matrix_impl.h - ${CMAKE_CURRENT_SOURCE_DIR}/assemble_scalar_impl.h - ${CMAKE_CURRENT_SOURCE_DIR}/assemble_vector_impl.h - ${CMAKE_CURRENT_SOURCE_DIR}/discreteoperators.h - ${CMAKE_CURRENT_SOURCE_DIR}/dofmapbuilder.h - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_fem.h - ${CMAKE_CURRENT_SOURCE_DIR}/interpolate.h - ${CMAKE_CURRENT_SOURCE_DIR}/petsc.h - ${CMAKE_CURRENT_SOURCE_DIR}/sparsitybuild.h - ${CMAKE_CURRENT_SOURCE_DIR}/utils.h - PARENT_SCOPE + ${CMAKE_CURRENT_SOURCE_DIR}/Constant.h + ${CMAKE_CURRENT_SOURCE_DIR}/CoordinateElement.h + ${CMAKE_CURRENT_SOURCE_DIR}/DirichletBC.h + ${CMAKE_CURRENT_SOURCE_DIR}/DofMap.h + ${CMAKE_CURRENT_SOURCE_DIR}/ElementDofLayout.h + ${CMAKE_CURRENT_SOURCE_DIR}/Expression.h + ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElement.h + ${CMAKE_CURRENT_SOURCE_DIR}/Form.h + ${CMAKE_CURRENT_SOURCE_DIR}/Function.h + ${CMAKE_CURRENT_SOURCE_DIR}/FunctionSpace.h + ${CMAKE_CURRENT_SOURCE_DIR}/assembler.h + ${CMAKE_CURRENT_SOURCE_DIR}/assemble_matrix_impl.h + ${CMAKE_CURRENT_SOURCE_DIR}/assemble_scalar_impl.h + ${CMAKE_CURRENT_SOURCE_DIR}/assemble_vector_impl.h + ${CMAKE_CURRENT_SOURCE_DIR}/discreteoperators.h + ${CMAKE_CURRENT_SOURCE_DIR}/dofmapbuilder.h + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_fem.h + ${CMAKE_CURRENT_SOURCE_DIR}/interpolate.h + ${CMAKE_CURRENT_SOURCE_DIR}/petsc.h + ${CMAKE_CURRENT_SOURCE_DIR}/sparsitybuild.h + ${CMAKE_CURRENT_SOURCE_DIR}/utils.h + PARENT_SCOPE ) target_sources( dolfinx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/DirichletBC.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/CoordinateElement.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/DofMap.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/ElementDofLayout.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElement.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/dofmapbuilder.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/petsc.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/sparsitybuild.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/CoordinateElement.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/DofMap.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ElementDofLayout.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/FiniteElement.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/dofmapbuilder.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/petsc.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/sparsitybuild.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp ) diff --git a/cpp/dolfinx/geometry/CMakeLists.txt b/cpp/dolfinx/geometry/CMakeLists.txt index f11131f47a1..3cd680294b6 100644 --- a/cpp/dolfinx/geometry/CMakeLists.txt +++ b/cpp/dolfinx/geometry/CMakeLists.txt @@ -1,8 +1,7 @@ set(HEADERS_geometry - ${CMAKE_CURRENT_SOURCE_DIR}/BoundingBoxTree.h - ${CMAKE_CURRENT_SOURCE_DIR}/gjk.h - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_geometry.h - ${CMAKE_CURRENT_SOURCE_DIR}/utils.h - PARENT_SCOPE + ${CMAKE_CURRENT_SOURCE_DIR}/BoundingBoxTree.h + ${CMAKE_CURRENT_SOURCE_DIR}/gjk.h + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_geometry.h + ${CMAKE_CURRENT_SOURCE_DIR}/utils.h + PARENT_SCOPE ) - diff --git a/cpp/dolfinx/graph/CMakeLists.txt b/cpp/dolfinx/graph/CMakeLists.txt index 4106f8ce381..49c804330b0 100644 --- a/cpp/dolfinx/graph/CMakeLists.txt +++ b/cpp/dolfinx/graph/CMakeLists.txt @@ -1,15 +1,15 @@ set(HEADERS_graph - ${CMAKE_CURRENT_SOURCE_DIR}/AdjacencyList.h - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_graph.h - ${CMAKE_CURRENT_SOURCE_DIR}/ordering.h - ${CMAKE_CURRENT_SOURCE_DIR}/partitioners.h - ${CMAKE_CURRENT_SOURCE_DIR}/partition.h - PARENT_SCOPE + ${CMAKE_CURRENT_SOURCE_DIR}/AdjacencyList.h + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_graph.h + ${CMAKE_CURRENT_SOURCE_DIR}/ordering.h + ${CMAKE_CURRENT_SOURCE_DIR}/partitioners.h + ${CMAKE_CURRENT_SOURCE_DIR}/partition.h + PARENT_SCOPE ) target_sources( dolfinx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ordering.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/partitioners.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/partition.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/partitioners.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/partition.cpp ) diff --git a/cpp/dolfinx/io/CMakeLists.txt b/cpp/dolfinx/io/CMakeLists.txt index 70e97b366fd..a3060dd6852 100644 --- a/cpp/dolfinx/io/CMakeLists.txt +++ b/cpp/dolfinx/io/CMakeLists.txt @@ -1,26 +1,26 @@ set(HEADERS_io - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_io.h - ${CMAKE_CURRENT_SOURCE_DIR}/ADIOS2Writers.h - ${CMAKE_CURRENT_SOURCE_DIR}/cells.h - ${CMAKE_CURRENT_SOURCE_DIR}/HDF5Interface.h - ${CMAKE_CURRENT_SOURCE_DIR}/vtk_utils.h - ${CMAKE_CURRENT_SOURCE_DIR}/VTKFile.h - ${CMAKE_CURRENT_SOURCE_DIR}/XDMFFile.h - ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_function.h - ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_mesh.h - ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_utils.h - PARENT_SCOPE + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_io.h + ${CMAKE_CURRENT_SOURCE_DIR}/ADIOS2Writers.h + ${CMAKE_CURRENT_SOURCE_DIR}/cells.h + ${CMAKE_CURRENT_SOURCE_DIR}/HDF5Interface.h + ${CMAKE_CURRENT_SOURCE_DIR}/vtk_utils.h + ${CMAKE_CURRENT_SOURCE_DIR}/VTKFile.h + ${CMAKE_CURRENT_SOURCE_DIR}/XDMFFile.h + ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_function.h + ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_mesh.h + ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_utils.h + PARENT_SCOPE ) target_sources( dolfinx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ADIOS2Writers.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/cells.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/HDF5Interface.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/VTKFile.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/vtk_utils.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/XDMFFile.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_function.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_mesh.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_utils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/cells.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/HDF5Interface.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/VTKFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/vtk_utils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/XDMFFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_function.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_mesh.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/xdmf_utils.cpp ) diff --git a/cpp/dolfinx/refinement/CMakeLists.txt b/cpp/dolfinx/refinement/CMakeLists.txt index fb54957f02d..097500018a6 100644 --- a/cpp/dolfinx/refinement/CMakeLists.txt +++ b/cpp/dolfinx/refinement/CMakeLists.txt @@ -1,13 +1,11 @@ set(HEADERS_refinement - ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_refinement.h - ${CMAKE_CURRENT_SOURCE_DIR}/plaza.h - ${CMAKE_CURRENT_SOURCE_DIR}/refine.h - ${CMAKE_CURRENT_SOURCE_DIR}/utils.h - PARENT_SCOPE + ${CMAKE_CURRENT_SOURCE_DIR}/dolfinx_refinement.h + ${CMAKE_CURRENT_SOURCE_DIR}/plaza.h ${CMAKE_CURRENT_SOURCE_DIR}/refine.h + ${CMAKE_CURRENT_SOURCE_DIR}/utils.h + PARENT_SCOPE ) target_sources( - dolfinx - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/plaza.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp + dolfinx PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/plaza.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp ) diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 177a5c5d53b..6f007171b2f 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -30,7 +30,8 @@ if(NOT Catch2_FOUND) FetchContent_MakeAvailable(Catch2) endif() -add_executable(unittests +add_executable( + unittests main.cpp vector.cpp matrix.cpp @@ -40,10 +41,15 @@ add_executable(unittests common/sort.cpp mesh/distributed_mesh.cpp common/CIFailure.cpp - ${CMAKE_CURRENT_BINARY_DIR}/poisson.c) + ${CMAKE_CURRENT_BINARY_DIR}/poisson.c +) target_link_libraries(unittests PRIVATE Catch2::Catch2WithMain dolfinx) -target_include_directories(unittests PRIVATE $) -target_compile_options(unittests PRIVATE $<$:-Wall -Werror -Wextra -pedantic>) +target_include_directories( + unittests PRIVATE $ +) +target_compile_options( + unittests PRIVATE $<$:-Wall -Werror -Wextra -pedantic> +) # Enable testing enable_testing() diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9a6e56b369f..d82ec0cbe49 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -7,21 +7,29 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -find_package(Python COMPONENTS Interpreter Development REQUIRED) +find_package( + Python + COMPONENTS Interpreter Development + REQUIRED +) # Detect the installed nanobind package and import it into CMake execute_process( COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir - OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR) + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE NB_DIR +) list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}") find_package(nanobind CONFIG REQUIRED) execute_process( COMMAND - ${Python3_EXECUTABLE} -c "import os, sys, basix; sys.stdout.write(os.path.dirname(basix.__file__))" + ${Python3_EXECUTABLE} -c + "import os, sys, basix; sys.stdout.write(os.path.dirname(basix.__file__))" OUTPUT_VARIABLE BASIX_PY_DIR RESULT_VARIABLE BASIX_PY_COMMAND_RESULT - ERROR_VARIABLE BASIX_ERROR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE BASIX_ERROR_OUT + OUTPUT_STRIP_TRAILING_WHITESPACE ) find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) @@ -54,20 +62,19 @@ nanobind_add_module( dolfinx/wrappers/refinement.cpp ) -# Add strict compiler flags -# include(CheckCXXCompilerFlag) +# Add strict compiler flags include(CheckCXXCompilerFlag) # check_cxx_compiler_flag("-Wall -Werror -pedantic" HAVE_PEDANTIC) -# if(HAVE_PEDANTIC) -# # target_compile_options(cpp PRIVATE -Wall;-Werror;-pedantic) -# endif() +# if(HAVE_PEDANTIC) # target_compile_options(cpp PRIVATE +# -Wall;-Werror;-pedantic) endif() # Add DOLFINx libraries target_link_libraries(cpp PRIVATE dolfinx) # Check for petsc4py execute_process( - COMMAND ${Python_EXECUTABLE} -c "import petsc4py; print(petsc4py.get_include())" + COMMAND ${Python_EXECUTABLE} -c + "import petsc4py; print(petsc4py.get_include())" OUTPUT_VARIABLE PETSC4PY_INCLUDE_DIR RESULT_VARIABLE PETSC4PY_COMMAND_RESULT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE