Review Request 126185: Make the KAppTemplate CMake module global

Alex Merry alex.merry at kde.org
Tue Dec 15 19:20:59 UTC 2015



> On Dec. 12, 2015, 3:35 p.m., Alex Merry wrote:
> > kde-modules/KDETemplateGenerator.cmake, line 84
> > <https://git.reviewboard.kde.org/r/126185/diff/4/?file=421458#file421458line84>
> >
> >     Use ``KDE_INSTALL_KTEMPLATESDIR`` instead of ``KTEMPLATES_INSTALL_DIR``. You also need to document that this variable needs to be set before using the command.
> >     
> >     My preference would actually be to make it explicit in the signature that installation will happen, by having the usage be something like
> >     
> >         kde_package_app_templates(
> >             TEMPLATES
> >                 foo
> >                 bar
> >                 baz
> >             INSTALL_DIR
> >                 "${KDE_INSTALL_KTEMPLATESDIR}"
> >         )
> >     
> >     My view is that this makes it explicit what will happen when you're reading the code - it will package the templates and install them. But I'm not going to force your hand on this if you'd rather not do it that way.
> 
> Marco Martin wrote:
>     would it still take ${KDE_INSTALL_KTEMPLATESDIR} as default or would be mandatory to be passed by the caller?

My preference would be to make it mandatory.


> On Dec. 12, 2015, 3:35 p.m., Alex Merry wrote:
> > kde-modules/KDETemplateGenerator.cmake, line 52
> > <https://git.reviewboard.kde.org/r/126185/diff/4/?file=421458#file421458line52>
> >
> >     Honestly, I'd just use ARG as the prefix - you're in a function, it's not going to leak anyway. That means you can refer to ARG_TEMPLATES, which is both shorter and more descriptive.
> >     
> >     You should also check for unparsed arguments, and for the TEMPLATES argument being missing or empty. See, eg, ECMAddAppIcon.cmake for how to do this.
> 
> Alex Merry wrote:
>     Oops, missed one thing here - you need to ``include(CMakeParseArguments)`` earlier in the file.

You still need to do the check for unparsed arguments and for ARG_TEMPLATES not being set (ie: the TEMPLATES keyword being missing).


> On Dec. 12, 2015, 3:35 p.m., Alex Merry wrote:
> > kde-modules/KDETemplateGenerator.cmake, line 14
> > <https://git.reviewboard.kde.org/r/126185/diff/4/?file=421458#file421458line14>
> >
> >     OK, what needs to be in the subdirectory? are template1, template2 etc the subdriectory names? The packages file name?
> >     
> >     The following sentence suggests this command only creates a single template tarball, but the signature here has multiple arguments.
> >     
> >     Also, the command doesn't need to include the word "template" twice. I suggest kde_add_app_template.
> >     
> >     Finally, the signature now includes the TEMPLATES keyword.
> 
> Marco Martin wrote:
>     the subdirectories have the uncompressed templates in it
>     the subdirectory names will correspond to the final package name.

OK, so this needs to go in the documentation. I would write it as

    kde_package_app_templates(TEMPLATES <template> [<template> [...]])
    
    TEMPLATES lists subdirectories containing template files; each ``<template>`` directory will be packaged into a file named ``<template>.tar.bz2`` and installed to the appropriate location.

You should also either describe what should go into a template, or point to documentation elsewhere that describes this.


- Alex


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126185/#review89388
-----------------------------------------------------------


On Dec. 15, 2015, 10:38 a.m., Marco Martin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126185/
> -----------------------------------------------------------
> 
> (Updated Dec. 15, 2015, 10:38 a.m.)
> 
> 
> Review request for Build System, KDE Frameworks, Plasma, Aleix Pol Gonzalez, and Simon Wächter.
> 
> 
> Repository: extra-cmake-modules
> 
> 
> Description
> -------
> 
> templates are very useful as teaching tool in order to make
> a minimal application that uses a certain framework.
> templates in the KAppTemplate repository will always get forgotten
> (plus kapptemplate is not really necessary as they work in kdevelop as well)
> An ideal situation would be frameworks having templates in their own repos
> with templates of barebone apps using the main framework features.
> In order to do that, the cmake stuff needed in order to correctly install
> a template needs to be ported to a place avaiable to all frameworks
> 
> 
> Diffs
> -----
> 
>   kde-modules/KDEInstallDirs.cmake b7cd34d 
>   kde-modules/KDETemplateGenerator.cmake PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/126185/diff/
> 
> 
> Testing
> -------
> 
> done some templates installed by plasma-framework
> 
> 
> Thanks,
> 
> Marco Martin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20151215/a4eb479e/attachment-0001.html>


More information about the Kde-buildsystem mailing list