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

Eric Noulard eric.noulard at gmail.com
Mon Mar 12 14:28:57 EDT 2012


Forgot to cc the list.


---------- Forwarded message ----------
From: Eric Noulard <eric.noulard at gmail.com>
Date: 2012/3/10
Subject: Re: [cmake-developers] Preferred variable retrieval within
Cpack generator.
To: "Schwartz, Philip Marc (RIS-BCT)" <Philip.Schwartz at lexisnexis.com>


2012/3/10 Schwartz, Philip Marc (RIS-BCT) <Philip.Schwartz at lexisnexis.com>:
> What is the preferred method of variable retrieval and/pr parameter passing in the cpack generator structure. I have seen a mixture of passing values into functions and also using GetOption to obtain the wanted value.

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.

>
> I am currently looking at adding new functionality to allow for better control of package naming when working with generation of packages. This will include using a variable template for creation of the naming schema to be used. Currently I am allowing the package specific generator to build a map of the parameters for naming and pass the map into the function GetComponentPackageFileName. This will allow for the specific generator to control the values, but I am not sure if it is more efficient to use GetOption directly in the function.

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.

>
> What are the thoughts of the other developers working on CMake and CPack?

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"

may you can provide us with a first patch?
Attached to http://public.kitware.com/Bug/view.php?id=12997.

Then we (at least I) may see more clearly what you mean?


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


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



More information about the cmake-developers mailing list