-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (67 loc) · 1.87 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cmake_minimum_required(VERSION 3.12)
project(HDF5_VOL_DRISHTI VERSION 0.1.0 LANGUAGES C)
if(NOT HDF5_VOL_DRISHTI_INSTALL_BIN_DIR)
set(HDF5_VOL_DRISHTI_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
endif()
if(NOT HDF5_VOL_DRISHTI_INSTALL_LIB_DIR)
set(HDF5_VOL_DRISHTI_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()
if(NOT HDF5_VOL_DRISHTI_INSTALL_INCLUDE_DIR)
set(HDF5_VOL_DRISHTI_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
if(NOT HDF5_VOL_DRISHTI_INSTALL_DATA_DIR)
set(HDF5_VOL_DRISHTI_INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share)
endif()
find_package(MPI REQUIRED)
if(DEFINED ENV{HDF5_DIR})
message(STATUS "Found HDF5_DIR: $ENV{HDF5_DIR}")
set(HDF5_HOME $ENV{HDF5_DIR})
set(CMAKE_PREFIX_PATH $ENV{HDF5_DIR})
endif()
if(DEFINED ENV{HDF5_HOME})
message(STATUS "Found HDF5_HOME: $ENV{HDF5_HOME}")
set(HDF5_HOME $ENV{HDF5_HOME})
set(CMAKE_PREFIX_PATH $ENV{HDF5_HOME})
endif()
find_package(HDF5 REQUIRED)
message(STATUS "Using HDF5 version: ${HDF5_VERSION}")
link_directories(${HDF5_HOME}/lib)
include_directories(${MPI_INCLUDE_PATH})
include_directories(${HDF5_INCLUDE_DIRS})
set(HDF5_VOL_DRISHTI_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/H5VLdrishti.h
)
set(HDF5_VOL_DRISHTI_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/H5VLdrishti.c
)
add_library(hdf5_vol_drishti
SHARED
${HDF5_VOL_DRISHTI_SRCS}
)
target_include_directories(hdf5_vol_drishti
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC
${HDF5_DIR}/include
)
target_link_libraries(hdf5_vol_drishti
PRIVATE
${MPI_LIBRARIES}
${HDF5_LIBRARIES}
)
install(
FILES
${HDF5_VOL_DRISHTI_HEADERS}
DESTINATION
${HDF5_VOL_DRISHTI_INSTALL_INCLUDE_DIR}
COMPONENT
headers
)
install(
TARGETS
hdf5_vol_drishti
EXPORT
${HDF5_VOL_DRISHTI_EXPORTED_TARGETS}
LIBRARY DESTINATION ${HDF5_VOL_DRISHTI_INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${HDF5_VOL_DRISHTI_INSTALL_LIB_DIR}
)