-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
120 lines (104 loc) · 3.84 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
# /**************************************************************************
#
# This file is part of the Blackfriars Trading Terminal
#
# Copyright (C) 2021 Alexander Mishurov
#
# GNU General Public License Usage
# This file may be used under the terms of the GNU
# General Public License version 3. The licenses are as published by
# the Free Software Foundation and appearing in the file LICENSE.GPL3
# included in the packaging of this file. Please review the following
# information to ensure the GNU General Public License requirements will
# be met: https://www.gnu.org/licenses/gpl-3.0.html.
#
# **************************************************************************/
cmake_minimum_required(VERSION 3.19)
set(QT_VERSION_STR 6.2.1)
if (APPLE)
set(QT_COMPILER_DIRNAME macos)
elseif (UNIX)
# sudo apt install -t bullseye-backports libvulkan-dev
set(QT_COMPILER_DIRNAME gcc_64)
elseif (WIN32)
# Windows (Git BASH / MinGW)
# add to PATH (Search env: Edit the system environment variables)
# C:\Qt\6.2.1\mingw81_64\bin
# C:\Qt\Tools\mingw810_64\bin
# C:\Qt\Tools\CMake_64\bin
# mkdir build
# cd build
# cmake -G "MinGW Makefiles" ..
# mingw32-make.exe
set(QT_COMPILER_DIRNAME mingw81_64)
endif()
if (WIN32)
set(QT_PARENT_DIR "C:")
else()
set(QT_PARENT_DIR $ENV{HOME})
endif()
set(CMAKE_PREFIX_PATH ${QT_PARENT_DIR}/Qt/${QT_VERSION_STR}/${QT_COMPILER_DIRNAME})
project(Blackfriars VERSION 0.1 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 COMPONENTS Quick QuickControls2 Widgets Network WebSockets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick QuickControls2 Widgets Network WebSockets REQUIRED)
set(PROJECT_SOURCES
frontend/QFCharts/QFCharts.cpp
frontend/QFCharts/QFCandle.h
frontend/QFCharts/QFAxis.cpp
frontend/QFCharts/QFCrosshair.cpp
frontend/QFCharts/QFChart.cpp
frontend/QFCharts/QFGeoNodes.cpp
frontend/QFCharts/QFSeries.cpp
#frontend/frontend.qrc
frontend/Blackfriars/Blackfriars.cpp
frontend/Blackfriars/Alert.cpp
frontend/Blackfriars/AppPalette.cpp
frontend/Blackfriars/Facade.cpp
frontend/Blackfriars/StockItemModel.cpp
backend/Controller/Controller.cpp
backend/Brokers/brokers.qrc
backend/Brokers/AbstractBroker.cpp
backend/Brokers/MonteCarloBroker.cpp
backend/Brokers/TinkoffBroker.cpp
main.cpp
)
if (APPLE)
set(PROJECT_SOURCES ${PROJECT_SOURCES} frontend/Blackfriars/TitleBarMacOS.mm)
set(MACOSX_BUNDLE_ICON_FILE blackfriars.icns)
set(app_icon_macos
"${CMAKE_CURRENT_SOURCE_DIR}/appicon/blackfriars.icns")
set_source_files_properties(${app_icon_macos} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
set(PROJECT_SOURCES ${PROJECT_SOURCES} ${app_icon_macos})
elseif (WIN32)
set(PROJECT_SOURCES ${PROJECT_SOURCES} frontend/Blackfriars/TitleBarWindows.cpp)
set(PROJECT_SOURCES ${PROJECT_SOURCES}
"${CMAKE_CURRENT_SOURCE_DIR}/appicon/blackfriars.rc")
endif()
if (APPLE)
qt_add_executable(Blackfriars MACOSX_BUNDLE ${PROJECT_SOURCES})
else()
qt_add_executable(Blackfriars ${PROJECT_SOURCES})
endif()
if (APPLE)
set_target_properties(Blackfriars PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER finance.mishurov.co.uk
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)
endif()
target_compile_definitions(Blackfriars
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(Blackfriars PRIVATE
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::QuickControls2
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::WebSockets
)