[cmake-developers] CPack: GetPrerequisites: cross-compiling from Linux to Windows

Eric Noulard eric.noulard at gmail.com
Tue Mar 6 10:05:34 EST 2012


2012/3/6 Dominik Schmidt <domme at tomahawk-player.org>:
> Hi
>
> On Tue, Mar 6, 2012 at 2:27 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
>>
>> It is even necessary for more than "just testing" because the
>> CPackConfig.cmake file may be
>> overwritten by CPack next time you change your CMakeLists.txt.
>>
>> CPackConfig.cmake is "generated" by the
>> include(CPack)
>> in your CMakeLists.txt.
>>
>> Ultimately it may be useful to "configure_file" your
>> CPackProjectConfig.cmake.[in]
>> and put some generated logic in it depending on any CMake variable.
>
>
> So the next step would be to configure e.g. CPACK_CROSSPACKAGING and
> CPACK_WIN32 in my project config file  and try to make GetPrerequisites work
> with them?

That's not what I was thinking about.
May be you could just add something like:

if (CPACK_CROSSPACKAGING)
   set(WIN32 @WIN32@)
   set(CMAKE_CROSSCOMPILING @CMAKE_CROSSCOMPILING@)
endif(CPACK_CROSSPACKAGING)

So that if CPACK_CROSSPACKAGING is set in your CMakeLists.txt
it will trigger the definition of WIN32 and CMAKE_CROSSCOMPILING in your
configured CPackProjectConfig file.

GetPrerequisites may simply works after that (as far as I understood
your previous e-mail).

>> If you manage to do that kind of cross-packaging it could be worth a
>> page on the Wiki.
>
>
> Sure, can add it when's its time to ;)
>
> Best regards,
> Dominik



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



More information about the cmake-developers mailing list