-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
52 lines (40 loc) · 1.57 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 3.16)
project(
bmpi3
VERSION 0.79.0
DESCRIPTION
"B-MPI3 is a C++ library wrapper for version 3.1 of the MPI standard interface that simplifies the utilization and maintenance of MPI code."
HOMEPAGE_URL "https://gitlab.com/correaa/boost-mpi3"
LANGUAGES CXX)
find_package(MPI REQUIRED COMPONENTS CXX) # C) # might need to `module load
# mpi`
find_package(Boost COMPONENTS serialization)
add_library(${PROJECT_NAME} INTERFACE)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
target_include_directories(
${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include/mpi3/dummy>)
target_link_libraries(${PROJECT_NAME} INTERFACE MPI::MPI_CXX)
target_link_libraries(${PROJECT_NAME} INTERFACE Boost::serialization)
# ~~~
# to use this project directly from CMake
# FetchContent_Declare(
# bmpi3
# GIT_REPOSITORY [email protected]:correaa/boost-mpi3.git # https://gitlab.com/correaa/boost-mpi3.git
# GIT_TAG master)
# FetchContent_MakeAvailable(bmpi3)
# add_executable(main main.cpp)
# target_link_libraries(main PUBLIC bmpi3)
# ~~~
# this makes CM FetchContent friendly
# https://www.foonathan.net/2022/06/cmake-fetchcontent/
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
return()
endif()
include(GNUInstallDirs)
include(CTest)
enable_testing()
add_subdirectory(include/mpi3/adaptors/fftw)
add_subdirectory(test)