CMakeLists.txt 722 B

123456789101112131415161718192021
  1. set(TARGET qtprotobuf_plugin_test)
  2. include(${QT_PROTOBUF_CMAKE_DIR}/QtProtobufTest.cmake)
  3. find_package(Threads REQUIRED)
  4. find_package(Qt5 COMPONENTS Test REQUIRED)
  5. file(GLOB SOURCES
  6. serializationplugintest.cpp)
  7. add_executable(${TARGET} ${SOURCES})
  8. target_link_libraries(${TARGET} PRIVATE gtest_main gtest ${QT_PROTOBUF_PROJECT}::QtProtobuf ${QT_PROTOBUF_PROJECT}::QtGrpc Qt5::Core Qt5::Test Qt5::Network ${CMAKE_THREAD_LIBS_INIT})
  9. add_target_windeployqt(TARGET ${TARGET}
  10. QML_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  11. add_subdirectory("serialization")
  12. add_test(NAME ${TARGET} COMMAND ${TARGET})
  13. set_tests_properties(${TARGET} PROPERTIES
  14. ENVIRONMENT QT_PROTOBUF_PLUGIN_PATH=$<TARGET_FILE_DIR:serializationplugin>)