forked from smagnani96/CooperativeEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (53 loc) · 3.19 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
cmake_minimum_required(VERSION 3.14)
project(CooperativeEditor)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_POSITION_INDEPENDENT_CODE True)
if (CMAKE_VERSION VERSION_LESS 3.0.0)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX11)
check_cxx_compiler_flag(-std=c++0x COMPILER_SUPPORTS_CXX0X)
if (COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif (COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif ()
else ()
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
endif ()
include_directories(src)
include_directories(src/include/lib/)
add_compile_options(-l sqlite3)
find_package(Threads)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
#Set the client executable
add_executable(CooperativeClient src/mainclient.cpp src/client/controller/Controller.cpp src/client/model/Model.cpp
src/components/Symbol.cpp src/components/Identifier.cpp src/components/messages/BasicMessage.cpp
src/components/messages/FileMessage.cpp src/components/messages/RequestMessage.cpp
src/components/messages/CrdtMessage.cpp src/components/messages/FileListingMessage.cpp src/components/messages/UserMessage.cpp
src/include/lib/crdt/CrdtAlgorithm.cpp src/client/view/View.cpp src/client/view/windows/Login.cpp
src/client/view/windows/FileVisualizer.cpp src/client/view/windows/Editor.cpp
src/common/TcpSocket.cpp src/client/view/windows/EditUserProfile.cpp src/client/view/windows/SignUp.cpp
src/common/User.cpp src/common/File.cpp src/include/lib/serialization/Serializable.cpp src/components/messages/Header.cpp
src/components/messages/CursorMessage.cpp src/components/messages/UserUpdateMessage.cpp src/components/messages/UserUpdateMessage.cpp)
#Set the server executable
add_executable(CooperativeServer src/mainserver.cpp src/server/controller/Controller.cpp src/server/model/Model.cpp
src/components/Symbol.cpp src/components/Identifier.cpp src/components/messages/BasicMessage.cpp
src/components/messages/FileMessage.cpp src/components/messages/RequestMessage.cpp src/components/messages/UserMessage.cpp
src/components/messages/CrdtMessage.cpp src/components/messages/FileListingMessage.cpp src/include/lib/crdt/CrdtAlgorithm.cpp
src/common/TcpSocket.cpp src/common/User.cpp src/common/TcpSocket.cpp src/common/File.cpp src/server/model/ServerFile.cpp
src/include/lib/serialization/Serializable.cpp src/components/messages/Header.cpp src/components/messages/CursorMessage.cpp
src/components/messages/UserUpdateMessage.cpp src/server/model/Database.cpp)
#Add libraries to compile the client
if (CMAKE_G++_COMPILER_VERSION VERSION_LESS 9.0.0)
target_link_libraries(CooperativeServer "-lstdc++fs")
endif ()
target_link_libraries(CooperativeClient Qt5::Core Qt5::Network Qt5::Widgets Qt5::PrintSupport)
target_link_libraries(CooperativeServer sqlite3 Qt5::Core Qt5::Network Qt5::Widgets Qt5::PrintSupport)