1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- find_package(Qt5 COMPONENTS Core Network REQUIRED)
- if (Qt5Core_VERSION VERSION_LESS "5.12.0")
- message(FATAL_ERROR "Required Qt version is 5.12+")
- endif()
- set(SUPPORT_LIBRARY_TARGET qtprotobufsupport)
- include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
- set(CMAKE_AUTOMOC ON)
- set(CMAKE_AUTORCC ON)
- if(Qt5_POSITION_INDEPENDENT_CODE)
- set(CMAKE_POSITION_INDEPENDENT_CODE ON)
- endif()
- file(GLOB SOURCES universallistmodelbase.cpp
- universallistmodel.cpp
- protobufobject.cpp
- qtprotobuf.cpp
- qtprotobuflogging.cpp
- asyncreply.cpp
- abstractchannel.cpp
- http2channel.cpp
- abstractclient.cpp)
- file(GLOB HEADERS universallistmodelbase.h
- universallistmodel.h
- protobufobject.h
- qtprotobuftypes.h
- qtprotobuf.h
- asyncreply.h
- abstractchannel.h
- http2channel.h
- abstractclient.h)
- add_library(${SUPPORT_LIBRARY_TARGET} ${SOURCES})
- set_target_properties(${SUPPORT_LIBRARY_TARGET} PROPERTIES PUBLIC_HEADER "${HEADERS}")
- target_link_libraries(${SUPPORT_LIBRARY_TARGET} Qt5::Core Qt5::Network)
- install(TARGETS ${SUPPORT_LIBRARY_TARGET}
- ARCHIVE DESTINATION lib
- PUBLIC_HEADER DESTINATION include)
|