123456789101112131415161718192021222324 |
- cmake_minimum_required(VERSION 2.8)
- project(SnakeSimulatorkUi LANGUAGES CXX)
- find_package(Qt5 COMPONENTS Quick Gui Core Qml REQUIRED)
- set(QT_PROTOBUF_MAKE_TESTS OFF CACHE BOOL "" FORCE)
- set(QT_PROTOBUF_MAKE_EXAMPLES OFF CACHE BOOL "" FORCE)
- add_subdirectory("qtprotobuf")
- find_package(QtProtobufProject CONFIG COMPONENTS QtProtobuf QtGrpc REQUIRED)
- if(Qt5_POSITION_INDEPENDENT_CODE)
- set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
- endif()
- file(GLOB PROTO_FILES ABSOLUTE "${CMAKE_CURRENT_SOURCE_DIR}/../snakesimulator/snakesimulator.proto")
- set(CMAKE_AUTOMOC ON)
- set(CMAKE_AUTORCC ON)
- add_executable(SnakeSimulatorkUi main.cpp qml.qrc clientwrapper.cpp)
- qtprotobuf_generate(TARGET SnakeSimulatorkUi PROTO_FILES ${PROTO_FILES} QML)
- target_link_libraries(SnakeSimulatorkUi PRIVATE Qt5::Gui QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc)
|