forked from astibal/pplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (55 loc) · 2.28 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
54
55
56
57
58
59
60
61
62
63
PROJECT(pplay)
cmake_minimum_required(VERSION 2.8)
# taken from http://public.kitware.com/Bug/view.php?id=12646
function(install_if_not_exists src dest)
if(NOT IS_ABSOLUTE "${src}")
set(src "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
endif()
get_filename_component(src_name "${src}" NAME)
if (NOT IS_ABSOLUTE "${dest}")
set(dest "${CMAKE_INSTALL_PREFIX}/${dest}")
endif()
install(CODE "
if(NOT EXISTS \"\$ENV{DESTDIR}${dest}/${src_name}\")
#file(INSTALL \"${src}\" DESTINATION \"${dest}\")
message(STATUS \"Installing: \$ENV{DESTDIR}${dest}/${src_name}\")
execute_process(COMMAND \${CMAKE_COMMAND} -E copy \"${src}\"
\"\$ENV{DESTDIR}${dest}/${src_name}\"
RESULT_VARIABLE copy_result
ERROR_VARIABLE error_output)
if(copy_result)
message(FATAL_ERROR \${error_output})
endif()
else()
message(STATUS \"Skipping : \$ENV{DESTDIR}${dest}/${src_name}\")
endif()
")
endfunction(install_if_not_exists)
if(UNIX)
SET(CMAKE_INSTALL_PREFIX /usr)
install(FILES pplay.py DESTINATION bin
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
install(FILES smcap2pcap DESTINATION bin
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
SET(CPACK_GENERATOR "DEB")
SET(MAJOR_VERSION 2)
SET(MINOR_VERSION 0)
SET(PATCH_VERSION 9)
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
SET(CPACK_PACKAGE_DESCRIPTION "pplay is network application payload replayer")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "pplay can resend application data from .pcap and .smcap files over the network.")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Ales Stibal <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "python3 (>=3.5), python3-scapy")
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "tcpdump, python3-colorama, python3-paramiko, python3-requests, python3-cryptography")
INCLUDE(CPack)
endif()