forked from tclaus/stocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
192 lines (173 loc) · 6.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
cmake_minimum_required(VERSION 3.23)
project(
Stocks
VERSION 0.2
DESCRIPTION "A stocks application to set up a portfolio and check stock price changes over time"
)
set(CMAKE_MODULE_PATH "${Stocks_SOURCE_DIR}/CMakeModules")
if (CMAKE_PROJECT_NAME STREQUAL ${PROJECT_NAME})
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED)
# Let's nicely support folders in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
include(UseHaiku)
option(STRICT_WARNINGS "Compile with extra warnings and errors" ON)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 2.96 AND STRICT_WARNINGS)
add_compile_options(-Wall -Wextra -Wshadow -Werror)
if (USE_CLANG)
# clang finds a lot more problems than gcc, disable some of the warnings
# set these here instead of earlier, they must come after -Wall, -Werror, etc...
add_compile_options(
-Wno-overloaded-virtual
-Wno-unused-private-field
-Wno-return-type-c-linkage
-Wno-unused-const-variable
-Wno-deprecated-register
)
endif ()
endif ()
include_directories(AFTER
/boot/system/develop/headers/private/netservices2
/boot/system/develop/headers/os
source/utils
source/model
source/model/linkedRequestQuoteStore
source/gui/stocksPanel
source/gui/stocksPanel/listView
source/gui/chartView
source/gui/utils
source/repository
source/api)
# Set project name
configure_file(
"source/repository/RepositoryConfig.cpp.in"
"source/repository/RepositoryConfig.cpp"
)
# Set the api key from a environment variable
set(FINANCIAL_API_KEY $ENV{STOCKS_APP_API_KEY})
configure_file(
"source/api/FinancialmodelingApiKey.cpp.in"
"source/api/FinancialmodelingApiKey.cpp"
)
# JSON Parser
include(FetchContent)
FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz
URL_HASH SHA256=8c4b26bf4b422252e13f332bc5e388ec0ab5c3443d24399acb675e68278d341f
DOWNLOAD_EXTRACT_TIMESTAMP true)
FetchContent_MakeAvailable(json)
# Testing with Catch/2
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1 # or a later release
)
FetchContent_MakeAvailable(Catch2)
add_executable(tests
tests/test.cpp
tests/repository/TestRepositoryConfig.cpp
tests/repository/TestRepository.cpp
tests/gui/utils/TestQuoteFormatter.cpp
tests/gui/chartview/drawer/TestDateTimeCalculator.cpp
)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
include(Catch)
catch_discover_tests(tests)
haiku_add_executable(${PROJECT_NAME}
source/Stocks.rdef
source/App.cpp
source/App.h
source/gui/MainWindow.h
source/gui/MainWindow.cpp
source/gui/Colors.h
source/gui/Colors.cpp
source/gui/chartView/DetailsView.h
source/gui/chartView/DetailsView.cpp
source/gui/chartView/DetailsChart.h
source/gui/chartView/DetailsChart.cpp
source/gui/chartView/DetailsDataList.h
source/gui/chartView/DetailsDataList.cpp
source/gui/chartView/DetailsHeadline.h
source/gui/chartView/DetailsHeadline.cpp
source/gui/chartView/ChartTimeRangeBar.h
source/gui/chartView/ChartTimeRangeBar.cpp
source/gui/chartView/ChartView.h
source/gui/chartView/ChartView.cpp
source/gui/chartView/drawer/GridlineDrawer.h
source/gui/chartView/drawer/GridlineDrawer.cpp
source/gui/chartView/drawer/SeriesDrawer.h
source/gui/chartView/drawer/SeriesDrawer.cpp
source/gui/chartView/drawer/DataSeriesLimiter.h
source/gui/chartView/drawer/DataSeriesLimiter.cpp
source/gui/chartView/drawer/DateTimeCalculator.h
source/gui/chartView/drawer/DateTimeCalculator.cpp
source/gui/stocksPanel/StocksPanelView.h
source/gui/stocksPanel/StocksPanelView.cpp
source/gui/stocksPanel/SearchFieldControl.h
source/gui/stocksPanel/SearchFieldControl.cpp
source/gui/stocksPanel/ListItemConstants.h
source/gui/stocksPanel/listView/QuoteListItem.h
source/gui/stocksPanel/listView/QuoteListItem.cpp
source/gui/stocksPanel/listView/FoundShareListItem.h
source/gui/stocksPanel/listView/FoundShareListItem.cpp
source/gui/stocksPanel/listView/ShareListItem.h
source/gui/stocksPanel/listView/ShareListItem.cpp
source/gui/utils/ListItemDrawer.h
source/gui/utils/ListItemDrawer.cpp
source/gui/utils/QuoteFormatter.h
source/gui/utils/QuoteFormatter.cpp
source/gui/utils/DelayedQueryTimer.h
source/gui/utils/DelayedQueryTimer.cpp
source/gui/utils/EscapeCancelFilter.h
source/gui/utils/EscapeCancelFilter.cpp
source/api/StockConnector.h
source/api/Financialmodelingprep.h
source/api/Financialmodelingprep.cpp
source/api/FinancialmodelingApiKey.cpp
source/api/FinancialmodelingApiKey.h
source/api/NetRequester.h
source/api/NetRequester.cpp
source/api/ApiBuilder.h
source/api/ApiBuilder.cpp
source/model/Quote.cpp
source/model/Quote.h
source/model/Portfolio.h
source/model/Portfolio.cpp
source/model/SearchResultItem.h
source/model/SearchResultItem.cpp
source/model/SearchResultList.h
source/model/SearchResultList.cpp
source/model/SelectionOfSymbols.h
source/model/SelectionOfSymbols.cpp
source/model/HistoricalPrice.h
source/model/HistoricalPrice.cpp
source/model/HistoricalPriceList.h
source/model/HistoricalPriceList.cpp
source/model/TimeRange.h
source/repository/QuotesRepository.h
source/repository/QuotesRepository.cpp
source/repository/RepositoryConfig.h
source/repository/RepositoryConfig.cpp
source/repository/Repository.h
source/repository/Repository.cpp
source/model/linkedRequestQuoteStore/BaseLinkedRequestToQuoteStore.h
source/model/linkedRequestQuoteStore/BaseLinkedRequestToQuoteStore.cpp
source/model/linkedRequestQuoteStore/QuoteRequestStore.h
source/model/linkedRequestQuoteStore/QuoteRequestStore.cpp
source/handler/QuoteResultHandler.h
source/handler/QuoteResultHandler.cpp
source/handler/HistoricalPriceResultHandler.h
source/handler/HistoricalPriceResultHandler.cpp
source/utils/BaseThreadedJob.h
source/utils/BaseThreadedJob.cpp
source/utils/ObservableSubject.h
source/utils/ObservableSubject.cpp
source/utils/Observer.h
source/quoteUpdateJob/QuoteUpdateJob.h
source/quoteUpdateJob/QuoteUpdateJob.cpp
)
target_link_libraries(${PROJECT_NAME} be ${STDCPPLIBS} network netservices2 bnetapi nlohmann_json::nlohmann_json)