-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
48 lines (39 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 2.8)
set(PROJECT_NAME "ddti")
project(${PROJECT_NAME})
include(ExternalProject)
include(CheckIncludeFileCXX)
# MPI
find_package(MPI REQUIRED)
if (MPI_FOUND)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
else (MPI_FOUND)
message(SEND_ERROR "This application cannot compile without MPI")
endif (MPI_FOUND)
include_directories(
srcs/
srcs/master
srcs/slave
srcs/exceptions
srcs/utils
srcs/utils/mpi
)
set(LIBS
mlpack
boost_program_options
${MPI_LIBRARIES}
)
file(GLOB sources
srcs/*.cpp
srcs/master/*.cpp
srcs/slave/*.cpp
srcs/utils/*.cpp
srcs/utils/mpi/*.cpp
srcs/exceptions/*.cpp
)
set(SOURCES ${sources})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
add_executable(${PROJECT_NAME} ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++14 -W -Wall -Wextra")
target_link_libraries(${PROJECT_NAME} ${LIBS})