Coding style questions
Alexander Neundorf
neundorf at kde.org
Sat Sep 17 11:54:49 UTC 2011
On Saturday, September 17, 2011 11:32:04 AM Yury G. Kudryashov wrote:
> Hi!
>
> A few questions on coding style. I just wonder how strict are our policies.
>
> 1. Is there any policy whether to export MyPackage_INCLUDE_DIRS or
> MYPACKAGE_INCLUDE_DIRS in:
> * FindMyPackage.cmake;
> * FindMYPACKAGE.cmake.
>
> It seems that cmake/Modules/readme.txt suggests using
> MyPackage_INCLUDE_DIRS for FindMyPackage and MYPACKAGE_INCLUDE_DIRS for
> FindMYPACKAGE, but many Find-modules in cmake do not follow this
> convention.
One year ago or so there was a lengthy discussion about this on the cmake-
developers list, including numbers of how many modules do what.
There are three groups:
ExactCase
UPPERCASE
UNDECIDED
The UNDECIDED group where those files where the filename is already
FindBOTH.cmake, i.e. where the package name is already uppercase, so it could
count as both.
If the BOTH files were counted as ExactCase, it was about 50/50 in CMake
itself.
If BOTH files were counted as UPPERCASE, it was more like 80/20 for UPPERCASE
in CMake itself.
For the files in KDE it was more like 90/10 for UPPERCASE.
For that reason, I'm for staying with UPPERCASE, since this is what the big
majority of existing files is using.
> 2. Is there any policy whether to call
> find_package_handle_standard_args(MyPackage DEFAULT_MSG MyPackage_LIBRARIES
> MyPackage_INCLUDE_DIRS)
> or
> find_package_handle_standard_args(MyPackage DEFAULT_MSG
> MyPackage_INCLUDE_DIRS MyPackage_LIBRARIES)
No, no policies.
Probably using the libs provides more information (except if it's imported
targets).
Alex
More information about the Kde-buildsystem
mailing list