-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
50 lines (41 loc) · 1.77 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
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(zeek-client)
set(ZEEK_BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
# Define the default config file location.
set(ZEEK_CLIENT_CONFIG_FILE "${ZEEK_ETC_INSTALL_DIR}/zeek-client.cfg")
if ( NOT PY_MOD_INSTALL_DIR )
# This is not a Zeek-bundled install. Default to "home"-style install.
set(PY_MOD_INSTALL_DIR lib/python)
endif ()
# Install zeek-client with updated content:
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/zeek-client
${CMAKE_CURRENT_BINARY_DIR}/zeek-client @ONLY)
install(DIRECTORY DESTINATION bin)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zeek-client DESTINATION bin)
# Install the Python module tree. Use a pattern match to avoid installing any
# .pyc or __pycache__ files that might reside in the directory due to local
# unit-testing.
install(DIRECTORY DESTINATION ${PY_MOD_INSTALL_DIR})
install(DIRECTORY zeekclient DESTINATION ${PY_MOD_INSTALL_DIR}
FILES_MATCHING PATTERN "zeekclient/*.py"
PATTERN "__pycache__" EXCLUDE)
# Install the constants file with updated content:
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/zeekclient/consts.py
${CMAKE_CURRENT_BINARY_DIR}/zeekclient/consts.py @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeekclient/consts.py
DESTINATION ${PY_MOD_INSTALL_DIR}/zeekclient)
# This mirrors what we do in zkg:
if ( NOT ZEEK_MAN_INSTALL_PATH )
set(ZEEK_MAN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
endif ()
install(FILES man/zeek-client.1 DESTINATION ${ZEEK_MAN_INSTALL_PATH}/man1)
message(
"\n==================| zeek-client Build Summary |==============="
"\n"
"\nInstall prefix: ${CMAKE_INSTALL_PREFIX}"
"\nPython module path: ${PY_MOD_INSTALL_DIR}"
"\n"
"\n================================================================\n"
)