Question about Win32 CMake code in KDocTools and kdelibs4support

Alexander Richardson arichardson.kde at gmail.com
Mon Sep 22 14:36:22 UTC 2014


2014-09-21 16:41 GMT+02:00 Luigi Toscano <luigi.toscano at tiscali.it>:
> Hi!
> I was checking back two pieces of CMake code which you fixed for Win32
> (https://git.reviewboard.kde.org/r/115744/) and I have few questions.
>
> The code was originally only in kdoctools, but part of it was moved to
> kdelibs4support:
> http://quickgit.kde.org/?p=kdoctools.git&a=blob&h=341ecf4de48c994b930c800bbc936616aca2f6ea&hb=f3971c58066b9f495c614b7c9bd5dfbeb9bf482f&f=src%2FCMakeLists.txt#l7
>
> http://quickgit.kde.org/?p=kdelibs4support.git&a=blob&h=4a1d80dfff7a54af4441ea64020caaada387759e&hb=a6f6b3e7eed7b08914c9674bf22961f4cc203530&f=src%2FCMakeLists.txt#l629
>
> My goal here: I need to insert another command before the configure_file in
> order to percent-encode the URI (changeing DocBookXML4_DTD_DIR) before feeding
> it to configure_file, as the simple file path could be an invalid URI if it
> contains, for example, a space (it was found by our Mac porters).
>
> Now, I was wondering if I could unify more the two code branches, so that I
> can insert just one call to this external program (it needs to be done before
> configure_file) instead of two.
>
> Question time then :)
> - is the install(CODE part really needed? Can't we call the two lines (
> file(RELATIVE... and configure_file...) directly?  All the variables are know,
> for what I see.
> - the file ${_custom_dtd_kdex}.cmake is transformed as
> ${_custom_dtd_kdex}.install and then renamed back as ${_custom_dtd_kdex}. Is
> this double step needed? If not, the output file of configure_file in the
> WIN32 branch could be just called ${_custom_dtd_kdex} like in the non-Win32
> part of the code and the
> install(FILES ....
> part could be common to both branches
>
> What do you think ?

Hi,

I don't think the CODE part is needed, I just did it like that because
that's the way it was before.
However I am not sure, and I haven't got the complete history on my
machine so I don't know why it was introduced.

I'm forwarding this to kde-windows, I hope someone knows why it was
done like that.


Regards,
Alex


More information about the Kde-windows mailing list