Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
a8ad1877
Commit
a8ad1877
authored
May 06, 2021
by
Alexander Lohnau
💬
Committed by
Nate Graham
May 06, 2021
Browse files
Avoid compiling source files for tests multiple times
Instead use a static lib for the files and link against that.
parent
6befb657
Changes
4
Hide whitespace changes
Inline
Side-by-side
applets/systemtray/CMakeLists.txt
View file @
a8ad1877
...
...
@@ -8,26 +8,27 @@ set(systemtray_SRCS
systemtraysettings.cpp
systemtraymodel.cpp
sortedsystemtraymodel.cpp
systemtray.cpp
)
ecm_qt_declare_logging_category
(
systemtray_SRCS HEADER debug.h
IDENTIFIER SYSTEM_TRAY
CATEGORY_NAME kde.systemtray
DEFAULT_SEVERITY Info
)
add_library
(
org.kde.plasma.private.systemtray MODULE
${
systemtray_SRCS
}
)
add_library
(
systemtraymodel_static STATIC
${
systemtray_SRCS
}
)
target_link_libraries
(
systemtraymodel_static
Qt::Gui
Qt::Quick
Qt::DBus
KF5::XmlGui
KF5::I18n
KF5::ItemModels
KF5::Plasma
)
add_library
(
org.kde.plasma.private.systemtray MODULE systemtray.cpp
)
kcoreaddons_desktop_to_json
(
org.kde.plasma.private.systemtray package/metadata.desktop
)
target_link_libraries
(
org.kde.plasma.private.systemtray
Qt::Gui
Qt::Quick
Qt::DBus
KF5::Plasma
KF5::XmlGui
KF5::I18n
KF5::ItemModels
)
target_link_libraries
(
org.kde.plasma.private.systemtray systemtraymodel_static
)
install
(
TARGETS org.kde.plasma.private.systemtray DESTINATION
${
KDE_INSTALL_PLUGINDIR
}
/plasma/applets
)
...
...
applets/systemtray/autotests/CMakeLists.txt
View file @
a8ad1877
include
(
ECMAddTests
)
set
(
systemtraymodel_test_SRCS
../dbusserviceobserver.cpp
../plasmoidregistry.cpp
../systemtraysettings.cpp
../systemtraymodel.cpp
../sortedsystemtraymodel.cpp
)
ecm_qt_declare_logging_category
(
systemtraymodel_test_SRCS HEADER debug.h
IDENTIFIER SYSTEM_TRAY
CATEGORY_NAME kde.systemtray
DEFAULT_SEVERITY Info
)
add_library
(
systemtraymodel_test STATIC
${
systemtraymodel_test_SRCS
}
)
target_link_libraries
(
systemtraymodel_test
Qt::Core
Qt::DBus
Qt::Quick
KF5::CoreAddons
KF5::I18n
KF5::ItemModels
KF5::Plasma
KF5::XmlGui
)
ecm_add_tests
(
systemtraymodeltest.cpp
LINK_LIBRARIES systemtraymodel_
te
st
LINK_LIBRARIES systemtraymodel_st
atic
Qt::Test
)
klipper/CMakeLists.txt
View file @
a8ad1877
...
...
@@ -29,11 +29,8 @@ configure_file(config-klipper.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-klipper
ki18n_wrap_ui
(
libklipper_common_SRCS generalconfig.ui actionsconfig.ui editactiondialog.ui
)
kconfig_add_kcfg_files
(
libklipper_common_SRCS klippersettings.kcfgc
)
set
(
klipper_SRCS
${
libklipper_common_SRCS
}
main.cpp tray.cpp
)
add_executable
(
klipper
${
klipper_SRCS
}
)
target_link_libraries
(
klipper
add_library
(
libklipper_common_static STATIC
${
libklipper_common_SRCS
}
)
target_link_libraries
(
libklipper_common_static
Qt::Concurrent
KF5::ConfigGui
KF5::CoreAddons
...
...
@@ -48,12 +45,16 @@ target_link_libraries(klipper
KF5::WidgetsAddons
KF5::XmlGui
${
ZLIB_LIBRARY
}
systemclipboard
)
systemclipboard
)
if
(
X11_FOUND
)
target_link_libraries
(
klipper XCB::XCB Qt::X11Extras
)
target_link_libraries
(
lib
klipper
_common_static
XCB::XCB Qt::X11Extras
)
endif
()
add_executable
(
klipper main.cpp tray.cpp
)
target_link_libraries
(
klipper
libklipper_common_static
)
install
(
TARGETS klipper
${
KDE_INSTALL_TARGETS_DEFAULT_ARGS
}
)
install
(
FILES org.kde.klipper.desktop DESTINATION
${
KDE_INSTALL_APPDIR
}
)
...
...
klipper/autotests/CMakeLists.txt
View file @
a8ad1877
add_definitions
(
-DKLIPPER_UNIT_TEST
)
include
(
ECMMarkAsTest
)
########################################################
# Test History
########################################################
set
(
libklipper_test_SRCS
)
ecm_qt_declare_logging_category
(
libklipper_test_SRCS HEADER klipper_debug.h IDENTIFIER KLIPPER_LOG CATEGORY_NAME org.kde.klipper
)
set
(
testHistory_SRCS
${
libklipper_test_SRCS
}
historytest.cpp
../history.cpp
../historyimageitem.cpp
../historyitem.cpp
../historystringitem.cpp
../historyurlitem.cpp
../historymodel.cpp
)
add_executable
(
testHistory
${
testHistory_SRCS
}
)
# Test History
add_executable
(
testHistory historytest.cpp
)
target_link_libraries
(
testHistory
Qt::Test
Qt::Widgets
# QAction
KF5::CoreAddons
# KUrlMimeData
KF5::I18n
libklipper_common_static
)
add_test
(
NAME klipper-testHistory COMMAND testHistory
)
ecm_mark_as_test
(
testHistory
)
########################################################
# Test History Model
########################################################
set
(
testHistoryModel_SRCS
historymodeltest.cpp
../historymodel.cpp
../historyimageitem.cpp
../historyitem.cpp
../historystringitem.cpp
../historyurlitem.cpp
${
libklipper_test_SRCS
}
)
add_executable
(
testHistoryModel
${
testHistoryModel_SRCS
}
)
add_executable
(
testHistoryModel historymodeltest.cpp
)
target_link_libraries
(
testHistoryModel
Qt::Test
Qt::Widgets
# QAction
KF5::CoreAddons
# KUrlMimeData
KF5::I18n
libklipper_common_static
)
add_test
(
NAME klipper-testHistoryModel COMMAND testHistoryModel
)
ecm_mark_as_test
(
testHistoryModel
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment