Skip to content

Commit

Permalink
Improve build system
Browse files Browse the repository at this point in the history
  • Loading branch information
Rombur committed Jan 24, 2024
1 parent b71a706 commit 0d67bb3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ cmake_minimum_required(VERSION 3.15)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(SetupDealII)

# This needs to be called before project is called and before we setup the other
# TPL and adamantine
DEAL_II_INITIALIZE_CACHED_VARIABLES()
include(SetupDealII)

project(adamantine LANGUAGES CXX VERSION 0.1.0)

Expand Down
33 changes: 23 additions & 10 deletions cmake/SetupDealII.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
#### deal.II #################################################################
find_package(deal.II 9.5 REQUIRED PATHS ${DEAL_II_DIR})

# If deal.II was configured in DebugRelease mode, then if adamantine was configured
# in Debug mode, we link against the Debug version of deal.II. If adamantine was
# configured in Release mode, we link against the Release version of eal.II
string(FIND "${DEAL_II_LIBRARIES}" "general" SINGLE_DEAL_II)
if (${SINGLE_DEAL_II} EQUAL -1)
if(CMAKE_BUILD_TYPE MATCHES "Release")
set(DEAL_II_LIBRARIES ${DEAL_II_LIBRARIES_RELEASE})
else()
set(DEAL_II_LIBRARIES ${DEAL_II_LIBRARIES_DEBUG})
endif()
deal_ii_initialize_cached_variables()

if(NOT DEAL_II_WITH_CXX17)
message(FATAL_ERROR "deal.II needs to be configured with C++17 support.")
endif()

if(NOT DEAL_II_WITH_MPI)
message(FATAL_ERROR "deal.II needs to be configured with MPI support.")
endif()

if(NOT DEAL_II_WITH_ARBORX)
message(FATAL_ERROR "deal.II needs to be configured with ArborX support.")
endif()

if(NOT DEAL_II_ARBORX_WITH_MPI)
message(FATAL_ERROR "ArborX needs to be configured with MPI support.")
endif()

if(NOT DEAL_II_WITH_P4EST)
message(FATAL_ERROR "deal.II needs to be configured with P4EST support.")
endif()

if(NOT DEAL_II_WITH_TRILINOS)
message(FATAL_ERROR "deal.II needs to be configured with Trilinos support.")
endif()

0 comments on commit 0d67bb3

Please sign in to comment.