CMakeLists.txt 830 B

1234567891011121314151617181920212223
  1. cmake_minimum_required(VERSION 2.8)
  2. project(Handwriting LANGUAGES CXX)
  3. find_package(Qt5 COMPONENTS Quick Gui Core Qml REQUIRED)
  4. set(QTPROTOBUF_MAKE_TESTS false)
  5. set(QTPROTOBUF_MAKE_EXAMPLES false)
  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. generate_qtprotobuf(TARGET HandwritingUi PROTO_FILES ${PROTO_FILES} QML TRUE)
  13. set(CMAKE_AUTOMOC ON)
  14. set(CMAKE_AUTORCC ON)
  15. add_executable(HandwritingUi main.cpp qml.qrc handwritingengine.cpp)
  16. target_link_libraries(HandwritingUi Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc ${QtProtobuf_GENERATED})