CMakeLists.txt 1.0 KB

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