Add option to compile with Qt 6

This commit is contained in:
Jonas Kvinge
2020-07-18 04:47:54 +02:00
parent 4307183817
commit f5b245c72d
11 changed files with 253 additions and 118 deletions

View File

@@ -20,20 +20,24 @@ if(APPLE)
list(APPEND SOURCES core/scoped_nsautorelease_pool.mm)
endif(APPLE)
qt5_wrap_cpp(MOC ${HEADERS})
if(WITH_QT6)
qt6_wrap_cpp(MOC ${HEADERS})
else()
qt5_wrap_cpp(MOC ${HEADERS})
endif()
link_directories(
${GLIB_LIBRARY_DIRS}
${Qt5Core_LIBRARY_DIRS}
${Qt5Network_LIBRARY_DIRS}
${QtCore_LIBRARY_DIRS}
${QtNetwork_LIBRARY_DIRS}
)
add_library(libstrawberry-common STATIC ${SOURCES} ${MOC})
target_include_directories(libstrawberry-common SYSTEM PRIVATE
${GLIB_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${QtCore_INCLUDE_DIRS}
${QtNetwork_INCLUDE_DIRS}
)
target_include_directories(libstrawberry-common PRIVATE
@@ -46,8 +50,8 @@ target_include_directories(libstrawberry-common PRIVATE
target_link_libraries(libstrawberry-common PRIVATE
${CMAKE_THREAD_LIBS_INIT}
${GLIB_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Network_LIBRARIES}
${QtCore_LIBRARIES}
${QtNetwork_LIBRARIES}
)
if(Backtrace_FOUND)