-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
34 lines (26 loc) · 1.01 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 2.8)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type")
message(STATUS "No build type selected, default to ${CMAKE_BUILD_TYPE}")
endif()
project(test1)
#----------------------------------------------------------------------------
# Find MPI and OpenMP
#----------------------------------------------------------------------------
find_package(OpenMP)
find_package(MPI QUIET)
include_directories(${MPI_CXX_INCLUDE_PATH})
#----------------------------------------------------------------------------
# Enable C++11 support
#----------------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
enable_testing()
add_executable(mpi mpi.cpp)
target_link_libraries(mpi ${MPI_CXX_LIBRARIES})
add_executable(openmp openmp.cpp)
set_target_properties(openmp PROPERTIES
COMPILE_FLAGS ${OpenMP_CXX_FLAGS}
LINK_FAGS ${OpenMP_CXX_FLAGS}
)
add_test(mpi mpi)
add_test(openmp openmp)