CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. find_package(Qt5 COMPONENTS Core Network REQUIRED)
  2. if (Qt5Core_VERSION VERSION_LESS "5.12.0")
  3. message(FATAL_ERROR "Required Qt version is 5.12+")
  4. endif()
  5. set(SUPPORT_LIBRARY_TARGET qtprotobufsupport)
  6. include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
  7. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  8. set(CMAKE_AUTOMOC ON)
  9. set(CMAKE_AUTORCC ON)
  10. if(Qt5_POSITION_INDEPENDENT_CODE)
  11. set(CMAKE_POSITION_INDEPENDENT_CODE ON)
  12. endif()
  13. file(GLOB SOURCES universallistmodelbase.cpp
  14. universallistmodel.cpp
  15. protobufobject.cpp
  16. qtprotobuf.cpp
  17. qtprotobuflogging.cpp
  18. asyncreply.cpp
  19. abstractchannel.cpp
  20. http2channel.cpp
  21. abstractclient.cpp)
  22. file(GLOB HEADERS universallistmodelbase.h
  23. universallistmodel.h
  24. protobufobject.h
  25. qtprotobuftypes.h
  26. qtprotobuf.h
  27. asyncreply.h
  28. abstractchannel.h
  29. http2channel.h
  30. abstractclient.h)
  31. add_library(${SUPPORT_LIBRARY_TARGET} ${SOURCES})
  32. set_target_properties(${SUPPORT_LIBRARY_TARGET} PROPERTIES PUBLIC_HEADER "${HEADERS}")
  33. target_link_libraries(${SUPPORT_LIBRARY_TARGET} Qt5::Core Qt5::Network)
  34. install(TARGETS ${SUPPORT_LIBRARY_TARGET}
  35. ARCHIVE DESTINATION lib
  36. PUBLIC_HEADER DESTINATION include)