You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. cmake_minimum_required(VERSION 3.5)
  2. project(zmodbus_upper_computer VERSION 0.1 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(CMAKE_EXPORT_COMPILE_COMMANDS ON)
  10. find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
  11. find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets SerialPort Charts Concurrent REQUIRED)
  12. include_directories(src)
  13. include_directories(./)
  14. include_directories(libzqt)
  15. add_compile_options(-Wall )
  16. set(PROJECT_SOURCES
  17. libzqt/logger.cpp
  18. libzqt/zqthread.cpp
  19. libzqt/QFunction.cpp
  20. src/main.cpp
  21. mainwindow.cpp
  22. mainwindow.h
  23. mainwindow.ui
  24. )
  25. add_executable(zmodbus_upper_computer WIN32
  26. ${PROJECT_SOURCES}
  27. )
  28. target_link_options(zmodbus_upper_computer PRIVATE -static -static-libgcc -static-libstdc++)
  29. target_link_libraries(zmodbus_upper_computer PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Concurrent wsock32)
  30. set_target_properties(zmodbus_upper_computer PROPERTIES
  31. MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
  32. MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
  33. MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
  34. )
  35. if(QT_VERSION_MAJOR EQUAL 6)
  36. qt_finalize_executable(zmodbus_upper_computer)
  37. endif()