CMakeLists.txt 778 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 2.8)
  2. project(Handwriting LANGUAGES CXX)
  3. find_package(Qt5 COMPONENTS Quick Gui Core Qml REQUIRED)
  4. set(QT_PROTOBUF_MAKE_TESTS OFF)
  5. set(QT_PROTOBUF_MAKE_EXAMPLES OFF)
  6. add_subdirectory("qtprotobuf")
  7. find_package(QtProtobufProject CONFIG COMPONENTS QtProtobuf QtGrpc REQUIRED)
  8. if(Qt5_POSITION_INDEPENDENT_CODE)
  9. set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
  10. endif()
  11. file(GLOB PROTO_FILES ABSOLUTE "${CMAKE_CURRENT_SOURCE_DIR}/../handwriting.proto")
  12. set(CMAKE_AUTOMOC ON)
  13. set(CMAKE_AUTORCC ON)
  14. add_executable(HandwritingUi main.cpp qml.qrc handwritingengine.cpp)
  15. qtprotobuf_generate(TARGET HandwritingUi PROTO_FILES ${PROTO_FILES} QML)
  16. target_link_libraries(HandwritingUi PRIVATE Qt5::Gui QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc)