Skip to content

Commit

Permalink
add fastscapelib cmake config
Browse files Browse the repository at this point in the history
  • Loading branch information
benbovy committed Jan 15, 2025
1 parent cb0ab0d commit 557029e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,28 @@ if(ASPECT_WITH_FASTSCAPE)
endif()


# Fastscapelib (C++)
set(ASPECT_WITH_FASTSCAPELIB OFF CACHE BOOL "Whether the user wants to compile ASPECT with the landscape evolution C++ code Fastscape(lib), or not.")
message(STATUS "Using ASPECT_WITH_FASTSCAPELIB = '${ASPECT_WITH_FASTSCAPE}'")
if(ASPECT_WITH_FASTSCAPELIB)
find_package(fastscapelib CONFIG)
if(${fastscapelib_FOUND})
message(STATUS "Using ASPECT_WITH_FASTSCAPELIB = '${ASPECT_WITH_FASTSCAPELIB}'")
message(STATUS " fastscapelib_INCLUDE_DIR: ${fastscapelib_INCLUDE_DIRS}")
message(STATUS " fastscapelib_VERSION: ${fastscapelib_VERSION}")
# fastscapelib dependencies
find_package(xtensor REQUIRED)
message(STATUS " xtensor_INCLUDE_DIR: ${xtensor_INCLUDE_DIRS}")
message(STATUS " xtensor_VERSION: ${xtensor_VERSION}")
else()
message(STATUS "Fastscapelib not found. Disabling ASPECT_WITH_FASTSCAPELIB. You can specify a hint to your installation directory with fastscapelib_DIR.")
set(ASPECT_WITH_FASTSCAPELIB OFF CACHE BOOL "" FORCE)
endif()
else()
message(STATUS "Using ASPECT_WITH_FASTSCAPELIB = 'OFF'")
endif()


# NetCDF (c including parallel)
set(ASPECT_WITH_NETCDF ON CACHE BOOL "Check if the user wants to compile ASPECT with the NetCDF libraries.")

Expand Down Expand Up @@ -882,6 +904,15 @@ if (FASTSCAPE)
endforeach()
endif()

# Fastscapelib
if (${fastscapelib_FOUND})
message(STATUS "Linking ASPECT against Fastscapelib (header-only)")
foreach(_T ${TARGET_EXECUTABLES})
target_include_directories(${_T} PRIVATE ${fastscapelib_INCLUDE_DIRS})
target_include_directories(${_T} PRIVATE ${xtensor_INCLUDE_DIRS})
endforeach()
endif()

# NetCDF
if(${NETCDF_FOUND})
message(STATUS "Linking ASPECT against NetCDF")
Expand Down

0 comments on commit 557029e

Please sign in to comment.