CMakeLists.txt 867 B

1234567891011121314151617181920212223242526
  1. cmake_minimum_required(VERSION 3.5)
  2. project(clienttutorial 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 14)
  8. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  9. set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  10. find_package(Qt5 COMPONENTS Core Quick REQUIRED)
  11. find_package(QtProtobufProject COMPONENTS QtProtobuf QtGrpc REQUIRED)
  12. add_executable(clienttutorial main.cpp echoclientengine.cpp qml.qrc)
  13. qtprotobuf_generate(TARGET clienttutorial PROTO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.proto QML TRUE)
  14. target_compile_definitions(clienttutorial
  15. PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
  16. target_link_libraries(clienttutorial
  17. PRIVATE Qt5::Core Qt5::Quick)
  18. target_link_libraries(clienttutorial PRIVATE QtProtobufProject::QtGrpc QtProtobufProject::QtProtobuf)