Review Request 119275: Fix: Same variable in camelCase and REQUIRED_HEADERS doesn't export all headers
Andreas Xavier
andxav at zoho.com
Mon Jul 14 18:00:22 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119275/
-----------------------------------------------------------
Review request for KDE Frameworks, Alex Merry and Michael Pyne.
Repository: kcoreaddons
Description
-------
Using the same variable name for var1 and 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.
Steps to Replicate the Problem:
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
Solution:
This patch solves the problem by changing the name of var2 to KCoreAddons_HEADERS_lowercase and exporting both KCoreAddons_HEADERS and KCoreAddons_HEADERS_lowercase.
Extended Solution:
If this patch is approved, then I will
1. Submit patches to the other frameworks using ecm_generate_headers() in this fashion.
2. submit a patch to extra-cmake-modules to warn when var1 and var2 have the same name.
Diffs
-----
src/lib/CMakeLists.txt 26eb5a1
Diff: https://git.reviewboard.kde.org/r/119275/diff/
Testing
-------
Compiled kcoreaddons, then checked that all headers generated and exported.
Ran unittests.
Thanks,
Andreas Xavier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140714/97947dee/attachment.html>
More information about the Kde-frameworks-devel
mailing list