CMakeLists.txt 966 B

123456789101112131415161718192021222324252627
  1. set(TARGET extra_namespace_qml_test)
  2. qt_protobuf_internal_find_dependencies()
  3. set(CMAKE_AUTOMOC OFF)
  4. file(GLOB SOURCES main.cpp)
  5. file(GLOB QML_FILES qml/tst_extra_namespace.qml)
  6. qt5_wrap_cpp(MOC_SOURCES test.h)
  7. add_executable(${TARGET} ${MOC_SOURCES} ${SOURCES} ${QML_FILES})
  8. target_link_libraries(${TARGET} PRIVATE Qt5::Core Qt5::Qml Qt5::Network Qt5::Quick Qt5::Test Qt5::QuickTest ${QT_PROTOBUF_NAMESPACE}::Protobuf)
  9. if(QT_PROTOBUF_STATIC)
  10. target_link_libraries(${TARGET} PRIVATE ${PROTOBUF_QUICK_PLUGIN_NAME})
  11. endif()
  12. qtprotobuf_link_target(${TARGET} qtprotobuf_extranamespace_test_qtprotobuf_gen)
  13. qt_protobuf_internal_add_target_qml(TARGET ${TARGET} QML_FILES ${QML_FILES})
  14. qt_protobuf_internal_add_target_windeployqt(TARGET ${TARGET} QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qml)
  15. add_test(NAME ${TARGET} COMMAND ${TARGET})
  16. set_tests_properties(${TARGET} PROPERTIES
  17. ENVIRONMENT QML2_IMPORT_PATH=$<TARGET_FILE_DIR:${PROTOBUF_QUICK_PLUGIN_NAME}>/..)