-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
138 lines (123 loc) · 3.98 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
cmake_minimum_required(VERSION 3.10)
project(babel CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
INCLUDE_DIRECTORIES(${CONAN_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++17 -g3")
#add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK -DBOOST_LOG_DYN_LINK)
if (UNIX) #Debug Qt on Unix
file(WRITE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf [Paths]\nPrefix=${CONAN_QT_ROOT})
file(MAKE_DIRECTORY ${CONAN_QT_ROOT}/lib/fonts/)
configure_file(client/resources/default.ttf ${CONAN_QT_ROOT}/lib/fonts/default.ttf COPYONLY)
endif (UNIX)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
#find_package(Boost 1.68.0 REQUIRED system thread regex)
#IF(Boost_FOUND)
# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
# LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
#ENDIF(Boost_FOUND)*/
# Client C++ Sources
set(CLIENT_SOURCES
client/src/main.cpp client/src/Exception.cpp
client/src/codec/Opus.cpp
client/src/sound/Microphone.cpp
client/src/sound/Speaker.cpp
client/src/forms/mainwindow.cpp
client/src/forms/livewindow.cpp
client/src/forms/soundmanagerwindow.cpp
client/src/forms/receptioncallwindow.cpp
client/src/network/ClientController.cpp
client/src/ClientManager.cpp)
# Client C++ headers
set(CLIENT_HEADERS
client/src/Exception.hpp
client/src/codec/Opus.hpp
client/src/sound/Config.hpp
client/src/sound/Microphone.hpp
client/src/sound/Speaker.hpp
client/src/forms/mainwindow.h
client/src/forms/livewindow.h
client/src/forms/soundmanagerwindow.h
client/src/forms/receptioncallwindow.h
client/src/network/ClientController.h client/src/ClientManager.h)
# Client Qt Interface
set(CLIENT_FORMS
client/src/forms/mainwindow.ui
client/src/forms/livewindow.ui
client/src/forms/soundmanagerwindow.ui
client/src/forms/receptioncallwindow.ui
)
# Client Qt Resource
set(CLIENT_RESOURCES
client/resources.qrc
)
# Shared libraries
set(CLIENT_LIBRARIES
Qt5::Widgets
Qt5::Core
Qt5::Gui
)
set(SHARED_FILES
shared/hook/NetworkServerHandler.h
shared/hook/NetworkServerHandler.cpp
shared/NetworkServer.cpp
shared/NetworkServer.h
shared/NetworkSession.cpp
shared/NetworkSession.h
shared/Network.h
shared/NetworkSessionHandler.h
shared/BinaryReader.cpp
shared/BinaryReader.h
shared/BinaryWriter.cpp
shared/BinaryWriter.h
shared/NetworkConnector.cpp
shared/NetworkConnector.h
shared/hook/NetworkClientHandler.cpp
shared/hook/NetworkClientHandler.h
shared/hook/HookNetworkServer.h
shared/hook/HookNetworkServer.cpp
shared/hook/NetworkMessage.h
shared/hook/NetworkController.h
shared/hook/NetworkClient.cpp
shared/hook/NetworkClient.h
shared/hook/NetworkProtocol.h
shared/hook/HookNetworkConnector.cpp
shared/hook/HookNetworkConnector.h
shared/Util.h
protocol/LoginMessage.h
protocol/LoginSuccessMessage.h
protocol/LoginFailedMessage.h
protocol/DelContactMessage.h
protocol/AddContactMessage.h
protocol/CallRequestMessage.h
protocol/ErrorResponseMessage.h
protocol/CallRefusedMessage.h
protocol/VoiceDataMessage.h
protocol/HelloConnectMessage.h
protocol/ConnectionEtablishedMessage.h)
# Client convert .ui
qt5_wrap_ui(UIC_SOURCES ${CLIENT_FORMS})
qt5_add_resources(RCC_SOURCES ${CLIENT_RESOURCES})
# Client compilation
add_executable(babel_client ${CLIENT_RESOURCES} ${CLIENT_SOURCES} ${SHARED_FILES} ${CLIENT_HEADERS} ${UIC_SOURCES} ${RCC_SOURCES})
target_link_libraries(babel_client CONAN_PKG::portaudio CONAN_PKG::opus CONAN_PKG::Qt CONAN_PKG::boost_asio)
target_link_libraries(babel_client ${CLIENT_LIBRARIES})
SET(USED_LIBS ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY})
add_executable(babel_server
server/src/main.cpp
server/src/BabelServer.cpp
server/src/BabelServer.h
server/src/BabelController.cpp
server/src/BabelController.h
server/src/BabelUser.cpp
server/src/BabelUser.h
${SHARED_FILES}
)
target_link_libraries(babel_server CONAN_PKG::boost_asio)