forked from irods/irods_capability_storage_tiering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unified_storage_tiering.cmake
105 lines (87 loc) · 3.62 KB
/
unified_storage_tiering.cmake
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
set(POLICY_NAME "unified_storage_tiering")
string(REPLACE "_" "-" POLICY_NAME_HYPHENS ${POLICY_NAME})
set(IRODS_PACKAGE_COMPONENT_POLICY_NAME "${POLICY_NAME_HYPHENS}")
string(TOUPPER ${IRODS_PACKAGE_COMPONENT_POLICY_NAME} IRODS_PACKAGE_COMPONENT_POLICY_NAME_UPPERCASE)
set(TARGET_NAME "${IRODS_TARGET_NAME_PREFIX}-${POLICY_NAME}")
string(REPLACE "_" "-" TARGET_NAME_HYPHENS ${TARGET_NAME})
set(
IRODS_PLUGIN_POLICY_COMPILE_DEFINITIONS
RODS_SERVER
ENABLE_RE
)
set(
IRODS_PLUGIN_POLICY_LINK_LIBRARIES
irods_server
)
add_library(
${TARGET_NAME}
MODULE
${CMAKE_SOURCE_DIR}/lib${TARGET_NAME}.cpp
${CMAKE_SOURCE_DIR}/storage_tiering.cpp
${CMAKE_SOURCE_DIR}/storage_tiering_configuration.cpp
${CMAKE_SOURCE_DIR}/storage_tiering_utilities.cpp
${CMAKE_SOURCE_DIR}/data_verification_utilities.cpp
)
target_include_directories(
${TARGET_NAME}
PRIVATE
${IRODS_INCLUDE_DIRS}
${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include
${IRODS_EXTERNALS_FULLPATH_BOOST}/include
${IRODS_EXTERNALS_FULLPATH_FMT}/include
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries(
${TARGET_NAME}
PRIVATE
${IRODS_PLUGIN_POLICY_LINK_LIBRARIES}
${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so
${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_regex.so
${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so
${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so
OpenSSL::Crypto
Threads::Threads
irods_common
nlohmann_json::nlohmann_json
)
target_compile_definitions(${TARGET_NAME} PRIVATE ${IRODS_PLUGIN_POLICY_COMPILE_DEFINITIONS} ${IRODS_COMPILE_DEFINITIONS} ${IRODS_COMPILE_DEFINITIONS_PRIVATE} BOOST_SYSTEM_NO_DEPRECATED)
target_compile_options(${TARGET_NAME} PRIVATE -Wno-write-strings)
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD ${IRODS_CXX_STANDARD})
install(
TARGETS
${TARGET_NAME}
LIBRARY
DESTINATION ${IRODS_PLUGINS_DIRECTORY}/rule_engines
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
install(
FILES
${CMAKE_SOURCE_DIR}/packaging/test_plugin_unified_storage_tiering.py
DESTINATION ${IRODS_HOME_DIRECTORY}/scripts/irods/test
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
install(
FILES
${CMAKE_SOURCE_DIR}/packaging/run_unified_storage_tiering_plugin_test.py
DESTINATION ${IRODS_HOME_DIRECTORY}/scripts
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
install(
FILES
${CMAKE_SOURCE_DIR}/example_unified_tiering_invocation.r
DESTINATION ${IRODS_HOME_DIRECTORY}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
set(CPACK_PACKAGE_VERSION ${IRODS_PLUGIN_VERSION})
set(CPACK_PACKAGE_NAME ${TARGET_NAME_HYPHENS})
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/packaging/${POLICY_NAME}/postinst;")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/packaging/${POLICY_NAME}/postinst")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-server (= ${IRODS_VERSION}), irods-runtime (= ${IRODS_VERSION}), libc6")
if (IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "centos" OR IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "centos linux")
set(CPACK_RPM_PACKAGE_REQUIRES "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-server = ${IRODS_VERSION}, irods-runtime = ${IRODS_VERSION}, openssl")
elseif (IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "opensuse")
set(CPACK_RPM_PACKAGE_REQUIRES "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-server = ${IRODS_VERSION}, irods-runtime = ${IRODS_VERSION}, libopenssl1_0_0")
endif()