diff --git a/CMakeLists.txt b/CMakeLists.txt index a0a090af11..94c036839a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,16 @@ cmake_minimum_required( VERSION 3.16 ) -include(cmake/GitProjectVersion.cmake) +include( cmake/GitProjectVersion.cmake ) + +project( + T8CODE + DESCRIPTION "Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes." + LANGUAGES C CXX + VERSION "${T8CODE_VERSION_MAJOR}.${T8CODE_VERSION_MINOR}.${T8CODE_VERSION_PATCH}" +) -project( T8CODE - DESCRIPTION "Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes." - LANGUAGES C CXX - VERSION "${T8CODE_VERSION_MAJOR}.${T8CODE_VERSION_MINOR}.${T8CODE_VERSION_PATCH}" ) include( CTest ) +include( CMakeDependentOption ) option( T8CODE_BUILD_AS_SHARED_LIBRARY "Whether t8code should be built as a shared or a static library" ON ) option( T8CODE_BUILD_PEDANTIC "Compile t8code with `-pedantic` as done in the Github CI." OFF ) @@ -14,12 +18,17 @@ option( T8CODE_BUILD_WALL "Compile t8code with `-Wall` as done in the Github CI. option( T8CODE_BUILD_WERROR "Compile t8code with `-Werror` as done in the Github CI." OFF ) option( T8CODE_BUILD_EXTRA_WARNINGS "Compile t8code with extra warnings as done in the Github CI." OFF ) option( T8CODE_EXPORT_COMPILE_COMMANDS "Export the compile commands as json. Can be used by IDEs for code completion (e.g. intellisense, clangd)" OFF ) + option( T8CODE_BUILD_TESTS "Build t8code's automated tests" ON ) -option( T8CODE_BUILD_TUTORIALS "Build t8code's tutorials" ON ) +cmake_dependent_option( T8CODE_BUILD_TPL_TESTS "Build the tests from libsc and p4est" ON "T8CODE_BUILD_TESTS" OFF ) +cmake_dependent_option( T8CODE_ENABLE_LESS_TESTS "Tests not as thoroughly to speed up the test suite. Tests the same functionality. (WARNING: Use with care.)" OFF "T8CODE_BUILD_TESTS" OFF ) + option( T8CODE_BUILD_EXAMPLES "Build t8code's examples" ON ) +cmake_dependent_option( T8CODE_BUILD_TPL_EXAMPLES "Build the examples from libsc and p4est" OFF "T8CODE_BUILD_EXAMPLES" OFF ) + +option( T8CODE_BUILD_TUTORIALS "Build t8code's tutorials" ON ) option( T8CODE_BUILD_BENCHMARKS "Build t8code's benchmarks" ON ) option( T8CODE_BUILD_FORTRAN_INTERFACE "Build t8code's Fortran interface" OFF ) -option( T8CODE_ENABLE_LESS_TESTS "Tests not as thoroughly to speed up the test suite. Tests the same functionality. (WARNING: Use with care.)" OFF ) option( T8CODE_ENABLE_MPI "Enable t8code's features which rely on MPI" ON ) option( T8CODE_ENABLE_VTK "Enable t8code's features which rely on VTK" OFF ) @@ -30,8 +39,6 @@ option( T8CODE_USE_SYSTEM_SC "Use system-installed sc library" OFF ) option( T8CODE_USE_SYSTEM_P4EST "Use system-installed p4est library" OFF ) option( T8CODE_BUILD_DOCUMENTATION "Build t8code's documentation" OFF ) - -include(CMakeDependentOption) cmake_dependent_option( T8CODE_BUILD_DOCUMENTATION_SPHINX "Build t8code's documentation using sphinx" OFF "T8CODE_BUILD_DOCUMENTATION" OFF ) set(T8CODE_CUSTOM_PARALLEL_TEST_COMMAND "" CACHE STRING "Define a custom command for parallel tests , e.g.: mpirun -np 8 (overwrites standard mpirun -np 4 if build with mpi)") @@ -127,12 +134,16 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true) if ( T8CODE_USE_SYSTEM_SC ) find_package( SC REQUIRED PATHS /path/to/system/sc ) else() + set( SC_BUILD_EXAMPLES ${T8CODE_BUILD_TPL_EXAMPLES} ) + set( SC_BUILD_TESTING ${T8CODE_BUILD_TPL_TESTS} ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc ) endif() if ( T8CODE_USE_SYSTEM_P4EST ) find_package( P4EST REQUIRED PATHS /path/to/system/p4est ) else() + set( P4EST_BUILD_EXAMPLES ${T8CODE_BUILD_TPL_EXAMPLES} ) + set( P4EST_BUILD_TESTING ${T8CODE_BUILD_TPL_TESTS} ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est ) endif() diff --git a/p4est b/p4est index 8206f0e56d..851774a0c9 160000 --- a/p4est +++ b/p4est @@ -1 +1 @@ -Subproject commit 8206f0e56d536d6d7f2e1d106c491b8c9386e28f +Subproject commit 851774a0c993aaf6f1719da6fd62c2f3acd761ee diff --git a/sc b/sc index 2b209eab18..1b127f01c5 160000 --- a/sc +++ b/sc @@ -1 +1 @@ -Subproject commit 2b209eab184d2feee7bd146ee580ae3c983b85f4 +Subproject commit 1b127f01c5e472039e938f61201ae0611fb25bad