CMakeLists.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. cmake_minimum_required(VERSION 3.0)
  2. project(openPilotLog LANGUAGES CXX)
  3. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  4. set(CMAKE_AUTOUIC ON)
  5. set(CMAKE_AUTOMOC ON)
  6. set(CMAKE_AUTORCC ON)
  7. set(CMAKE_CXX_STANDARD 11)
  8. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  9. set(QT_MIN_VERSION "5.5.1")
  10. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_USE_QSTRINGBUILDER")
  11. MESSAGE ("Enabling QStringBuilder")
  12. find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
  13. find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets Sql Network LinguistTools REQUIRED)
  14. # find_package(OpenSSL REQUIRED) # Pending testing
  15. set(PROJECT_SOURCES
  16. main.cpp
  17. mainwindow.cpp
  18. src/classes/acurrencyentry.cpp
  19. src/classes/astyle.cpp
  20. src/classes/astandardpaths.cpp
  21. src/classes/aaircraftentry.cpp
  22. src/classes/adownload.cpp
  23. src/classes/aentry.cpp
  24. src/classes/aflightentry.cpp
  25. src/classes/apilotentry.cpp
  26. src/classes/arunguard.cpp
  27. src/classes/asettings.cpp
  28. src/classes/atailentry.cpp
  29. src/classes/atranslator.cpp
  30. src/database/adatabase.cpp
  31. src/database/adatabasesetup.cpp
  32. src/functions/acalc.cpp
  33. src/functions/alog.cpp
  34. src/functions/areadcsv.cpp
  35. src/functions/astat.cpp
  36. src/functions/adate.cpp
  37. src/gui/dialogues/firstrundialog.cpp
  38. src/gui/dialogues/newflightdialog.cpp
  39. src/gui/dialogues/newpilotdialog.cpp
  40. src/gui/dialogues/newtaildialog.cpp
  41. src/gui/widgets/aircraftwidget.cpp
  42. src/gui/widgets/backupwidget.cpp
  43. src/gui/widgets/debugwidget.cpp
  44. src/gui/widgets/homewidget.cpp
  45. src/gui/widgets/logbookwidget.cpp
  46. src/gui/widgets/pilotswidget.cpp
  47. src/gui/widgets/settingswidget.cpp
  48. src/testing/atimer.cpp
  49. src/opl.h
  50. mainwindow.h
  51. src/classes/acurrencyentry.h
  52. src/classes/astyle.h
  53. src/classes/astandardpaths.h
  54. src/classes/aaircraftentry.h
  55. src/classes/adownload.h
  56. src/classes/aentry.h
  57. src/classes/aflightentry.h
  58. src/classes/apilotentry.h
  59. src/classes/arunguard.h
  60. src/classes/asettings.h
  61. src/classes/atailentry.h
  62. src/classes/atranslator.h
  63. src/database/adatabase.h
  64. src/database/adatabasesetup.h
  65. src/database/adatabasetypes.h
  66. src/functions/acalc.h
  67. src/functions/adatetime.h
  68. src/functions/alog.h
  69. src/functions/areadcsv.h
  70. src/functions/astat.h
  71. src/functions/adate.h
  72. src/functions/atime.h
  73. src/gui/dialogues/firstrundialog.h
  74. src/gui/dialogues/newflightdialog.h
  75. src/gui/dialogues/newpilotdialog.h
  76. src/gui/dialogues/newtaildialog.h
  77. src/gui/widgets/aircraftwidget.h
  78. src/gui/widgets/backupwidget.h
  79. src/gui/widgets/debugwidget.h
  80. src/gui/widgets/homewidget.h
  81. src/gui/widgets/logbookwidget.h
  82. src/gui/widgets/pilotswidget.h
  83. src/gui/widgets/settingswidget.h
  84. src/testing/atimer.h
  85. mainwindow.ui
  86. src/gui/dialogues/firstrundialog.ui
  87. src/gui/dialogues/newflight.ui
  88. src/gui/dialogues/newpilot.ui
  89. src/gui/dialogues/newtail.ui
  90. src/gui/widgets/aircraftwidget.ui
  91. src/gui/widgets/backupwidget.ui
  92. src/gui/widgets/debugwidget.ui
  93. src/gui/widgets/homewidget.ui
  94. src/gui/widgets/logbookwidget.ui
  95. src/gui/widgets/pilotswidget.ui
  96. src/gui/widgets/settingswidget.ui
  97. assets/icons.qrc
  98. assets/themes/stylesheets/breeze/breeze.qrc
  99. assets/themes/stylesheets/qdarkstyle/qdarkstyle.qrc
  100. assets/templates.qrc
  101. )
  102. # This is currently a bit buggy, see
  103. # https://bugreports.qt.io/browse/QTBUG-41736
  104. # https://bugreports.qt.io/browse/QTBUG-76410
  105. # Before working on the translations themselves, check for updates and consider not updating for
  106. # every build due to danger of loss of translations...
  107. set(TS_FILES
  108. l10n/openpilotlog_en.ts
  109. l10n/openpilotlog_de.ts
  110. l10n/openpilotlog_es.ts
  111. )
  112. set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "l10n")
  113. qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
  114. if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
  115. qt_add_executable(openPilotLog
  116. ${PROJECT_SOURCES}
  117. ${QM_FILES}
  118. )
  119. else()
  120. add_executable(openPilotLog
  121. ${PROJECT_SOURCES}
  122. ${QM_FILES}
  123. )
  124. endif()
  125. # target_link_libraries(openPilotLog PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Sql Qt${QT_VERSION_MAJOR}::Network OpenSSL::SSL)
  126. target_link_libraries(openPilotLog PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Sql Qt${QT_VERSION_MAJOR}::Network)
  127. install(TARGETS openPilotLog DESTINATION bin)