| 1 |
cmake_minimum_required(VERSION 3.5) |
| •2 |
include(GNUInstallDirs) |
| •3 |
project(railcontrol) |
| 4 |
|
| 5 |
add_executable(${PROJECT_NAME} |
| 6 |
Manager.cpp |
| 7 |
Manager.h |
| 8 |
Server/Web/WebClient.cpp |
| 9 |
Server/Web/WebClient.h |
| 10 |
ArgumentHandler.cpp |
| •11 |
ArgumentHandler.h |
| 12 |
Config.cpp |
| 13 |
Config.h |
| 14 |
ControlInterface.h |
| 15 |
DataModel/Accessory.cpp |
| 16 |
DataModel/Accessory.h |
| 17 |
DataModel/AccessoryBase.cpp |
| 18 |
DataModel/AccessoryBase.h |
| 19 |
DataModel/AccessoryConfig.h |
| 20 |
DataModel/Cluster.cpp |
| 21 |
DataModel/Cluster.h |
| 22 |
DataModel/Counter.cpp |
| 23 |
DataModel/Counter.h |
| 24 |
DataModel/DataModel.h |
| 25 |
DataModel/Feedback.cpp |
| 26 |
DataModel/Feedback.h |
| 27 |
DataModel/FeedbackConfig.h |
| 28 |
DataModel/HardwareHandle.cpp |
| 29 |
DataModel/HardwareHandle.h |
| 30 |
DataModel/Layer.h |
| 31 |
DataModel/LayoutItem.cpp |
| 32 |
DataModel/LayoutItem.h |
| 33 |
DataModel/LockableItem.cpp |
| 34 |
DataModel/LockableItem.h |
| 35 |
DataModel/Loco.cpp |
| 36 |
DataModel/Loco.h |
| 37 |
DataModel/LocoBase.cpp |
| 38 |
DataModel/LocoBase.h |
| 39 |
DataModel/LocoConfig.h |
| 40 |
DataModel/LocoFunctions.cpp |
| 41 |
DataModel/LocoFunctions.h |
| 42 |
DataModel/MultipleUnit.cpp |
| 43 |
DataModel/MultipleUnit.h |
| 44 |
DataModel/Object.cpp |
| 45 |
DataModel/Object.h |
| •46 |
DataModel/ObjectIdentifier.cpp |
| 47 |
DataModel/ObjectIdentifier.h |
| 48 |
DataModel/Relation.cpp |
| 49 |
DataModel/Relation.h |
| 50 |
DataModel/Route.cpp |
| 51 |
DataModel/Route.h |
| 52 |
DataModel/Serializable.cpp |
| 53 |
DataModel/Serializable.h |
| 54 |
DataModel/Signal.cpp |
| 55 |
DataModel/Signal.h |
| 56 |
DataModel/Switch.cpp |
| 57 |
DataModel/Switch.h |
| 58 |
DataModel/Text.cpp |
| 59 |
DataModel/Text.h |
| 60 |
DataModel/Track.cpp |
| 61 |
DataModel/Track.h |
| 62 |
DataTypes.h |
| 63 |
Fallthrough.h |
| 64 |
Hardware/AccessoryCache.cpp |
| 65 |
Hardware/AccessoryCache.h |
| 66 |
Hardware/CS1.h |
| 67 |
Hardware/CS2Tcp.cpp |
| 68 |
Hardware/CS2Tcp.h |
| 69 |
Hardware/CS2Udp.cpp |
| 70 |
Hardware/CS2Udp.h |
| 71 |
Hardware/Capabilities.h |
| 72 |
Hardware/CcSchnitte.cpp |
| •73 |
Hardware/CcSchnitte.h |
| 74 |
Hardware/DR5000.h |
| 75 |
Hardware/DccPpExSerial.cpp |
| 76 |
Hardware/DccPpExSerial.h |
| 77 |
Hardware/DccPpExTcp.cpp |
| 78 |
Hardware/DccPpExTcp.h |
| 79 |
Hardware/Ecos.h |
| 80 |
Hardware/FeedbackCache.cpp |
| 81 |
Hardware/FeedbackCache.h |
| 82 |
Hardware/HardwareHandler.cpp |
| 83 |
Hardware/HardwareHandler.h |
| 84 |
Hardware/HardwareInterface.h |
| 85 |
Hardware/HardwareParams.h |
| 86 |
Hardware/Hsi88.cpp |
| 87 |
Hardware/Hsi88.h |
| 88 |
Hardware/Intellibox.h |
| 89 |
Hardware/Intellibox2.h |
| 90 |
Hardware/LocoCache.cpp |
| 91 |
Hardware/LocoCache.h |
| 92 |
Hardware/LocoNetAdapter63120.h |
| 93 |
Hardware/LocoNetAdapter63820.h |
| 94 |
Hardware/M6051.cpp |
| 95 |
Hardware/M6051.h |
| 96 |
Hardware/MasterControl.h |
| 97 |
Hardware/MasterControl2.h |
| 98 |
Hardware/OpenDcc.h |
| 99 |
Hardware/Protocols/DccPpEx.cpp |
| 100 |
Hardware/Protocols/DccPpEx.h |
| 101 |
Hardware/Protocols/EsuCAN.cpp |
| 102 |
Hardware/Protocols/EsuCAN.h |
| 103 |
Hardware/Protocols/LocoNet.cpp |
| 104 |
Hardware/Protocols/LocoNet.h |
| 105 |
Hardware/Protocols/LocoNetLocoCache.h |
| 106 |
Hardware/Protocols/MaerklinCAN.h |
| 107 |
Hardware/Protocols/MaerklinCANCommon.cpp |
| 108 |
Hardware/Protocols/MaerklinCANCommon.h |
| 109 |
Hardware/Protocols/P50x.cpp |
| 110 |
Hardware/Protocols/P50x.h |
| 111 |
Hardware/Protocols/P50xCache.h |
| 112 |
Hardware/Protocols/P50xEthernet.h |
| 113 |
Hardware/Protocols/P50xSerial.h |
| 114 |
Hardware/Protocols/P50xUhlenbrock.h |
| 115 |
Hardware/Protocols/Z21.cpp |
| 116 |
Hardware/Protocols/Z21.h |
| 117 |
Hardware/Protocols/Z21FeedbackCache.h |
| 118 |
Hardware/Protocols/Z21LocoCache.h |
| 119 |
Hardware/Protocols/Z21TurnoutCache.h |
| 120 |
Hardware/RedBox.h |
| 121 |
Hardware/Rektor.h |
| 122 |
Hardware/TwinCenter.h |
| 123 |
Hardware/Virtual.cpp |
| 124 |
Hardware/Virtual.h |
| 125 |
Hardware/Z21.h |
| 126 |
Hardware/ZLib.cpp |
| 127 |
Hardware/ZLib.h |
| 128 |
Languages.cpp |
| 129 |
Languages.h |
| 130 |
Logger/Logger.cpp |
| 131 |
Logger/Logger.h |
| 132 |
Logger/LoggerClient.h |
| 133 |
Logger/LoggerClientConsole.h |
| 134 |
Logger/LoggerClientFile.h |
| 135 |
Logger/LoggerClientTcp.h |
| 136 |
Logger/LoggerServer.cpp |
| 137 |
Logger/LoggerServer.h |
| 138 |
Network/Select.h |
| 139 |
Network/Serial.cpp |
| 140 |
Network/Serial.h |
| 141 |
Network/TcpClient.cpp |
| 142 |
Network/TcpClient.h |
| 143 |
Network/TcpConnection.cpp |
| 144 |
Network/TcpConnection.h |
| 145 |
Network/TcpServer.cpp |
| 146 |
Network/TcpServer.h |
| 147 |
Network/UdpClient.h |
| 148 |
Network/UdpConnection.cpp |
| 149 |
Network/UdpConnection.h |
| 150 |
Network/UdpServer.cpp |
| 151 |
Network/UdpServer.h |
| 152 |
RailControl.cpp |
| 153 |
RailControl.h |
| 154 |
Server/CS2/CS2Client.cpp |
| 155 |
Server/CS2/CS2Client.h |
| 156 |
Server/CS2/CS2Server.cpp |
| 157 |
Server/CS2/CS2Server.h |
| 158 |
Server/Web/HtmlTag.cpp |
| 159 |
Server/Web/HtmlTag.h |
| 160 |
Server/Web/HtmlTagAccessory.cpp |
| 161 |
Server/Web/HtmlTagAccessory.h |
| 162 |
Server/Web/HtmlTagButton.cpp |
| 163 |
Server/Web/HtmlTagButton.h |
| 164 |
Server/Web/HtmlTagButtonCancel.h |
| 165 |
Server/Web/HtmlTagButtonCommand.cpp |
| 166 |
Server/Web/HtmlTagButtonCommand.h |
| 167 |
Server/Web/HtmlTagButtonCommandFullScreen.cpp |
| 168 |
Server/Web/HtmlTagButtonCommandFullScreen.h |
| 169 |
Server/Web/HtmlTagButtonCommandPressRelease.cpp |
| 170 |
Server/Web/HtmlTagButtonCommandPressRelease.h |
| 171 |
Server/Web/HtmlTagButtonCommandToggle.cpp |
| 172 |
Server/Web/HtmlTagButtonCommandToggle.h |
| 173 |
Server/Web/HtmlTagButtonCommandWide.h |
| 174 |
Server/Web/HtmlTagButtonMinus.h |
| 175 |
Server/Web/HtmlTagButtonOK.h |
| 176 |
Server/Web/HtmlTagButtonPlus.h |
| 177 |
Server/Web/HtmlTagButtonPopup.cpp |
| 178 |
Server/Web/HtmlTagButtonPopup.h |
| 179 |
Server/Web/HtmlTagButtonPopupWide.h |
| •180 |
Server/Web/HtmlTagCounter.cpp |
| 181 |
Server/Web/HtmlTagCounter.h |
| 182 |
Server/Web/HtmlTagFeedback.cpp |
| 183 |
Server/Web/HtmlTagFeedback.h |
| 184 |
Server/Web/HtmlTagInput.cpp |
| 185 |
Server/Web/HtmlTagInput.h |
| 186 |
Server/Web/HtmlTagInputCheckbox.h |
| 187 |
Server/Web/HtmlTagInputCheckboxWithLabel.h |
| 188 |
Server/Web/HtmlTagInputHidden.h |
| 189 |
Server/Web/HtmlTagInputInteger.cpp |
| 190 |
Server/Web/HtmlTagInputInteger.h |
| 191 |
Server/Web/HtmlTagInputIntegerWithLabel.h |
| 192 |
Server/Web/HtmlTagInputSlider.cpp |
| 193 |
Server/Web/HtmlTagInputSlider.h |
| 194 |
Server/Web/HtmlTagInputSliderLocoSpeed.cpp |
| 195 |
Server/Web/HtmlTagInputSliderLocoSpeed.h |
| 196 |
Server/Web/HtmlTagInputText.h |
| 197 |
Server/Web/HtmlTagInputTextWithLabel.h |
| 198 |
Server/Web/HtmlTagLabel.h |
| 199 |
Server/Web/HtmlTagLayoutItem.cpp |
| 200 |
Server/Web/HtmlTagLayoutItem.h |
| 201 |
Server/Web/HtmlTagRoute.cpp |
| 202 |
Server/Web/HtmlTagRoute.h |
| 203 |
Server/Web/HtmlTagSelect.cpp |
| 204 |
Server/Web/HtmlTagSelect.h |
| 205 |
Server/Web/HtmlTagSelectMultiple.cpp |
| 206 |
Server/Web/HtmlTagSelectMultiple.h |
| 207 |
Server/Web/HtmlTagSelectMultipleWithLabel.cpp |
| 208 |
Server/Web/HtmlTagSelectMultipleWithLabel.h |
| 209 |
Server/Web/HtmlTagSelectOrientation.h |
| 210 |
Server/Web/HtmlTagSelectOrientationWithLabel.h |
| 211 |
Server/Web/HtmlTagSelectWithLabel.cpp |
| 212 |
Server/Web/HtmlTagSelectWithLabel.h |
| 213 |
Server/Web/HtmlTagSignal.cpp |
| 214 |
Server/Web/HtmlTagSignal.h |
| 215 |
Server/Web/HtmlTagSwitch.cpp |
| 216 |
Server/Web/HtmlTagSwitch.h |
| 217 |
Server/Web/HtmlTagText.cpp |
| 218 |
Server/Web/HtmlTagText.h |
| 219 |
Server/Web/HtmlTagTrack.cpp |
| 220 |
Server/Web/HtmlTagTrack.h |
| 221 |
Server/Web/Response.cpp |
| 222 |
Server/Web/Response.h |
| 223 |
Server/Web/ResponseCsv.cpp |
| 224 |
Server/Web/ResponseCsv.h |
| 225 |
Server/Web/ResponseHtml.cpp |
| 226 |
Server/Web/ResponseHtml.h |
| 227 |
Server/Web/ResponseHtmlFull.cpp |
| 228 |
Server/Web/ResponseHtmlFull.h |
| 229 |
Server/Web/ResponseHtmlNotFound.cpp |
| 230 |
Server/Web/ResponseHtmlNotFound.h |
| 231 |
Server/Web/ResponseHtmlNotImplemented.cpp |
| 232 |
Server/Web/ResponseHtmlNotImplemented.h |
| 233 |
Server/Web/WebClientCluster.cpp |
| 234 |
Server/Web/WebClientCluster.h |
| •235 |
Server/Web/WebClientCounter.cpp |
| 236 |
Server/Web/WebClientCounter.h |
| 237 |
Server/Web/WebClientRoute.cpp |
| 238 |
Server/Web/WebClientRoute.h |
| 239 |
Server/Web/WebClientSignal.cpp |
| 240 |
Server/Web/WebClientSignal.h |
| 241 |
Server/Web/WebClientStatic.cpp |
| 242 |
Server/Web/WebClientStatic.h |
| 243 |
Server/Web/WebClientText.cpp |
| 244 |
Server/Web/WebClientText.h |
| 245 |
Server/Web/WebClientTrack.cpp |
| 246 |
Server/Web/WebClientTrack.h |
| 247 |
Server/Web/WebServer.cpp |
| 248 |
Server/Web/WebServer.h |
| 249 |
Server/Z21/Z21Client.cpp |
| 250 |
Server/Z21/Z21Client.h |
| 251 |
Server/Z21/Z21Server.cpp |
| 252 |
Server/Z21/Z21Server.h |
| 253 |
Storage/Sqlite.cpp |
| 254 |
Storage/Sqlite.h |
| 255 |
Storage/StorageHandler.cpp |
| 256 |
Storage/StorageHandler.h |
| 257 |
Storage/StorageInterface.h |
| 258 |
Storage/StorageParams.h |
| 259 |
Storage/TransactionGuard.cpp |
| 260 |
Storage/TransactionGuard.h |
| 261 |
Utils/Integer.cpp |
| 262 |
Utils/Integer.h |
| 263 |
Utils/Network.cpp |
| 264 |
Utils/Network.h |
| 265 |
Utils/ThreadSafeQueue.h |
| 266 |
Utils/Utils.cpp |
| 267 |
Utils/Utils.h |
| •268 |
) |
| 269 |
|
| 270 |
option(USE_SYSTEM_LIBRARIES "Build with system libraries" OFF) |
| 271 |
|
| •272 |
if (USE_SYSTEM_LIBRARIES) |
| 273 |
find_package(SQLite3) |
| 274 |
target_link_libraries(${PROJECT_NAME} PRIVATE SQLite::SQLite3) |
| 275 |
|
| 276 |
find_package(ZLIB) |
| 277 |
target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) |
| 278 |
else() |
| 279 |
target_include_directories(${PROJECT_NAME} PRIVATE Storage/sqlite) |
| 280 |
add_library(sqlite3 STATIC |
| 281 |
Storage/sqlite/sqlite3.c |
| 282 |
Storage/sqlite/sqlite3.h |
| 283 |
Storage/sqlite/sqlite3ext.h |
| 284 |
) |
| 285 |
target_link_libraries(${PROJECT_NAME} PRIVATE sqlite3) |
| 286 |
|
| 287 |
target_include_directories(${PROJECT_NAME} PRIVATE Hardware/zlib) |
| 288 |
add_library(zlib STATIC |
| 289 |
Hardware/zlib/adler32.c |
| 290 |
Hardware/zlib/compress.c |
| 291 |
Hardware/zlib/crc32.c |
| 292 |
Hardware/zlib/crc32.h |
| 293 |
Hardware/zlib/deflate.c |
| 294 |
Hardware/zlib/deflate.h |
| 295 |
Hardware/zlib/gzclose.c |
| 296 |
Hardware/zlib/gzguts.h |
| 297 |
Hardware/zlib/gzlib.c |
| 298 |
Hardware/zlib/gzread.c |
| 299 |
Hardware/zlib/gzwrite.c |
| 300 |
Hardware/zlib/infback.c |
| 301 |
Hardware/zlib/inffast.c |
| 302 |
Hardware/zlib/inffast.h |
| 303 |
Hardware/zlib/inffixed.h |
| 304 |
Hardware/zlib/inflate.c |
| 305 |
Hardware/zlib/inflate.h |
| 306 |
Hardware/zlib/inftrees.c |
| 307 |
Hardware/zlib/inftrees.h |
| 308 |
Hardware/zlib/trees.c |
| 309 |
Hardware/zlib/trees.h |
| 310 |
Hardware/zlib/uncompr.c |
| 311 |
Hardware/zlib/zconf.h |
| 312 |
Hardware/zlib/zlib.h |
| 313 |
Hardware/zlib/zutil.c |
| 314 |
Hardware/zlib/zutil.h |
| 315 |
) |
| 316 |
target_link_libraries(${PROJECT_NAME} PRIVATE zlib) |
| 317 |
endif() |
| 318 |
|
| 319 |
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") |
| 320 |
set(CMAKE_CXX_STANDARD 11) |
| 321 |
set(CMAKE_CXX_STANDARD_REQUIRED True) |
| •322 |
set(CMAKE_CXX_FLAGS_DEBUG "-O0") |
| 323 |
set(CMAKE_CXX_FLAGS_RELEASE "-O2") |
| 324 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -pedantic -Werror") |
| 325 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DHAVE_USLEEP -Wno-implicit-function-declaration -Wno-return-local-addr") |
| 326 |
|
| •327 |
set(THREADS_PREFER_PTHREAD_FLAG ON) |
| 328 |
find_package(Threads REQUIRED) |
| •329 |
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads dl) |
| 330 |
|
| •331 |
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}) |
| •332 |
target_compile_definitions(railcontrol PRIVATE HTML_DATA_PATH=\"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/railcontrol/html\") |
| 333 |
|
| •334 |
install(TARGETS ${PROJECT_NAME} DESTINATION bin) |
| 335 |
install(FILES railcontrol.conf.dist TYPE SYSCONF RENAME railcontrol.conf) |
| 336 |
install(DIRECTORY html DESTINATION ${CMAKE_INSTALL_DATADIR}/railcontrol) |
| 337 |
|
| 338 |
include(CPack) |