Simplify CMake by using macros

This commit is contained in:
Jonas Kvinge 2021-07-30 21:17:50 +02:00
parent 0c9989695a
commit 7ce922b084
8 changed files with 67 additions and 221 deletions

View File

@ -10,11 +10,7 @@ endif()
set(SINGLEAPP-SOURCES singleapplication.cpp singleapplication_p.cpp) set(SINGLEAPP-SOURCES singleapplication.cpp singleapplication_p.cpp)
set(SINGLEAPP-MOC-HEADERS singleapplication.h singleapplication_p.h) set(SINGLEAPP-MOC-HEADERS singleapplication.h singleapplication_p.h)
if(BUILD_WITH_QT6) qt_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
qt6_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
else()
qt5_wrap_cpp(SINGLEAPP-SOURCES-MOC ${SINGLEAPP-MOC-HEADERS})
endif()
add_library(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC}) add_library(singleapplication STATIC ${SINGLEAPP-SOURCES} ${SINGLEAPP-SOURCES-MOC})
target_include_directories(singleapplication PRIVATE target_include_directories(singleapplication PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
@ -28,11 +24,7 @@ target_link_libraries(singleapplication PRIVATE
set(SINGLECOREAPP-SOURCES singlecoreapplication.cpp singlecoreapplication_p.cpp) set(SINGLECOREAPP-SOURCES singlecoreapplication.cpp singlecoreapplication_p.cpp)
set(SINGLECOREAPP-MOC-HEADERS singlecoreapplication.h singlecoreapplication_p.h) set(SINGLECOREAPP-MOC-HEADERS singlecoreapplication.h singlecoreapplication_p.h)
if(BUILD_WITH_QT6) qt_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
qt6_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
else()
qt5_wrap_cpp(SINGLECOREAPP-SOURCES-MOC ${SINGLECOREAPP-MOC-HEADERS})
endif()
add_library(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC}) add_library(singlecoreapplication STATIC ${SINGLECOREAPP-SOURCES} ${SINGLECOREAPP-SOURCES-MOC})
target_include_directories(singlecoreapplication PRIVATE target_include_directories(singlecoreapplication PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -200,6 +200,24 @@ if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
set(QT_LCONVERT_EXECUTABLE Qt${QT_VERSION_MAJOR}::lconvert) set(QT_LCONVERT_EXECUTABLE Qt${QT_VERSION_MAJOR}::lconvert)
endif() endif()
if(BUILD_WITH_QT5 AND Qt5Core_VERSION VERSION_LESS 5.15.0)
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
macro(qt_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
endif()
if(X11_FOUND) if(X11_FOUND)
find_path(KEYSYMDEF_H NAMES "keysymdef.h" PATHS "${X11_INCLUDE_DIR}" PATH_SUFFIXES "X11") find_path(KEYSYMDEF_H NAMES "keysymdef.h" PATHS "${X11_INCLUDE_DIR}" PATH_SUFFIXES "X11")
find_path(XF86KEYSYM_H NAMES "XF86keysym.h" PATHS "${XCB_INCLUDEDIR}" PATH_SUFFIXES "X11") find_path(XF86KEYSYM_H NAMES "XF86keysym.h" PATHS "${XCB_INCLUDEDIR}" PATH_SUFFIXES "X11")

View File

@ -15,11 +15,7 @@ macro(optional_source TOGGLE)
list(APPEND OTHER_SOURCES ${OPTIONAL_SOURCE_HEADERS}) list(APPEND OTHER_SOURCES ${OPTIONAL_SOURCE_HEADERS})
set(_uic_sources) set(_uic_sources)
if(BUILD_WITH_QT6) qt_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
qt6_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
else()
qt5_wrap_ui(_uic_sources ${OPTIONAL_SOURCE_UI})
endif()
list(APPEND OTHER_SOURCES ${_uic_sources}) list(APPEND OTHER_SOURCES ${_uic_sources})
list(APPEND OTHER_UIC_SOURCES ${_uic_sources}) list(APPEND OTHER_UIC_SOURCES ${_uic_sources})
endif(${TOGGLE}) endif(${TOGGLE})

View File

@ -75,10 +75,6 @@ macro(add_po outfiles po_prefix)
file(APPEND ${_qrc} "<file>${po_prefix}${_lang}.qm</file>") file(APPEND ${_qrc} "<file>${po_prefix}${_lang}.qm</file>")
endforeach(_lang) endforeach(_lang)
file(APPEND ${_qrc} "</qresource></RCC>") file(APPEND ${_qrc} "</qresource></RCC>")
if(BUILD_WITH_QT6) qt_add_resources(${outfiles} ${_qrc})
qt6_add_resources(${outfiles} ${_qrc})
else()
qt5_add_resources(${outfiles} ${_qrc})
endif()
endif() endif()
endmacro(add_po) endmacro(add_po)

View File

@ -14,11 +14,7 @@ set(HEADERS
core/workerpool.h core/workerpool.h
) )
if(BUILD_WITH_QT6) qt_wrap_cpp(MOC ${HEADERS})
qt6_wrap_cpp(MOC ${HEADERS})
else()
qt5_wrap_cpp(MOC ${HEADERS})
endif()
link_directories(${GLIB_LIBRARY_DIRS}) link_directories(${GLIB_LIBRARY_DIRS})

View File

@ -5,11 +5,7 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(SOURCES main.cpp tagreaderworker.cpp) set(SOURCES main.cpp tagreaderworker.cpp)
set(HEADERS tagreaderworker.h) set(HEADERS tagreaderworker.h)
if(BUILD_WITH_QT6) qt_wrap_cpp(MOC ${HEADERS})
qt6_wrap_cpp(MOC ${HEADERS})
else()
qt5_wrap_cpp(MOC ${HEADERS})
endif()
link_directories(${GLIB_LIBRARY_DIRS}) link_directories(${GLIB_LIBRARY_DIRS})

View File

@ -567,10 +567,7 @@ option(USE_INSTALL_PREFIX "Look for data in CMAKE_INSTALL_PREFIX" ON)
if(NOT APPLE) if(NOT APPLE)
set(NOT_APPLE ON) set(NOT_APPLE ON)
optional_source(NOT_APPLE optional_source(NOT_APPLE SOURCES widgets/qsearchfield_nonmac.cpp core/qtsystemtrayicon.cpp HEADERS core/qtsystemtrayicon.h)
SOURCES widgets/qsearchfield_nonmac.cpp core/qtsystemtrayicon.cpp
HEADERS core/qtsystemtrayicon.h
)
endif() endif()
if(HAVE_GLOBALSHORTCUTS) if(HAVE_GLOBALSHORTCUTS)
@ -590,29 +587,16 @@ if(HAVE_GLOBALSHORTCUTS)
SOURCES globalshortcuts/globalshortcutsbackend-system.cpp globalshortcuts/globalshortcut.cpp SOURCES globalshortcuts/globalshortcutsbackend-system.cpp globalshortcuts/globalshortcut.cpp
HEADERS globalshortcuts/globalshortcutsbackend-system.h globalshortcuts/globalshortcut.h HEADERS globalshortcuts/globalshortcutsbackend-system.h globalshortcuts/globalshortcut.h
) )
optional_source(HAVE_X11_GLOBALSHORTCUTS optional_source(HAVE_X11_GLOBALSHORTCUTS SOURCES globalshortcuts/globalshortcut-x11.cpp)
SOURCES globalshortcuts/globalshortcut-x11.cpp optional_source(WIN32 SOURCES globalshortcuts/globalshortcut-win.cpp)
)
optional_source(WIN32
SOURCES globalshortcuts/globalshortcut-win.cpp
)
endif() endif()
endif(HAVE_GLOBALSHORTCUTS) endif(HAVE_GLOBALSHORTCUTS)
# ALSA # ALSA
optional_source(HAVE_ALSA optional_source(HAVE_ALSA SOURCES engine/alsadevicefinder.cpp engine/alsapcmdevicefinder.cpp)
SOURCES
engine/alsadevicefinder.cpp
engine/alsapcmdevicefinder.cpp
)
# DBUS # DBUS
optional_source(HAVE_DBUS optional_source(HAVE_DBUS SOURCES osd/osddbus.cpp HEADERS osd/osddbus.h)
SOURCES
osd/osddbus.cpp
HEADERS
osd/osddbus.h
)
# GStreamer # GStreamer
optional_source(HAVE_GSTREAMER optional_source(HAVE_GSTREAMER
@ -621,107 +605,35 @@ optional_source(HAVE_GSTREAMER
) )
# VLC # VLC
optional_source(HAVE_VLC optional_source(HAVE_VLC SOURCES engine/vlcengine.cpp HEADERS engine/vlcengine.h)
SOURCES engine/vlcengine.cpp
HEADERS engine/vlcengine.h
)
# DBUS and MPRIS - Unix specific # DBUS and MPRIS - Unix specific
if(UNIX AND HAVE_DBUS) if(UNIX AND HAVE_DBUS)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus)
optional_source(HAVE_DBUS optional_source(HAVE_DBUS SOURCES core/mpris2.cpp HEADERS core/mpris2.h)
SOURCES core/mpris2.cpp optional_source(HAVE_UDISKS2 SOURCES device/udisks2lister.cpp HEADERS device/udisks2lister.h)
HEADERS core/mpris2.h
)
optional_source(HAVE_UDISKS2
SOURCES device/udisks2lister.cpp
HEADERS device/udisks2lister.h
)
if (BUILD_WITH_QT6) # MPRIS 2.0 DBUS interfaces
qt_add_dbus_adaptor(SOURCES dbus/org.mpris.MediaPlayer2.Player.xml core/mpris2.h mpris::Mpris2 core/mpris2_player Mpris2Player)
qt_add_dbus_adaptor(SOURCES dbus/org.mpris.MediaPlayer2.xml core/mpris2.h mpris::Mpris2 core/mpris2_root Mpris2Root)
qt_add_dbus_adaptor(SOURCES dbus/org.mpris.MediaPlayer2.TrackList.xml core/mpris2.h mpris::Mpris2 core/mpris2_tracklist Mpris2TrackList)
# MPRIS 2.0 DBUS interfaces # MPRIS 2.1 DBUS interfaces
qt6_add_dbus_adaptor(SOURCES qt_add_dbus_adaptor(SOURCES dbus/org.mpris.MediaPlayer2.Playlists.xml core/mpris2.h mpris::Mpris2 core/mpris2_playlists Mpris2Playlists)
dbus/org.mpris.MediaPlayer2.Player.xml
core/mpris2.h mpris::Mpris2 core/mpris2_player Mpris2Player)
qt6_add_dbus_adaptor(SOURCES
dbus/org.mpris.MediaPlayer2.xml
core/mpris2.h mpris::Mpris2 core/mpris2_root Mpris2Root)
qt6_add_dbus_adaptor(SOURCES
dbus/org.mpris.MediaPlayer2.TrackList.xml
core/mpris2.h mpris::Mpris2 core/mpris2_tracklist Mpris2TrackList)
# MPRIS 2.1 DBUS interfaces # org.freedesktop.Notifications DBUS interface
qt6_add_dbus_adaptor(SOURCES qt_add_dbus_interface(SOURCES dbus/org.freedesktop.Notifications.xml dbus/notification)
dbus/org.mpris.MediaPlayer2.Playlists.xml
core/mpris2.h mpris::Mpris2 core/mpris2_playlists Mpris2Playlists)
# org.freedesktop.Notifications DBUS interface # org.gnome.SettingsDaemon interface
qt6_add_dbus_interface(SOURCES qt_add_dbus_interface(SOURCES dbus/org.gnome.SettingsDaemon.MediaKeys.xml dbus/gnomesettingsdaemon)
dbus/org.freedesktop.Notifications.xml
dbus/notification)
# org.gnome.SettingsDaemon interface # org.mate.SettingsDaemon interface
qt6_add_dbus_interface(SOURCES qt_add_dbus_interface(SOURCES dbus/org.mate.SettingsDaemon.MediaKeys.xml dbus/matesettingsdaemon)
dbus/org.gnome.SettingsDaemon.MediaKeys.xml
dbus/gnomesettingsdaemon)
# org.mate.SettingsDaemon interface # org.kde.KGlobalAccel interface
qt6_add_dbus_interface(SOURCES qt_add_dbus_interface(SOURCES dbus/org.kde.KGlobalAccel.xml dbus/kglobalaccel)
dbus/org.mate.SettingsDaemon.MediaKeys.xml qt_add_dbus_interface(SOURCES dbus/org.kde.KGlobalAccel.Component.xml dbus/kglobalaccelcomponent)
dbus/matesettingsdaemon)
# org.kde.KGlobalAccel interface
qt6_add_dbus_interface(SOURCES
dbus/org.kde.KGlobalAccel.xml
dbus/kglobalaccel)
qt6_add_dbus_interface(SOURCES
dbus/org.kde.KGlobalAccel.Component.xml
dbus/kglobalaccelcomponent)
else()
# MPRIS 2.0 DBUS interfaces
qt5_add_dbus_adaptor(SOURCES
dbus/org.mpris.MediaPlayer2.Player.xml
core/mpris2.h mpris::Mpris2 core/mpris2_player Mpris2Player)
qt5_add_dbus_adaptor(SOURCES
dbus/org.mpris.MediaPlayer2.xml
core/mpris2.h mpris::Mpris2 core/mpris2_root Mpris2Root)
qt5_add_dbus_adaptor(SOURCES
dbus/org.mpris.MediaPlayer2.TrackList.xml
core/mpris2.h mpris::Mpris2 core/mpris2_tracklist Mpris2TrackList)
# MPRIS 2.1 DBUS interfaces
qt5_add_dbus_adaptor(SOURCES
dbus/org.mpris.MediaPlayer2.Playlists.xml
core/mpris2.h mpris::Mpris2 core/mpris2_playlists Mpris2Playlists)
# org.freedesktop.Notifications DBUS interface
qt5_add_dbus_interface(SOURCES
dbus/org.freedesktop.Notifications.xml
dbus/notification)
# org.gnome.SettingsDaemon interface
qt5_add_dbus_interface(SOURCES
dbus/org.gnome.SettingsDaemon.MediaKeys.xml
dbus/gnomesettingsdaemon)
# org.mate.SettingsDaemon interface
qt5_add_dbus_interface(SOURCES
dbus/org.mate.SettingsDaemon.MediaKeys.xml
dbus/matesettingsdaemon)
# org.kde.KGlobalAccel interface
qt5_add_dbus_interface(SOURCES
dbus/org.kde.KGlobalAccel.xml
dbus/kglobalaccel)
qt5_add_dbus_interface(SOURCES
dbus/org.kde.KGlobalAccel.Component.xml
dbus/kglobalaccelcomponent)
endif()
# org.freedesktop.Avahi.Server interface # org.freedesktop.Avahi.Server interface
add_custom_command( add_custom_command(
@ -752,50 +664,17 @@ if(UNIX AND HAVE_DBUS)
list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dbus/avahientrygroup.cpp) list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dbus/avahientrygroup.cpp)
if(HAVE_UDISKS2) if(HAVE_UDISKS2)
set_source_files_properties(dbus/org.freedesktop.DBus.ObjectManager.xml set_source_files_properties(dbus/org.freedesktop.DBus.ObjectManager.xml PROPERTIES NO_NAMESPACE dbus/objectmanager INCLUDE dbus/metatypes.h)
PROPERTIES NO_NAMESPACE dbus/objectmanager INCLUDE dbus/metatypes.h) set_source_files_properties(dbus/org.freedesktop.UDisks2.Filesystem.xml PROPERTIES NO_NAMESPACE dbus/udisks2filesystem INCLUDE dbus/metatypes.h)
set_source_files_properties(dbus/org.freedesktop.UDisks2.Filesystem.xml set_source_files_properties(dbus/org.freedesktop.UDisks2.Block.xml PROPERTIES NO_NAMESPACE dbus/udisks2block INCLUDE dbus/metatypes.h)
PROPERTIES NO_NAMESPACE dbus/udisks2filesystem INCLUDE dbus/metatypes.h) set_source_files_properties(dbus/org.freedesktop.UDisks2.Drive.xml PROPERTIES NO_NAMESPACE dbus/udisks2drive INCLUDE dbus/metatypes.h)
set_source_files_properties(dbus/org.freedesktop.UDisks2.Block.xml set_source_files_properties(dbus/org.freedesktop.UDisks2.Job.xml PROPERTIES NO_NAMESPACE dbus/udisks2job INCLUDE dbus/metatypes.h)
PROPERTIES NO_NAMESPACE dbus/udisks2block INCLUDE dbus/metatypes.h) qt_add_dbus_interface(SOURCES dbus/org.freedesktop.DBus.ObjectManager.xml dbus/objectmanager)
set_source_files_properties(dbus/org.freedesktop.UDisks2.Drive.xml qt_add_dbus_interface(SOURCES dbus/org.freedesktop.UDisks2.Filesystem.xml dbus/udisks2filesystem)
PROPERTIES NO_NAMESPACE dbus/udisks2drive INCLUDE dbus/metatypes.h) qt_add_dbus_interface(SOURCES dbus/org.freedesktop.UDisks2.Block.xml dbus/udisks2block)
set_source_files_properties(dbus/org.freedesktop.UDisks2.Job.xml qt_add_dbus_interface(SOURCES dbus/org.freedesktop.UDisks2.Drive.xml dbus/udisks2drive)
PROPERTIES NO_NAMESPACE dbus/udisks2job INCLUDE dbus/metatypes.h) qt_add_dbus_interface(SOURCES dbus/org.freedesktop.UDisks2.Job.xml dbus/udisks2job)
if(BUILD_WITH_QT6) endif(HAVE_UDISKS2)
qt6_add_dbus_interface(SOURCES
dbus/org.freedesktop.DBus.ObjectManager.xml
dbus/objectmanager)
qt6_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Filesystem.xml
dbus/udisks2filesystem)
qt6_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Block.xml
dbus/udisks2block)
qt6_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Drive.xml
dbus/udisks2drive)
qt6_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Job.xml
dbus/udisks2job)
else()
qt5_add_dbus_interface(SOURCES
dbus/org.freedesktop.DBus.ObjectManager.xml
dbus/objectmanager)
qt5_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Filesystem.xml
dbus/udisks2filesystem)
qt5_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Block.xml
dbus/udisks2block)
qt5_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Drive.xml
dbus/udisks2drive)
qt5_add_dbus_interface(SOURCES
dbus/org.freedesktop.UDisks2.Job.xml
dbus/udisks2job)
endif()
endif(HAVE_UDISKS2)
endif(UNIX AND HAVE_DBUS) endif(UNIX AND HAVE_DBUS)
@ -837,10 +716,7 @@ optional_source(HAVE_LIBGPOD
) )
# GIO device backend # GIO device backend
optional_source(HAVE_GIO optional_source(HAVE_GIO SOURCES device/giolister.cpp HEADERS device/giolister.h)
SOURCES device/giolister.cpp
HEADERS device/giolister.h
)
# MTP device # MTP device
optional_source(HAVE_LIBMTP optional_source(HAVE_LIBMTP
@ -855,10 +731,7 @@ optional_source(HAVE_LIBMTP
) )
# Pulse audio integration # Pulse audio integration
optional_source(HAVE_LIBPULSE optional_source(HAVE_LIBPULSE SOURCES engine/pulsedevicefinder.cpp)
SOURCES
engine/pulsedevicefinder.cpp
)
# Transcoder require GStreamer # Transcoder require GStreamer
optional_source(HAVE_GSTREAMER optional_source(HAVE_GSTREAMER
@ -946,22 +819,15 @@ optional_source(APPLE
engine/macosdevicefinder.cpp engine/macosdevicefinder.cpp
globalshortcuts/globalshortcutsbackend-macos.mm globalshortcuts/globalshortcutsbackend-macos.mm
globalshortcuts/globalshortcutgrabber.mm globalshortcuts/globalshortcutgrabber.mm
device/macosdevicelister.mm
HEADERS HEADERS
core/macsystemtrayicon.h core/macsystemtrayicon.h
core/macfslistener.h core/macfslistener.h
osd/osdmac.h osd/osdmac.h
globalshortcuts/globalshortcutsbackend-macos.h globalshortcuts/globalshortcutsbackend-macos.h
device/macosdevicelister.h
) )
if (APPLE)
optional_source(HAVE_LIBMTP
SOURCES
device/macosdevicelister.mm
HEADERS
device/macosdevicelister.h
)
endif()
# Platform specific - Windows # Platform specific - Windows
optional_source(WIN32 optional_source(WIN32
SOURCES SOURCES
@ -1062,15 +928,9 @@ optional_source(HAVE_MOODBAR
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
if(BUILD_WITH_QT6) qt_wrap_cpp(MOC ${HEADERS})
qt6_wrap_cpp(MOC ${HEADERS}) qt_wrap_ui(UIC ${UI})
qt6_wrap_ui(UIC ${UI}) qt_add_resources(QRC ${RESOURCES})
qt6_add_resources(QRC ${RESOURCES})
else()
qt5_wrap_cpp(MOC ${HEADERS})
qt5_wrap_ui(UIC ${UI})
qt5_add_resources(QRC ${RESOURCES})
endif()
if(HAVE_TRANSLATIONS) if(HAVE_TRANSLATIONS)

View File

@ -11,11 +11,7 @@ set(TESTUTILS-SOURCES
set(TESTUTILS-MOC-HEADERS src/mock_networkaccessmanager.h src/test_utils.h src/testobjectdecorators.h) set(TESTUTILS-MOC-HEADERS src/mock_networkaccessmanager.h src/test_utils.h src/testobjectdecorators.h)
if(BUILD_WITH_QT6) qt_wrap_cpp(TESTUTILS-SOURCES-MOC ${TESTUTILS-MOC-HEADERS})
qt6_wrap_cpp(TESTUTILS-SOURCES-MOC ${TESTUTILS-MOC-HEADERS})
else()
qt5_wrap_cpp(TESTUTILS-SOURCES-MOC ${TESTUTILS-MOC-HEADERS})
endif()
link_directories( link_directories(
${SQLITE_LIBRARY_DIRS} ${SQLITE_LIBRARY_DIRS}
@ -69,11 +65,7 @@ add_custom_target(strawberry_tests echo "Running Strawberry tests" WORKING_DIREC
add_custom_target(build_tests WORKING_DIRECTORY ${CURRENT_BINARY_DIR}) add_custom_target(build_tests WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
add_dependencies(strawberry_tests build_tests) add_dependencies(strawberry_tests build_tests)
if(BUILD_WITH_QT6) qt_add_resources(TEST-RESOURCE-SOURCES data/testdata.qrc)
qt6_add_resources(TEST-RESOURCE-SOURCES data/testdata.qrc)
else()
qt5_add_resources(TEST-RESOURCE-SOURCES data/testdata.qrc)
endif()
add_library(test_gui_main STATIC EXCLUDE_FROM_ALL ${TEST-RESOURCE-SOURCES} src/main.cpp) add_library(test_gui_main STATIC EXCLUDE_FROM_ALL ${TEST-RESOURCE-SOURCES} src/main.cpp)
target_include_directories(test_gui_main PRIVATE target_include_directories(test_gui_main PRIVATE