-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
76 lines (62 loc) · 2 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
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required(VERSION 2.6)
project(netvfy)
enable_testing()
# Using Hardening Options
# https://wiki.debian.org/Hardening
set(HARDENING OPTIONS_COMMON
-W
-Wall
-fstack-protector-all
--param ssp-buffer-size=4
-Wformat
-Wformat-security
-Werror=format-security
-D_FORTIFY_SOURCE=2
)
set(CORE_VERSION "1.0.2")
set(GUI_VERSION "g1")
set(CLI_VERSION "c1")
if (WITH_GUI)
set(CPACK_PACKAGE_NAME "netvfy-agent-gui")
set(USE_THREAD "-DUSE_THREAD")
set(CPACK_PACKAGE_VERSION "${CORE_VERSION}${GUI_VERSION}")
set(NVAGENT_VERSION "${CORE_VERSION}${GUI_VERSION}")
else()
set(CPACK_PACKAGE_NAME "netvfy-agent-cli")
set(CPACK_PACKAGE_VERSION "${CORE_VERSION}${CLI_VERSION}")
set(NVAGENT_VERSION "${CORE_VERSION}${CLI_VERSION}")
endif()
if (WIN32)
set(compiler_options "${HARDENING_OPTIONS_COMMON} -fPIE -O1 ${USE_THREAD}")
elseif(UNIX)
set(compiler_options "${HARDENING_OPTIONS_COMMON} -O1 ${USE_THREAD}")
endif()
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
if(APPLE)
set(apple_package netvfy-agent.app)
set(library_dest_dir ${apple_package}/Contents/MacOS)
set(qtconf_dest_dir ${apple_package}/Contents/Resources)
else()
set(library_dest_dir lib)
endif()
option (WITH_GUI "WITH_GUI" OFF)
add_subdirectory(libnv)
include_directories("./libnv/src/")
add_subdirectory(src)
if (APPLE)
set(CPACK_GENERATOR "DragNDrop")
else()
set(CPACK_GENERATOR "DEB")
if (WITH_GUI)
install(FILES ./src/gui/rc/nvagent.svg DESTINATION /usr/share/icons/hicolor/scalable/apps/)
install(FILES ./xdesktop/nvagent.desktop DESTINATION /usr/share/applications/)
endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Netvfy Agent - Connect to your secure virtual network")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcap2-bin")
set(CPACK_DEBIAN_PACKAGE_SECTION "net")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Netvfy core team <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_CURRENT_SOURCE_DIR}/postinst; ${CMAKE_CURRENT_SOURCE_DIR}/postrm)
endif()
include(CPack)