[CMake] CPack/NSIS: start menu entry without cpack_package_executables

Eric Noulard eric.noulard at gmail.com
Tue Jul 19 02:47:35 EDT 2011


2011/7/18 Daniel Franke <franke.daniel at gmail.com>:
>>
>> Could you explain why you need CPack to be included here?
>>
>> If the requirement comes from the needed definition of
>> "cpack_add_component" then you can try to do the following:
>
> Exactly for this reason.
>
>
>> 1) include(CPackComponent) early enough
>>    in order to get the "cpack_add_component" macro definition you need.
>
> This is new in 2.8.5? The latest package I could check is 2.8.3 and there
> seems to be no such file!?

Yes this is new in 2.8.5.

> Trouble being that people expect things to work on their local platforms
> without need to update to the latest and greatest releases first (think CentOS
> 5 users).


The essential problem with new feature is that
 they are new...beside the new bugs they introduce.

More seriously, I know that kind of trouble too.

> Maybe I need to come up with a different solution. An installer
> without components, for example :P

This is called "ultra-solution" :-]

Another not-so-nice solution would be to "backport"
 CPackComponent.cmake from 2.8.5 to your source.

Rename it "MyCPackComponent.cmake" and rename
the macros therein (in order to avoid redefinition when CPack.cmake is
included)
and use those.

if you check CMake version currently used you'll be able
to use your back-ported macro with pre-2.8.5  cmake and
cmake macros after that.

You can do without version check doing something like:

include(CPackComponent OPTIONAL)

then in your cmake wrapper macros you can check
whether if you should use cpack_add_xxx or
define and use mycpack_add_xxx

if (COMMAND cpack_add_component)
   message(STATUS "Great modularized CPack is present...")
   ....
else
   message(STATUS "Using backported cpack_add_xxx macros...")
   include(MyCPackComponent)
   ....
endif()


> Thanks for the pointers nonetheless. Food for thought ...
>
> Cheers
>
>        Daniel
>



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list