-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
35 lines (26 loc) · 1.08 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
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(openfpm_vcluster LANGUAGES C CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake_modules/)
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CUDA_STANDARD 14)
if(MPI_FOUND)
get_filename_component(OPENFPM_MPI_DEP "${MPI_C_INCLUDE_DIRS}" DIRECTORY)
set(CMAKE_OPENFPM_CONFIG_VARS "${CMAKE_OPENFPM_CONFIG_VARS}\nset(CMAKE_PREFIX_PATH ${OPENFPM_MPI_DEP}/)")
set(DEFINE_HAVE_MPI "#define HAVE_MPI")
else()
message( FATAL_ERROR "MPI is required in order to install OpenFPM" )
endif()
if (ENABLE_VCLUSTER_GARBAGE_INJECTOR)
set(DEFINE_VCLUSTER_GARBAGE_INJECTOR "#define VCLUSTER_GARBAGE_INJECTOR")
endif()
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_subdirectory(src)
get_directory_property(hasParent PARENT_DIRECTORY)
if(hasParent)
set(DEFINE_VCLUSTER_GARBAGE_INJECTOR ${DEFINE_VCLUSTER_GARBAGE_INJECTOR} CACHE INTERNAL "")
set(DEFINE_HAVE_MPI ${DEFINE_HAVE_MPI} CACHE INTERNAL "")
set(CMAKE_OPENFPM_CONFIG_VARS ${CMAKE_OPENFPM_CONFIG_VARS} CACHE INTERNAL "")
endif()