D19830: Force build order to prevent build happening before ui .h file exists
Christophe Giboudeaux
noreply at phabricator.kde.org
Mon Mar 18 08:28:30 GMT 2019
cgiboudeaux added a comment.
Maybe the 'OBJECT'[1] target type could help here, e.g (builds locally, no idea if it could solve your race):
diff --git a/resources/kalarm/kalarm/CMakeLists.txt b/resources/kalarm/kalarm/CMakeLists.txt
index a57de92bb..5b3a6ca19 100644
--- a/resources/kalarm/kalarm/CMakeLists.txt
+++ b/resources/kalarm/kalarm/CMakeLists.txt
@@ -20,7 +20,6 @@ set(kalarmresource_SRCS
install(FILES kalarmresource.desktop DESTINATION "${KDE_INSTALL_DATAROOTDIR}/akonadi/agents")
-ki18n_wrap_ui(kalarmresource_SRCS ../shared/alarmtyperadiowidget.ui)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmresource.kcfg org.kde.Akonadi.KAlarm.Settings)
qt5_add_dbus_adaptor(kalarmresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.KAlarm.Settings.xml settings.h Akonadi_KAlarm_Resource::Settings icalsettingsadaptor ICalSettingsAdaptor)
@@ -29,7 +28,14 @@ ecm_qt_declare_logging_category(kalarmresource_SRCS HEADER kalarmresource_debug.
add_custom_target(kalarm_resource_xml ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.KAlarm.Settings.xml)
-add_executable(akonadi_kalarm_resource ${kalarmresource_SRCS})
+# ui_alartyperadiowidget.h is used by both akonadi_kalarm_resource and kalarmconfig
+ki18n_wrap_ui(kalarmresource_shared_SRCS ../shared/alarmtyperadiowidget.ui)
+add_library(akonadi_kalarm_resource_shared OBJECT ${kalarmresource_shared_SRCS})
+
+add_executable(akonadi_kalarm_resource
+ $<TARGET_OBJECTS:akonadi_kalarm_resource_shared>
+ ${kalarmresource_SRCS}
+)
if( APPLE )
set_target_properties(akonadi_kalarm_resource PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/../Info.plist.template)
@@ -54,6 +60,7 @@ install(TARGETS akonadi_kalarm_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
############################## Config plugin #################################
set(kalarmconfig_SRCS
+ $<TARGET_OBJECTS:akonadi_kalarm_resource_shared>
kalarmconfig.cpp
../shared/alarmtyperadiowidget.cpp
${kalarmresource_common_SRCS}
[1] https://cmake.org/cmake/help/v3.5/command/add_library.html#object-libraries
REPOSITORY
R44 KDE PIM Runtime
REVISION DETAIL
https://phabricator.kde.org/D19830
To: jriddell, mlaurent, #kde_pim, cgiboudeaux
Cc: pino, dvratil, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190318/a346d895/attachment.html>
More information about the kde-pim
mailing list