[cmake-developers] Preferred variable retrieval within Cpack generator.

Eric Noulard eric.noulard at gmail.com
Mon Mar 12 14:31:22 EDT 2012


2012/3/12 Schwartz, Philip Marc (RIS-BCT) <Philip.Schwartz at lexisnexis.com>:
>
>>Usually using GetOption means that we want to give user some control so that this CPACK_xxx value may be set in >CMakeLists.txt, CPack project config file or CPack command line arg.
>
>>GetOption is not used to pass value from cmCPackGenerator class to its daughter classes.
>
> It is looking like this will be the preferred option as I want to be able to define this for all classes that inherit from cmCPackGenerator allowing the variables to be set for all generators that might use them.

The important question is would this option be settable by user in the
CMake script?
If yes then you soud use GetOption.

>>If the feature "may" be shared by all generators then it ought to be defined in the cmCPackGenerator base class.
>>(let's call it generic CPack generator)
>>If some data are processed by the generic CPack generator and then used by some daughter classes then you can add a protected field member.
>
>>This is the case for cmCPackGenerator::Components, or even cmCPackGenerator::files.
>
> I don't think I am creating anything that will require this. The focus is around changing how the name is handled, not adding further variables in the generator to the mix.

Ok.

>>I'm not sure I did catch all the implication of "I am allowing the package specific generator to build a map of >the parameters for naming and pass the map into the function GetComponentPackageFileName"
>
> Be for deciding on using GetOption to allow the variables to be set by a cmake file directly in the cmCPackGenerator class, I was doing this work in the subclass for the type specific generator and creating a std::map<std::string, std::string> that contained a value map. This was a bad way of doing it and reason for the first email and after reading the email has been changed.
>
> I go on vacation on Friday and I am out for a week. I am hoping to have the first version of the patch out in the bug before then.

OK then.
I'll go answer on the tracker as well.

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org



More information about the cmake-developers mailing list