Review Request 119300: extra-cmake-modules: Fix using the same variable for camelCase and REQUIRED_HEADERS causes problems.
Andreas Xavier
andxav at zoho.com
Tue Jul 15 21:35:55 UTC 2014
> On July 15, 2014, 6:27 p.m., Alex Merry wrote:
> > modules/ECMGenerateHeaders.cmake, line 150
> > <https://git.reviewboard.kde.org/r/119300/diff/1/?file=290331#file290331line150>
> >
> > This test doesn't do what you think it does. Rather than comparing "${camelcase_headers_var}" with "${EGH_REQUIRED_HEADERS}", it will compare "${${camelcase_headers_var}}" with "${${EGH_REQUIRED_HEADERS}}". Unintuitive, I know.
Entirely my mistake. All of frameworks compiled with no changes.
Thank you for taking the time to look at this.
I am now running with :
cmake version 3.0.20140712-g2eadd1
One nameless Konsole tab over I was running with :
cmake version 2.8.12.2
It might be worth noting that with the changes in this patch cmake 2.8.12.2 was able to compile frameworks all the way to KHTML with no complaints. Clearly, I am a cmake novice, but if this patch doesn't break the build with 3.0 and it makes it possible to build it with 2.8.12.2 it might make the overall build more robust.
Once again thanks for your time.
- Andreas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119300/#review62408
-----------------------------------------------------------
On July 15, 2014, 1:38 p.m., Andreas Xavier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119300/
> -----------------------------------------------------------
>
> (Updated July 15, 2014, 1:38 p.m.)
>
>
> Review request for KDE Frameworks, Alex Merry and Michael Pyne.
>
>
> Repository: extra-cmake-modules
>
>
> Description
> -------
>
> First, this is my first attempt at building frameworks, so the problem is most likely on my end. However, following the instructions at https://community.kde.org/Frameworks/Building/Details I found this problem.
>
> Using the same variable name for camelCase var1 and REQUIRED_HEADERS var2 in the new ecm_generate_headers() syntax, when it is called more than once only exports the headers from the first invokation of ecm_generate_headers(), where var1 and var2 are defined as follows.
>
> ecm_generate_headers(var1
> ...
> REQUIRED_HEADERS var2
> )
>
> It doesn't show up in existing builds because cmake doesn't delete old header files, so all accumulated headers remain in the build.
>
> There are some projects in kde-frameworks that use the same variable name for var1 and var2, for example kcoreaddons.
>
> Steps to Replicate Using KCoreAddons as an example:
>
> 1. Delete the existing header files for KCoreAddons and the existing build files.
> rm -r $KF5/KcoreAddons
> rm -r <your kcoreaddons/build directory>
> 2. Re-build kcoreaddons from a new build dir
> cmake -DCMAKE_INSTALL_PREFIX=$KF5 ..
> 3. Check in $KF5/KcoreAddons and there should only be these headers:
> KAboutData kaboutdata.h kcoreaddons_export.h
>
> Problem:
> If the same variable name is used for both var1 and var2 they overwrite each other at the PARENT level and the result is that only one invocation of ecm_generate_headers sticks.
>
> Solution:
> I assume that the CMakeList writer is intentionally using the same variable name for var1 and var2 and wants to accumulate both the camelCase and the lowercase.h names on the same variable. If the variable names are the same if accumulates both the camelCase list and the lowercase.h list on the single variable.
>
> If my assumption is incorrect and var1 and var2 must be different to separate the camelCase and lowercase.h lists, then a new patch should be submitted to generate either a warning or an error message when var1 and var2 are the same name.
>
> This review is linked with https://git.reviewboard.kde.org/r/119275/. If this review is accepted then https://git.reviewboard.kde.org/r/119275/ is unecessary.
>
>
> Diffs
> -----
>
> modules/ECMGenerateHeaders.cmake bac5086
>
> Diff: https://git.reviewboard.kde.org/r/119300/diff/
>
>
> Testing
> -------
>
> make test
> Compiled kcoreaddons, checked that all the headers were exported. Then compiled kauth and checked that it found the exported headers.
>
>
> Thanks,
>
> Andreas Xavier
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140715/bd719b4a/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list