D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-25 Thread Friedrich W . H . Kossebau
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit R242:c03c2d526593: Help automoc to find metadata JSON files 
referenced in the code (authored by kossebau).

CHANGED PRIOR TO COMMIT
  https://phabricator.kde.org/D10732?vs=27868=28073#toc

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10732?vs=27868=28073

REVISION DETAIL
  https://phabricator.kde.org/D10732

AFFECTED FILES
  CMakeLists.txt
  KF5PlasmaConfig.cmake.in

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh


D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-25 Thread Friedrich W . H . Kossebau
kossebau added a comment.


  Given there was no principal objection and this code is following the pattern 
of D10724 , going to push now as well, so 
it gets some more field-testing before next weeks tagging.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D10732

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh, kmorwinski


D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-23 Thread Friedrich W . H . Kossebau
kossebau updated this revision to Diff 27868.
kossebau added a comment.


  have each macro added only once (closer to current draft of ECM macro)

REPOSITORY
  R242 Plasma Framework (Library)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D10732?vs=27751=27868

BRANCH
  useCMAKE_AUTOMOC_DEPEND_FILTERS

REVISION DETAIL
  https://phabricator.kde.org/D10732

AFFECTED FILES
  CMakeLists.txt
  KF5PlasmaConfig.cmake.in

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh


D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-22 Thread Friedrich W . H . Kossebau
kossebau added a comment.


  Thanks for review.
  
  > Can't we reuse this same code from kcoreaddons? Maybe kcoreaddons can offer 
a macro that does this?
  
  As hinted in the commit message, plan is to have some ECM macro instead, but 
only for 5.45 in a month, to not hurry macro signature design. Soon up for 
discussion though.
  
  Current draft/working prototype results in code like the following for 
CMakeLists.txt (replacing the complete current code to set up things with 
CMAKE_AUTOMOC_MACRO_NAMES & :CMAKE_AUTOMOC_DEPEND_FILTERS):
  
include(ECMSetupQtPluginMacros)

ecm_setup_qtplugin_macros(
JSON_NONE
"K_EXPORT_PLASMA_SERVICE"
"K_EXPORT_PLASMA_APPLET"
"K_EXPORT_PLASMA_PACKAGE"
"K_EXPORT_PLASMA_APPLETSCRIPTENGINE"
"K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE"
"K_EXPORT_PLASMA_DATAENGINE"
JSON_ARG2
"K_EXPORT_PLASMA_PACKAGE_WITH_JSON"
JSON_ARG3
"K_EXPORT_PLASMA_SERVICE_WITH_JSON"
"K_EXPORT_PLASMA_APPLET_WITH_JSON"
"K_EXPORT_PLASMA_APPLETSCRIPTENGINE_WITH_JSON"
"K_EXPORT_PLASMA_DATAENGINESCRIPTENGINE_WITH_JSON"
"K_EXPORT_PLASMA_CONTAINMENTACTIONS_WITH_JSON"
"K_EXPORT_PLASMA_DATAENGINE_WITH_JSON"
CONFIG_VARIABLE
 PACKAGE_SETUP_AUTOMOC_MACROS
)
  
  and in the KF5PlasmaConfig.cmake.in then just need some
  
@PACKAGE_SETUP_AUTOMOC_MACROS@
  
  The complete code copies as now in the patch are just a temporary solution by 
purpose, to already fix the issue, but without rushed new public API.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D10732

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh


D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-21 Thread Aleix Pol Gonzalez
apol added inline comments.

INLINE COMMENTS

> CMakeLists.txt:176
> +endforeach()
> +foreach(macro_name  ${Plasma_AUTOMOC_MACRO_NAMES_WITH_JSON_ARG3})
> +# tell automoc how to find names of plugin metadata files

Can't we reuse this same code from kcoreaddons? Maybe kcoreaddons can offer a 
macro that does this?

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D10732

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh


D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-21 Thread Friedrich W . H . Kossebau
kossebau added a comment.


  For more details see comments on D10724 

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D10732

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh


D10732: Help automoc to find metadata JSON files referenced in the code

2018-02-21 Thread Friedrich W . H . Kossebau
kossebau created this revision.
kossebau added reviewers: Frameworks, Build System, apol.
Restricted Application added a project: Frameworks.
kossebau requested review of this revision.

REVISION SUMMARY
  automoc by itself can only detect metadata files referenced by direct
  usage of the Q_PLUGIN_METADATA macro. It does not do any C++ preprocessor
  evaluation. Instead it needs to be helped with regexp-based filter rules
  for detecting any names of files used as additional moc input.
  See docs for AUTOMOC_DEPEND_FILTERS for further details.
  
  In the near future all the boilerplate code should be replaced with a yet to
  be designed ECM macro. For now explicit code is used to collect use cases
  for the macro and still to fix the issue already.

TEST PLAN
  Changing a JSON file (or for those generated from .desktop files
  changing that one) and running make results in the related *.moc file
  being regenerated and the related object file being recompiled.
  qtplugininfo shows that the created plugin binary has up-to-date JSON
  content.

REPOSITORY
  R242 Plasma Framework (Library)

BRANCH
  useCMAKE_AUTOMOC_DEPEND_FILTERS

REVISION DETAIL
  https://phabricator.kde.org/D10732

AFFECTED FILES
  CMakeLists.txt
  KF5PlasmaConfig.cmake.in

To: kossebau, #frameworks, #build_system, apol
Cc: michaelh