CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. cmake_minimum_required(VERSION 2.8)
  2. project(NeuralNetworkUi LANGUAGES CXX)
  3. set(TARGET NeuralNetworkUi)
  4. find_package(Qt5 COMPONENTS Quick Gui Core Qml REQUIRED)
  5. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/qtprotobuf/CMakeLists.txt")
  6. set(QT_PROTOBUF_MAKE_TESTS OFF CACHE BOOL "" FORCE)
  7. set(QT_PROTOBUF_MAKE_EXAMPLES OFF CACHE BOOL "" FORCE)
  8. set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
  9. add_subdirectory("qtprotobuf")
  10. endif()
  11. find_package(QtProtobufProject CONFIG COMPONENTS QtProtobuf QtGrpc REQUIRED)
  12. if(Qt5_POSITION_INDEPENDENT_CODE)
  13. set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
  14. endif()
  15. file(GLOB PROTO_FILES ABSOLUTE "${CMAKE_CURRENT_SOURCE_DIR}/../../NeuralNetwork/remotecontrol/remotecontrol.proto")
  16. file(GLOB VISUALIZATION_PROTO "${CMAKE_CURRENT_SOURCE_DIR}/../visualization/visualization.proto")
  17. message("PROTO_FILES: ${PROTO_FILES} ${VISUALIZATION_PROTO}")
  18. set(CMAKE_AUTOMOC ON)
  19. set(CMAKE_AUTORCC ON)
  20. add_executable(NeuralNetworkUi main.cpp qml.qrc valueindicator.cpp visualizermodel.cpp dense.cpp layertrigger.cpp)
  21. qtprotobuf_generate(TARGET ${TARGET} PROTO_FILES ${PROTO_FILES} ${VISUALIZATION_PROTO} QML)
  22. target_link_libraries(NeuralNetworkUi PRIVATE Qt5::Gui QtProtobufProject::QtProtobuf QtProtobufProject::QtGrpc)