-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (37 loc) · 1.49 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
cmake_minimum_required(VERSION 3.14)
#EXTERNAL CODE I'm pretty sure these 5 lines were copied from somewhere
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.297.tar.gz"
SHA1 "3319fe6a3b08090df7df98dee75134d68e2ef5a3"
)
#while we're at it: EXTERNAL CODE, all lines of this file which weren't copypasted by me were autogenerated by QT creator (except very few)
project(mitm LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core LinguistTools Network REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core LinguistTools Network REQUIRED)
set(TS_FILES mitm_en_GB.ts)
#EXTERNAL CODE these 2 lines were copypasted from somewhere
hunter_add_package(OpenSSL)
find_package(OpenSSL REQUIRED)
#EXTERNAL CODE from https://stackoverflow.com/questions/9017573/define-preprocessor-macro-through-cmake#9017635
add_compile_definitions(SRCDIR=\"${CMAKE_SOURCE_DIR}\")
add_executable(mitm
main.cpp
proxyserversocket.cpp
serversidetcpsocket.cpp
sslstuff.cpp
mystdio.cpp
${TS_FILES}
)
target_link_libraries(mitm PUBLIC OpenSSL::SSL OpenSSL::Crypto Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network)
if(COMMAND qt_create_translation)
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()