-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
72 lines (50 loc) · 1.82 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required (VERSION 3.5)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)
project (corgi)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
add_subdirectory(pybind11)
add_subdirectory(mpi4cpp)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/mpi4cpp/include )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/mpi4cpp/tools/optional-lite/include )
##################################################
# dependencies
# hpc stuff
find_package (MPI)
#find_package (OpenMP)
#if (OpenMP_FOUND)
##set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
#endif (OpenMP_FOUND)
##################################################
# targets build
#--------------------------------------------------
# Warning flags based on the compiler
set (WARNING_FLAGS
$<$<CXX_COMPILER_ID:GNU>:
-Wall -Wextra -Wpedantic
>
$<$<CXX_COMPILER_ID:Clang>:
-Wall -Wextra -Wpedantic -Wno-missing-braces
>
)
#--------------------------------------------------
add_subdirectory(pycorgi)
add_subdirectory(tests)
add_subdirectory(examples/game-of-life)
add_subdirectory(examples/particles)
#--------------------------------------------------
# unit tests
#
if(DEFINED Python_EXECUTABLE AND NOT DEFINED PYTHON_EXECUTABLE)
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
endif()
message(STATUS "Corgi tests ran with python: ${PYTHON_EXECUTABLE}")
add_custom_target(check-pycorgi ALL
${PYTHON_EXECUTABLE} -m unittest discover -s ../tests/ -v
DEPENDS pycorgi pycorgitest
VERBATIM
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib
)