CMakeLists.txt 859 B

1234567891011121314151617181920212223242526
  1. set(TARGET serializationplugin)
  2. set(TARGET_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${TARGET})
  3. set(TARGET_LIB_DIR ${CMAKE_INSTALL_LIBDIR})
  4. set(TARGET_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
  5. set(TARGET_BINDIR ${CMAKE_INSTALL_BINDIR})
  6. set(CMAKE_AUTOMOC ON)
  7. set(CMAKE_AUTORCC ON)
  8. find_package(Qt5 COMPONENTS Core REQUIRED)
  9. file(GLOB SOURCES
  10. qtserializationplugin.cpp
  11. qprotobufjsonserializerimpl.cpp
  12. qprotobufserializerimpl.cpp)
  13. file(GLOB HEADERS
  14. qtserializationplugin.h
  15. qtserialization_global.h)
  16. add_library(${TARGET} SHARED ${SOURCES})
  17. target_link_libraries(${TARGET} PRIVATE Qt5::Core Qt5::Qml ${QT_PROTOBUF_PROJECT}::QtProtobuf)
  18. target_compile_definitions(${TARGET} PRIVATE SERIALIZATION_LIB)
  19. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/serializeinfo.json" "${CMAKE_CURRENT_BINARY_DIR}/serializeinfo.json" COPYONLY)