-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
53 lines (45 loc) · 1.48 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
cmake_minimum_required(VERSION 3.12)
project(HDF5_VOL_PASSTHROUGH VERSION 0.0.1 LANGUAGES C)
if(NOT HDF5_VOL_PASSTHROUGH_INSTALL_BIN_DIR)
set(HDF5_VOL_PASSTHROUGH_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
endif()
if(NOT HDF5_VOL_PASSTHROUGH_INSTALL_LIB_DIR)
set(HDF5_VOL_PASSTHROUGH_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
endif()
if(NOT HDF5_VOL_PASSTHROUGH_INSTALL_INCLUDE_DIR)
set(HDF5_VOL_PASSTHROUGH_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
if(NOT HDF5_VOL_PASSTHROUGH_INSTALL_DATA_DIR)
set(HDF5_VOL_PASSTHROUGH_INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share)
endif()
set(HDF5_VOL_PASSTHROUGH_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/H5VLpassthru_ext.h
)
set(HDF5_VOL_PASSTHROUGH_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/H5VLpassthru_ext.c)
find_package(HDF5)
if (NOT HDF5_FOUND)
message (FATAL_ERROR "HDF5 was not found on the system")
endif ()
add_library(hdf5_vol_passthrough SHARED ${HDF5_VOL_PASSTHROUGH_SRCS})
target_include_directories(hdf5_vol_passthrough
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC "${HDF5_INCLUDE_DIRS}"
)
target_link_libraries(hdf5_vol_passthrough PRIVATE "${HDF5_LIBRARIES}")
install(
FILES
${HDF5_VOL_PASSTHROUGH_HEADERS}
DESTINATION
${HDF5_VOL_PASSTHROUGH_INSTALL_INCLUDE_DIR}
COMPONENT
headers
)
install(
TARGETS
hdf5_vol_passthrough
EXPORT
${HDF5_VOL_PASSTHROUGH_EXPORTED_TARGETS}
LIBRARY DESTINATION ${HDF5_VOL_PASSTHROUGH_INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${HDF5_VOL_PASSTHROUGH_INSTALL_LIB_DIR}
)