-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
44 lines (34 loc) · 859 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
cmake_minimum_required(VERSION 3.3)
project(hdf5)
macro(use_cxx11)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
endmacro(use_cxx11)
use_cxx11()
find_package(HDF5 REQUIRED COMPONENTS C HL)
find_package(Boost REQUIRED COMPONENTS system)
find_package(MPI REQUIRED)
find_package(GTest REQUIRED)
enable_testing()
include_directories(
${GTEST_INCLUDE_DIRS}
${HDF5_INCLUDE_DIRS}
${MPI_INCLUDE_PATH}
${boost_INCLUDE_DIRS}
)
include_directories(..)
add_executable(hdf5_tests test-hdf.cpp )
target_link_libraries(hdf5_tests
${Boost_LIBRARIES}
${GTEST_BOTH_LIBRARIES}
${HDF5_LIBRARIES}
${HDF5_LIBRARIES}
${MPI_C_LIBRARIES}
)
add_test(NAME hdf5
COMMAND hdf5_tests)