-
Notifications
You must be signed in to change notification settings - Fork 2
/
elasticsearch_index_fulltext.cmake
93 lines (78 loc) · 3.75 KB
/
elasticsearch_index_fulltext.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
set(POLICY_NAME "elasticsearch_index_fulltext")
string(REPLACE "_" "-" POLICY_NAME_HYPHENS ${POLICY_NAME})
set(IRODS_PACKAGE_COMPONENT_POLICY_NAME "${POLICY_NAME_HYPHENS}${IRODS_PACKAGE_FILE_NAME_SUFFIX}")
string(TOUPPER ${IRODS_PACKAGE_COMPONENT_POLICY_NAME} IRODS_PACKAGE_COMPONENT_POLICY_NAME_UPPERCASE)
set(TARGET_NAME "${PROJECT_NAME}-policy_engine-${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}/utilities.cpp
#${CMAKE_SOURCE_DIR}/indexing_utilities.cpp
#${CMAKE_SOURCE_DIR}/${POLICY_NAME}_configuration.cpp
)
target_include_directories(
${TARGET_NAME}
PRIVATE
${IRODS_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${IRODS_EXTERNALS_FULLPATH_JSON}/include
${IRODS_EXTERNALS_FULLPATH_BOOST}/include
/opt/irods-externals/elasticlient0.1.0-0/include
/opt/irods-externals/cpr1.3.0-0/include
)
target_link_libraries(
${TARGET_NAME}
PRIVATE
${IRODS_PLUGIN_POLICY_LINK_LIBRARIES}
${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so
${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so
/opt/irods-externals/elasticlient0.1.0-0/lib/libelasticlient.so
/opt/irods-externals/elasticlient0.1.0-0/lib/libjsoncpp.so
/opt/irods-externals/cpr1.3.0-0/lib/libcpr.so
irods_common
irods_dev_policy_composition_framework
)
target_compile_definitions(${TARGET_NAME} PRIVATE ${IRODS_PLUGIN_POLICY_COMPILE_DEFINITIONS} ${IRODS_COMPILE_DEFINITIONS} 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 usr/lib/irods/plugins/rule_engines
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
install(
FILES
packaging/test_plugin_policy_engine-${POLICY_NAME}.py
DESTINATION var/lib/irods/scripts/irods/test
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
install(
FILES
packaging/full_text_index_test_file.txt
DESTINATION var/lib/irods/scripts/irods/test
COMPONENT ${IRODS_PACKAGE_COMPONENT_POLICY_NAME}
)
set(CPACK_PACKAGE_VERSION ${IRODS_PLUGIN_VERSION})
set(CPACK_DEBIAN_${IRODS_PACKAGE_COMPONENT_POLICY_NAME_UPPERCASE}_FILE_NAME ${TARGET_NAME_HYPHENS}-${IRODS_PLUGIN_VERSION}-${IRODS_LINUX_DISTRIBUTION_NAME}-${IRODS_LINUX_DISTRIBUTION_VERSION_MAJOR}-${CMAKE_SYSTEM_PROCESSOR}.deb)
set(CPACK_DEBIAN_${IRODS_PACKAGE_COMPONENT_POLICY_NAME_UPPERCASE}_PACKAGE_NAME ${TARGET_NAME_HYPHENS})
set(CPACK_DEBIAN_${IRODS_PACKAGE_COMPONENT_POLICY_NAME_UPPERCASE}_PACKAGE_DEPENDS "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-server (= ${IRODS_VERSION}), irods-runtime (= ${IRODS_VERSION}), libc6")
set(CPACK_RPM_${IRODS_PACKAGE_COMPONENT_POLICY_NAME}_PACKAGE_NAME ${TARGET_NAME_HYPHENS})
if (IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "centos" OR IRODS_LINUX_DISTRIBUTION_NAME STREQUAL "centos linux")
set(CPACK_RPM_${IRODS_PACKAGE_COMPONENT_POLICY_NAME_UPPERCASE}_FILE_NAME ${TARGET_NAME_HYPHENS}-${IRODS_PLUGIN_VERSION}-${IRODS_LINUX_DISTRIBUTION_NAME}-${IRODS_LINUX_DISTRIBUTION_VERSION_MAJOR}-${CMAKE_SYSTEM_PROCESSOR}.deb)
set(CPACK_RPM_${IRODS_PACKAGE_COMPONENT_POLICY_NAME}_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_${IRODS_PACKAGE_COMPONENT_POLICY_NAME}_PACKAGE_REQUIRES "${IRODS_PACKAGE_DEPENDENCIES_STRING}, irods-server = ${IRODS_VERSION}, irods-runtime = ${IRODS_VERSION}, libopenssl1_0_0")
endif()