-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
117 lines (96 loc) · 2.08 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
cmake_minimum_required(VERSION 3.22)
set(PATCH_VERSION "1" CACHE INTERNAL "Patch version")
set(PROJECT_VESRION 0.0.${PATCH_VERSION})
project(SERVICE VERSION ${PROJECT_VESRION})
include(FetchContent)
set(BOOST_INCLUDE_LIBRARIES program_options algorithm uuid crc)
set(BOOST_ENABLE_CMAKE ON)
#Windows help debug
#set(Boost_DEBUG ON)
FetchContent_Declare(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-1.81.0
)
FetchContent_MakeAvailable(Boost)
include_directories(reverse_shell service_dll service)
add_library(
service_dll
SHARED
service_dll/service_dll.cpp
)
add_library(
reverse_shell
STATIC
reverse_shell/reverse_shell.cpp
)
add_library(
service_manager
STATIC
service/service_manager.cpp
)
add_executable(
service
service/service.cpp
)
target_link_libraries(
service
Boost::program_options
service_manager)
target_link_libraries(
service_dll
reverse_shell)
set_target_properties(
service
service_manager
service_dll
reverse_shell
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
if (MSVC)
target_compile_options(service PRIVATE /W4)
target_compile_options(service_dll PRIVATE /W4)
else ()
target_link_options(service PRIVATE -static-libgcc -static-libstdc++)
target_link_options(service_dll PRIVATE -static-libgcc -static-libstdc++)
target_compile_options(
service
PRIVATE
-Wall
-Wextra
-pedantic
)
target_compile_options(
service_dll
PRIVATE
-Wall
-Wextra
-pedantic
)
endif()
install(
TARGETS
service
RUNTIME DESTINATION service COMPONENT release
)
install(
TARGETS
service_dll
RUNTIME DESTINATION service_dll COMPONENT release
)
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL release)
# CPack area
if (WIN32)
set(CPACK_GENERATOR "ZIP")
else()
set(CPACK_GENERATOR "DEB")
endif()
set(CPACK_PACKAGE_VERSION "0.0.1")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_CONTACT https://github.com/4l3x777/service)
include(CPack)