[cmake-developers] How to cleanly get rid of CMake specific properties?

Eric Noulard eric.noulard at gmail.com
Sat Feb 18 14:11:19 EST 2012


2012/2/18 Alexander Neundorf <neundorf at kde.org>:
> On Saturday 18 February 2012, Eric Noulard wrote:
>> Hi all,
>>
>> I'm pursuing my quest for a better CPack doc.
>> First set of modifications are in master:
>>  cpack --help-command-xxx
>>  cpack --help-variable-xxx
>> works.
>>
>> However variables are somehow "problematic" because I get all the
>> properties defined for CMake in the doc because variables are a
>> special kind of properties.
>>
>> CPack (or CTest) is using a instance of cmake object which does:
>>
>> this->InitializeProperties();
>>
>> in its constructor....
>> so that I end up with a lot more properties in "full doc"
>> i.e. in
>> cpack --help-full
>>
>> Than I thought I shall.
>> Now there is two options:
>>
>> 1) Avoid InitializeProperties(); in cmake object constructor and do
>> that elsewhere
>>     for CMake and nowhere for CTest and CPack.
>>
>> 2) Let CTest and CPack keep the CMake inherited properties and filter out
>>     the unwaned CMake specific section in the doc.
>>
>> 1) is definitely easier but raise a question:
>>     Do CTest and CPack NEED the cmake property definition?
>>     Is this a wanted behavior or just an oversight?
>>     i.e. is set_property(...) supposed to work in a ctest or cpack
>> loaded script?
>>
>> 2) is doable but require more work.
>>
>> in the same way should the "standard" variable doc section be inherited
>> from CMake to CTest/CPack?
>>
>> try (I know it's not supposed to work but nevertheless):
>> ctest --help-variable-list
>>
>> and you'll see what I mean.
>
> 2) sounds like a hack. If the properties are there, there should be a reason
> for it, and then they should also appear in the documentation.

Agreed but it strange to have documentation for
ALLOW_DUPLICATE_CUSTOM_TARGETS
RULE_LAUNCH_COMPILE
COMPILE_DEFINITIONS
etc...

for either CPack or CTest.
nevertheless they ARE currently defined in the CMake script
interpreter used by CTest or CPack
because as I said they are defined in the cmake object constructor.
They do not appear in the CTest doc because --help-variable is not implemented
they do now in cpack because of that.

Concerning CPack I'm pretty sure no part of CPack code uses
CMake inherited properties, cpack's cmake interpreter is not supposed
to load

For CTest I doubt it but the fact is I don't really know.

A small test of CMake in scripting mode
(see script attached
 try it with
 cmake -P scriptable.cmake)
tells me  some properties may be useful but may be not all of them...

Your opinion?
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scriptable.cmake
Type: text/x-cmake
Size: 716 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120218/397a3e59/attachment-0002.bin>


More information about the cmake-developers mailing list