set(TARGET qtprotobuf_qml_test) qt_protobuf_internal_find_dependencies() set(CMAKE_AUTOMOC OFF) file(GLOB SOURCES main.cpp) file(GLOB QML_FILES qml/tst_simple.qml) qt5_wrap_cpp(MOC_SOURCES test.h) add_executable(${TARGET} ${MOC_SOURCES} ${SOURCES} ${QML_FILES}) target_link_libraries(${TARGET} PRIVATE Qt5::Core Qt5::Qml Qt5::Network Qt5::Quick Qt5::Test Qt5::QuickTest ${QT_PROTOBUF_NAMESPACE}::Protobuf) if(TARGET ${QT_PROTOBUF_NAMESPACE}::ProtobufWellKnownTypes) target_link_libraries(${TARGET} PRIVATE ${QT_PROTOBUF_NAMESPACE}::ProtobufWellKnownTypes) endif() if(QT_PROTOBUF_STATIC) target_link_libraries(${TARGET} PRIVATE ${QT_PROTOBUF_NAMESPACE}::${PROTOBUF_QUICK_PLUGIN_NAME}) endif() qtprotobuf_link_target(${TARGET} qtprotobuf_test_qtprotobuf_gen) qt_protobuf_internal_add_target_qml(TARGET ${TARGET} QML_FILES ${QML_FILES}) qt_protobuf_internal_add_target_windeployqt(TARGET ${TARGET} QML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qml) add_test(NAME ${TARGET} COMMAND ${TARGET}) if(NOT QT_PROTOBUF_STATIC AND NOT QT_PROTOBUF_STANDALONE_TESTS) set(path_separator ":") if(WIN32) set(path_separator "$") endif() set_tests_properties(${TARGET} PROPERTIES ENVIRONMENT "QML2_IMPORT_PATH=$ENV{QML2_IMPORT_PATH}${path_separator}\ $/.." ) endif()