mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-22 21:54:00 +02:00
qt5: cmake: allow building Tomahawk against Qt4 and Qt5
This commit is contained in:
@@ -59,12 +59,12 @@ macro(add_tomahawk_plugin)
|
||||
# qt stuff
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(PLUGIN_UI)
|
||||
qt4_wrap_ui(PLUGIN_UI_SOURCES ${PLUGIN_UI})
|
||||
qt_wrap_ui(PLUGIN_UI_SOURCES ${PLUGIN_UI})
|
||||
list(APPEND PLUGIN_SOURCES ${PLUGIN_UI_SOURCES})
|
||||
endif()
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources.qrc")
|
||||
qt4_add_resources(PLUGIN_RC_SOURCES "resources.qrc")
|
||||
qt_add_resources(PLUGIN_RC_SOURCES "resources.qrc")
|
||||
list(APPEND PLUGIN_SOURCES ${PLUGIN_RC_SOURCES})
|
||||
unset(PLUGIN_RC_SOURCES)
|
||||
endif()
|
||||
@@ -72,6 +72,9 @@ macro(add_tomahawk_plugin)
|
||||
# add target
|
||||
add_library(${target} MODULE ${PLUGIN_SOURCES})
|
||||
|
||||
# add qt modules
|
||||
qt5_use_modules(${target} Core Network Widgets Sql Xml DBus)
|
||||
|
||||
# definitions - can this be moved into set_target_properties below?
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
set_target_properties(${target} PROPERTIES AUTOMOC TRUE COMPILE_DEFINITIONS ${PLUGIN_EXPORT_MACRO})
|
||||
|
Reference in New Issue
Block a user