-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
33 lines (26 loc) · 982 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# project settings
cmake_minimum_required(VERSION 3.12)
# C only for Cabana HDF5 workaround.
project(ExaMPM LANGUAGES CXX C VERSION 0.1.0)
include(GNUInstallDirs)
# find dependencies
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(Cabana 0.6.1 REQUIRED COMPONENTS Cabana::Grid Cabana::Core)
if( NOT Cabana_ENABLE_MPI )
message( FATAL_ERROR "Cabana must be compiled with MPI" )
endif()
# find Clang Format
find_package( CLANG_FORMAT 14 )
# library
add_subdirectory(src)
# examples
add_subdirectory(examples)
##---------------------------------------------------------------------------##
## Clang Format
##---------------------------------------------------------------------------##
if(CLANG_FORMAT_FOUND)
file(GLOB_RECURSE FORMAT_SOURCES src/*.cpp src/*.hpp examples/*.cpp examples/*.hpp)
add_custom_target(format
COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file ${FORMAT_SOURCES}
DEPENDS ${FORMAT_SOURCES})
endif()