-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
170 lines (154 loc) · 6.83 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
cmake_minimum_required(VERSION 3.12)
project(HeavyEyelid)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/Modules/")
add_subdirectory(thirdparty/virtxml++)
include_directories(thirdparty/gsl/include
thirdparty/rapidjson/include
thirdparty
include)
include(WA-ICEs) # Workarouds for known ICEs on certain compiler versions
if (!MACOS AND !MINGW)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
find_package(Boost 1.66
REQUIRED
COMPONENTS system)
find_package(LibVirt
REQUIRED)
find_package(LibDeflate
REQUIRED)
include_directories(${Boost_INCLUDE_DIRS} ${LibVirt_INCLUDE_DIRS} ${LibDeflate_INCLUDE_DIRS}
thirdparty/lift/include
thirdparty/inih
thirdparty/ctre/include
include)
add_compile_definitions(VIR_ENUM_SENTINELS RAPIDJSON_HAS_STDSTRING BOOST_BEAST_USE_STD_STRING_VIEW)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options("-O3")
add_compile_options("-mtune=native")
add_compile_options("-g")
endif ()
add_executable(virthttp
main.cpp
src/wrapper/depends.cpp
src/wrapper/json2virt.cpp
include/utils.hpp
include/virt_wrap/AdminConnection.hpp
include/virt_wrap/Connection.hpp
include/virt_wrap/Domain.hpp
include/virt_wrap/TypesParam.hpp
include/virt_wrap/decls.hpp
include/virt_wrap/fwd.hpp
include/virt_wrap/tfe.hpp
include/virt_wrap/utility.hpp
include/virt_wrap/Error.hpp
include/virt_wrap/Network.hpp
include/virt_wrap/NodeDevice.hpp
include/virt_wrap/CpuMap.hpp
include/virt_wrap/StoragePool.hpp
include/virt_wrap/StorageVol.hpp
include/virt_wrap/Stream.hpp
include/virt_wrap/impl/Stream.hpp
include/virt_wrap/enums/Base.hpp
include/virt_wrap/enums/GFlags.hpp
include/virt_wrap/enums/Connection/Connection.hpp
include/virt_wrap/enums/Connection/ListDomainFlag.hpp
include/virt_wrap/enums/Connection/ListStoragePoolsFlag.hpp
include/virt_wrap/enums/Domain/BlockCommitFlag.hpp
include/virt_wrap/enums/Domain/BlockCopyFlag.hpp
include/virt_wrap/enums/Domain/BlockJobAbortFlag.hpp
include/virt_wrap/enums/Domain/BlockJobInfoFlag.hpp
include/virt_wrap/enums/Domain/BlockJobSetSpeedFlag.hpp
include/virt_wrap/enums/Domain/BlockPullFlag.hpp
include/virt_wrap/enums/Domain/BlockRebaseFlag.hpp
include/virt_wrap/enums/Domain/BlockResizeFlag.hpp
include/virt_wrap/enums/Domain/ChannelFlag.hpp
include/virt_wrap/enums/Domain/ConsoleFlag.hpp
include/virt_wrap/enums/Domain/CreateFlag.hpp
include/virt_wrap/enums/Domain/DestroyFlag.hpp
include/virt_wrap/enums/Domain/DeviceModifyFlag.hpp
include/virt_wrap/enums/Domain/Domain.hpp
include/virt_wrap/enums/Domain/GetJobStatsFlag.hpp
include/virt_wrap/enums/Domain/KeycodeSet.hpp
include/virt_wrap/enums/Domain/Lifecycle.hpp
include/virt_wrap/enums/Domain/LifecycleAction.hpp
include/virt_wrap/enums/Domain/MemoryModFlag.hpp
include/virt_wrap/enums/Domain/OpenGraphicsFlag.hpp
include/virt_wrap/enums/Domain/ShutdownFlag.hpp
include/virt_wrap/enums/Domain/MetadataType.hpp
include/virt_wrap/enums/Domain/MigrateFlag.hpp
include/virt_wrap/enums/Domain/MITPFlag.hpp
include/virt_wrap/enums/Domain/ModificationImpactFlag.hpp
include/virt_wrap/enums/Domain/ProcessSignal.hpp
include/virt_wrap/enums/Domain/XMLFlags.hpp
include/virt_wrap/enums/Domain/State.hpp
include/virt_wrap/enums/Domain/UndefineFlag.hpp
include/virt_wrap/enums/Domain/SaveRestoreFlag.hpp
include/virt_wrap/enums/Storage/PoolBuildFlag.hpp
include/virt_wrap/enums/Storage/PoolCreateFlag.hpp
include/virt_wrap/enums/Storage/PoolDeleteFlag.hpp
include/virt_wrap/enums/Storage/PoolState.hpp
include/virt_wrap/enums/Storage/StoragePool.hpp
include/virt_wrap/enums/Storage/StorageVol.hpp
include/virt_wrap/enums/Storage/VolCreateFlag.hpp
include/virt_wrap/enums/Storage/VolDeleteFlag.hpp
include/virt_wrap/enums/Storage/VolDownloadFlag.hpp
include/virt_wrap/enums/Storage/VolInfoFlag.hpp
include/virt_wrap/enums/Storage/VolResizeFlag.hpp
include/virt_wrap/enums/Storage/VolType.hpp
include/virt_wrap/enums/Storage/VolWipeAlgorithm.hpp
include/virt_wrap/enums/Storage/VolUploadFlag.hpp
include/virt_wrap/enums/Stream/Stream.hpp
include/virt_wrap/enums/Stream/Flag.hpp
include/virt_wrap/enums/Stream/RecvFlag.hpp
include/virt_wrap/impl/Connection.hpp
include/virt_wrap/impl/Domain.hpp
include/virt_wrap/impl/Network.hpp
include/virt_wrap/impl/NodeDevice.hpp
include/virt_wrap/impl/StoragePool.hpp
include/virt_wrap/impl/StorageVol.hpp
include/virt_wrap/impl/TypedParams.hpp
include/wrapper/actions_table.hpp
include/wrapper/config.hpp
include/wrapper/depends.hpp
include/wrapper/dispatch.hpp
include/wrapper/error_msg.hpp
include/wrapper/handler.hpp
include/wrapper/json2virt.hpp
include/wrapper/http_wrapper.hpp
include/wrapper/solver.hpp
include/wrapper/virt2json.hpp
include/wrapper/handlers/base.hpp
include/wrapper/handlers/domain.hpp
include/wrapper/handlers/flagwork.hpp
include/wrapper/handlers/hdl_ctx.hpp
include/wrapper/handlers/network.hpp
include/wrapper/general_store.hpp
include/wrapper/handlers/async/async_handler.hpp
include/wrapper/handlers/async/async_store.hpp
include/wrapper/protocol_support/beast_internals.hpp
include/wrapper/protocol_support/protocols.hpp
include/wrapper/protocol_support/request_handler.hpp
include/wrapper/protocol_support/tcp_listener.hpp
include/wrapper/protocol_support/http1/Session.hpp
include/virt_wrap.hpp
include/logger.hpp
include/cexpr_algs.hpp
include/flatmap.hpp
include/json_utils.hpp
include/urlparser.hpp
include/wrapper/decoder_support/compression.hpp
include/wrapper/decoder_support/libdeflate.hpp
include/wrapper/network_actions_table.hpp)
target_link_libraries(virthttp virtxml++ ${Boost_LIBRARIES} ${LibVirt_LIBRARIES} ${LibDeflate_LIBRARIES} pthread deflate)
if (WIN32)
target_link_libraries(virthttp Ws2_32.lib WSock32.lib)
endif ()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
endif ()
install(TARGETS virthttp
RUNTIME DESTINATION bin)
install(FILES config.ini
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/virthttp)