On Sat, Aug 7, 2010 at 11:55 AM, Chris Wolf <span dir="ltr"><<a href="mailto:cw10025@gmail.com">cw10025@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
<br>
On 8/7/10 11:22 AM, David Cole wrote:<br>
> On Sat, Aug 7, 2010 at 11:02 AM, Chris Wolf <<a href="mailto:cw10025@gmail.com">cw10025@gmail.com</a>> wrote:<br>
><br>
>><br>
>><br>
>> On 8/7/10 9:44 AM, David Cole wrote:<br>
>>> On Sat, Aug 7, 2010 at 9:26 AM, Chris Wolf <<a href="mailto:cw10025@gmail.com">cw10025@gmail.com</a>> wrote:<br>
>>><br>
>>>><br>
>>>><br>
>>>> On 8/7/10 7:14 AM, Eric Noulard wrote:<br>
>>>>> 2010/8/7 Chris Wolf <<a href="mailto:cw10025@gmail.com">cw10025@gmail.com</a>>:<br>
>>>>>> On 8/6/10 8:55 PM, Eric Noulard wrote:<br>
>>>>>>><br>
>>>>>>> Did you try the command line?<br>
>>>>>>><br>
>>>>>>> cpack -D CPACK_PACKAGING_INSTALL_PREFIX="/opt" -G DEB<br>
>>>>>>><br>
>>>>>>> it works for me.<br>
>>>>>>><br>
>>>>>>> if it works for you may be<br>
>>>>>>> CPACK_PACKAGING_INSTALL_PREFIX is set to late<br>
>>>>>>> in the CMakeLists.txt?<br>
>>>>>>><br>
>>>>>><br>
>>>>>> Yes, I tried that about 8 hours ago:<br>
>>>> <a href="http://www.cmake.org/pipermail/cmake/2010-August/038785.html" target="_blank">http://www.cmake.org/pipermail/cmake/2010-August/038785.html</a><br>
>>>>>><br>
>>>>>> I have to say NOW it's working. Sorry - I suppose I was changing too<br>
>>>> many things at one back then<br>
>>>>>> and I was missing something.<br>
>>>>>><br>
>>>>>> Ok, this issue is resolved, thank you.<br>
>>>>><br>
>>>>> Good to know.<br>
>>>>><br>
>>>>> [...]<br>
>>>>>><br>
>>>>>> Sorry to beat a "deadhorse", since I see this has already been<br>
>>>> discussed:<br>
>>>>>><br>
>>>>>> <a href="http://www.mail-archive.com/cmake@cmake.org/msg16180.html" target="_blank">http://www.mail-archive.com/cmake@cmake.org/msg16180.html</a><br>
>>>>>><br>
>>>>>> I think that guy had a good proposal - being able to control path<br>
>>>> prefixes<br>
>>>>>> at a per/generator level. I guess for now, I can just run cpack<br>
>>>> multiple<br>
>>>>>> times with path/generator options on the command line.<br>
>>>>><br>
>>>>> I think you are right, command line is the current best way to go.<br>
>>>>> Now having a Generator Specific<br>
>>>>> CPACK_<GEN>_PACKAGING_INSTALL_PREFIX<br>
>>>>> wouldn't be that difficult to implement.<br>
>>>>><br>
>>>>> Now when enough [wo]man power will be given in<br>
>>>>> <a href="http://public.kitware.com/Bug/view.php?id=7000" target="_blank">http://public.kitware.com/Bug/view.php?id=7000</a><br>
>>>>> this can be discussed.<br>
>>>>><br>
>>>>> Re-read the bug comments and may be add your ideas there.<br>
>>>>><br>
>>>>> And I do not think the horse is dead, we are merely waiting<br>
>>>>> for a jockey for ridding bug #7000 :-)<br>
>>>>><br>
>>>>><br>
>>>><br>
>>>> Ok, I added a note to this bug with an example proposed code change. If<br>
>> it<br>
>>>> looks good, I can try it myself and if it works I can submit patches.<br>
>>>><br>
>>>> Let me know, thanks,<br>
>>>><br>
>>>><br>
>>> You can already do what you propose with that change today: in a<br>
>>> CPACK_PROJECT_CONFIG_FILE<br>
>>> file. (Without making any C++ changes and without waiting for resolution<br>
>> of<br>
>>> issue #7000...).<br>
>>><br>
>>> Inside that file, you can inspect the value of CPACK_GENERATOR and<br>
>>> set/override other CPACK_* variables. In this case, you would have as<br>
>> many<br>
>>> if() blocks as needed to set CPACK_PACKAGING_INSTALL_PREFIX to whatever<br>
>>> value you want for each generator.<br>
>>><br>
>>> The CPACK_PROJECT_CONFIG_FILE file is included *at cpack time* and is<br>
>>> intended to give you the hook you need to do generator specific stuff.<br>
>>><br>
>>> Perhaps the proposed change is still a good one and would make this task<br>
>>> easier. Although it seems silly to me to invent a bunch of new variables<br>
>>> when there's already a technique that could be used to achieve the task<br>
>>> today. We already, as you have observed, have enough "prefix" variables<br>
>>> floating around. I'm not sure adding more is the way to go.<br>
>>><br>
>><br>
>> To try to understand your approach, I created a file,<br>
>> "MyCpackConfig.cmake",<br>
>> which looks like:<br>
>><br>
>> # keep cmake-generated settings<br>
>> include(CPackConfig.cmake)<br>
>><br>
>> if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")<br>
>> set(CPACK_PACKAGING_INSTALL_PREFIX "/tmp/local")<br>
>> endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")<br>
>><br>
>><br>
>> ...then I invoke like:<br>
>><br>
>> cpack --config MyCpackConfig.cmake<br>
>><br>
>> ...and yet, the results show that CPACK_PACKAGING_INSTALL_PREFIX was not<br>
>> overriden for PackageMaker. I am at a loss here...<br>
>><br>
>><br>
>><br>
> You do not need to include(CPackConfig.cmake) -- and, in fact, you<br>
> shouldn't.<br>
><br>
> Since you did include it, it has CPACK_GENERATOR defined to a list from<br>
> CPackConfig.cmake, rather than cpack's internal definition. (So it's never<br>
> equalling PackageMaker...) So you're not seeing your override take effect...<br>
><br>
> The CPACK_PROJECT_CONFIG_FILE is included automatically on a per-generator<br>
> basis. It only need contain overrides.<br>
><br>
> Here's how it goes:<br>
> - cpack runs<br>
> - it includes CPackConfig.cmake<br>
> - iterates over the generators listed in that file's CPACK_GENERATOR (unless<br>
> told to use just a specific one via -G on the command line...)<br>
> --- foreach generator, it then<br>
> - sets CPACK_GENERATOR to the one currently being iterated<br>
> - includes the CPACK_PROJECT_CONFIG_FILE<br>
> - produces the package for that generator<br>
><br>
> This is the key: For each generator listed in CPACK_GENERATOR in<br>
> CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR internally to *the one<br>
> currently being used* and then include the CPACK_PROJECT_CONFIG_FILE.<br>
><br>
> As I said before, it's somewhat confusing, but once you get it, it does make<br>
> sense.<br>
><br>
> So, to recap:<br>
> -- do not include CPackConfig in your CPACK_PROJECT_CONFIG_FILE<br>
> -- just run "cpack" on the command line<br>
><br>
> I hope this gets you over the finish line, now. ;-)<br>
><br>
><br>
> David<br>
><br>
<br>
</div></div>Ok, now *that* explanation did the job - thanks!<br>
<br>
I was under the impression that CPACK_PROJECT_CONFIG_FILE was going to<br>
*replace* the cmake-generated CPackConfig.cmake and that it would only<br>
be referenced once for all the cpack generators.<br>
<br>
Unless I missed it, I would recommend putting this latest explanation<br>
from you in a Wiki page.<br>
<br>
Thanks again,<br>
<font color="#888888"><br>
-Chris<br>
</font></blockquote></div><div><br></div><br><div>Excellent! I am now officially done for the weekend. :-)</div><div><br></div><div>Would you recommend a certain location on the Wiki? i.e. -- were you looking someplace for this, and found a place where you think such an explanation should go...? I'll be happy to add this to the Wiki, but frequently, I'm not sure where to link stuff from. If I knew around where you were looking, maybe that would be the right place to link from to get to the new Wiki page.</div>
<div><br></div><div>If you give me a hint about where, I'll add this to the Wiki next week sometime.</div><div><br></div><div>Thanks,</div><div>David</div><div><br></div>