forked from fhoefling/h5xx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
45 lines (35 loc) · 1.26 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
cmake_minimum_required(VERSION 2.8)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "cmake/platform.cmake")
project(H5XX CXX)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(MPI "Build with MPI support for parallel IO" OFF)
# The FindBoost CMake module prefers multi-threaded libraries (filenames with
# postfix "-mt") over non-multi-threaded libraries. On Redhat or SuSE with
# installed system Boost libraries, this causes the system libraries (with
# "-mt") to override the custom-compiled libraries (without "-mt").
if(NOT DEFINED Boost_USE_MULTITHREADED)
set(Boost_USE_MULTITHREADED FALSE)
endif(NOT DEFINED Boost_USE_MULTITHREADED)
find_package(Boost 1.40.0 QUIET REQUIRED COMPONENTS unit_test_framework)
find_package(HDF5 QUIET REQUIRED)
#
# use
# $ cmake -DMPI=ON ...
# to configure with MPI support
#
if (MPI)
find_package(MPI)
endif()
if (MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
link_libraries(${MPI_LIBRARIES})
add_definitions(-DH5XX_USE_MPI -DMPICH_IGNORE_CXX_SEEK)
endif()
include_directories(SYSTEM ${HDF5_INCLUDE_DIR})
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR})
enable_testing()
include(CTest)
add_subdirectory(test)
set(H5XX_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/h5xx")
add_subdirectory(example)