forked from Open-CAS/open-cas-telemetry-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
octf-paths.cmake
84 lines (69 loc) · 2.47 KB
/
octf-paths.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
include("${CMAKE_CURRENT_LIST_DIR}/tools/installer/installation_config.cmake")
set(DIRS
OCTF_INCLUDE_DIR;
OCTF_LIBRARY_DIR;
OCTF_BIN_DIR;
OCTF_CONFIG_DIR;
OCTF_RUN_DIR;
OCTF_WORK_DIR;
OCTF_DOC_DIR;
OCTF_PACKAGE_DIR)
foreach(dir ${DIRS})
if(NOT ${dir})
message(FATAL_ERROR ${dir} " not defined!")
endif()
# Remove double backslashes etc.
get_filename_component(${dir} ${${dir}} REALPATH)
set(${dir} ${${dir}} CACHE INTERNAL ${dir})
endforeach(dir)
set(OCTF_CONFIG_FILE_NAME "octf.conf" CACHE INTERNAL OCTF_CONFIG_FILE_NAME)
set(NOTICE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/doc/NOTICE")
set(LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/VERSION")
set(OCTF_CONFIG_FILE_PROJECT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${OCTF_CONFIG_FILE_NAME} CACHE INTERNAL OCTF_CONFIG_FILE_PROJECT_PATH)
set(OCTF_MANIFEST_PREINSTALL ${CMAKE_BINARY_DIR}/install_manifest_octf-install.txt)
set(OCTF_MANIFEST_POSTINSTALL ${OCTF_DOC_DIR}/install_manifest_octf-install.txt)
set(socketsPath ${OCTF_RUN_DIR}/sockets)
set(tracePath ${OCTF_WORK_DIR}/trace)
set(settingsPath ${OCTF_WORK_DIR}/settings)
set(OCTF_CONFIG_FILE_PATH "${OCTF_CONFIG_DIR}/${OCTF_CONFIG_FILE_NAME}" CACHE INTERNAL OCTF_CONFIG_FILE_PATH)
add_definitions(-DOCTF_CONFIG_FILE="${OCTF_CONFIG_FILE_PATH}")
message(STATUS "OCTF_CONFIG_FILE set to: ${OCTF_CONFIG_FILE_PATH}")
set(includePath ${OCTF_INCLUDE_DIR})
file(WRITE ${OCTF_CONFIG_FILE_PROJECT_PATH}
"{\n"
" \"paths\": {\n"
" \"settings\": \"${settingsPath}\",\n"
" \"unixsocket\": \"${socketsPath}\",\n"
" \"trace\": \"${tracePath}\"\n"
" }\n"
"}")
install(FILES ${OCTF_CONFIG_FILE_PROJECT_PATH}
DESTINATION ${OCTF_CONFIG_DIR}
COMPONENT octf-install
)
install(FILES ${VERSION_FILE}
DESTINATION ${OCTF_DOC_DIR}
COMPONENT octf-install
)
install(FILES ${NOTICE_FILE}
DESTINATION ${OCTF_DOC_DIR}
COMPONENT octf-install
)
install(FILES ${LICENSE_FILE}
DESTINATION ${OCTF_DOC_DIR}
COMPONENT octf-install
)
install(DIRECTORY
DESTINATION ${socketsPath}
COMPONENT octf-install
)
install(DIRECTORY
DESTINATION ${tracePath}
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
COMPONENT octf-install
)
install(DIRECTORY
DESTINATION ${settingsPath}
COMPONENT octf-install
)