CMakeLists.txt 763 B

12345678910111213141516171819202122
  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. find_package(Qt5 COMPONENTS Core Quick REQUIRED)
  8. find_package(QtProtobufProject COMPONENTS QtProtobuf QtGrpc REQUIRED)
  9. add_executable(clienttutorial main.cpp echoclientengine.cpp qml.qrc)
  10. qtprotobuf_generate(TARGET clienttutorial PROTO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial.proto QML TRUE)
  11. target_compile_definitions(clienttutorial
  12. PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
  13. target_link_libraries(clienttutorial
  14. PRIVATE Qt5::Core Qt5::Quick)
  15. target_link_libraries(clienttutorial PRIVATE QtProtobufProject::QtGrpc QtProtobufProject::QtProtobuf)