CMakeLists.txt 875 B

12345678910111213141516171819202122232425262728
  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. if(Qt5_POSITION_INDEPENDENT_CODE)
  8. set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
  9. endif()
  10. set(CMAKE_CXX_STANDARD 14)
  11. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  12. add_executable(${TARGET} ${SOURCES})
  13. 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})
  14. add_target_windeployqt(TARGET ${TARGET}
  15. QML_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  16. add_subdirectory("serialization")
  17. add_test(NAME ${TARGET} COMMAND ${TARGET})
  18. set_tests_properties(${TARGET} PROPERTIES
  19. ENVIRONMENT QT_PROTOBUF_PLUGIN_PATH=$<TARGET_FILE_DIR:serializationplugin>)