-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
100 lines (87 loc) · 2.79 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
cmake_minimum_required(VERSION 3.10)
project(RemoteDesktopWithGmailAPI LANGUAGES CXX)
# Use vcpkg toolchain
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set the prefix path for vcpkg
set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/vcpkg/installed/x64-windows/")
# Find the required packages
find_package(nlohmann_json REQUIRED)
find_package(CURL REQUIRED)
find_package(OpenSSL REQUIRED)
# Server
# Add executable
add_executable(
server
./Server/server.cpp
./Server/ServerSocket.hpp
./Server/ServerSocket.cpp
./WindowAPI/Keylogger.hpp
./WindowAPI/Keylogger.cpp
./WindowAPI/KeyboardDisabler.hpp
./WindowAPI/KeyboardDisabler.cpp
./WindowAPI/VideoRecorder.hpp
./WindowAPI/VideoRecorder.cpp
./WindowAPI/FileOperations.hpp
./WindowAPI/FileOperations.cpp
./WindowAPI/ProcessOperations.hpp
./WindowAPI/ProcessOperations.cpp
./WindowAPI/SystemOperations.hpp
./WindowAPI/SystemOperations.cpp
./WindowAPI/MyUtility.hpp
./WindowAPI/MyUtility.cpp
)
target_include_directories(server PRIVATE ${SFML_INCLUDE_DIRS})
# Link necessary libraries
target_link_libraries(
server PRIVATE
ws2_32
strmiids
quartz
gdiplus
ole32
uuid
)
# Client
add_executable(
client
# WIN32
./Client/client.cpp
./Client/ClientSocket.hpp
./Client/ClientSocket.cpp
./GmailAPI/GmailAPI.hpp
./GmailAPI/GmailAPI.cpp
./GmailAPI/Base64.hpp
./GmailAPI/Base64.cpp
./GmailAPI/OAuthManager.hpp
./GmailAPI/OAuthManager.cpp
./GmailAPI/HTMLGenerator.hpp
./GmailAPI/HTMLGenerator.cpp
)
target_include_directories(client PRIVATE ${SFML_INCLUDE_DIRS})
target_link_libraries(
client PRIVATE
ws2_32
iphlpapi
nlohmann_json::nlohmann_json
CURL::libcurl
OpenSSL::SSL
OpenSSL::Crypto
)
add_custom_command(TARGET server POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:server>"
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:server>/output-server"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/vcpkg/installed/x64-windows/debug/bin" "$<TARGET_FILE_DIR:server>"
)
add_custom_command(TARGET client POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:client>"
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:server>/output-client"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/vcpkg/installed/x64-windows/debug/bin" "$<TARGET_FILE_DIR:client>"
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:client>/scripts"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/GmailAPI/scripts" "$<TARGET_FILE_DIR:client>/scripts"
)