generated from SimoneReale/SE4HPC_project_part2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (24 loc) · 1.14 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
cmake_minimum_required(VERSION 3.10)
project(MatrixMultiplication)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
include_directories(include)
add_subdirectory(googletest)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# non aggiungo matrix_mult che non serve
set(SOURCES src/main.cpp)
add_executable(main ${SOURCES})
target_link_libraries(main ${MPI_LIBRARIES} ${CMAKE_SOURCE_DIR}/lib/libmatrix_multiplication_without_errors.a)
add_executable(test_multiplication test/test_matrix_multiplication.cpp)
target_link_libraries(test_multiplication gtest gtest_main ${CMAKE_SOURCE_DIR}/lib/libmatrix_multiplication_without_errors.a ${MPI_LIBRARIES})
if (MPI_COMPILE_FLAGS)
set_target_properties(main PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
set_target_properties(test_multiplication PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
endif ()
if (MPI_LINK_FLAGS)
set_target_properties(main PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
set_target_properties(test_multiplication PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
endif ()
enable_testing()
include(GoogleTest)
gtest_discover_tests(test_multiplication)