[cmake-developers] CPack: GetPrerequisites: cross-compiling from Linux to Windows
Dominik Schmidt
domme at tomahawk-player.org
Tue Mar 6 08:14:18 EST 2012
Hey Eric,
thanks for the quick reply!
On Tue, Mar 6, 2012 at 1:16 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
> > While doing this I noticed neither WIN32 nor CMAKE_CROSSCOMPILING are
> > defined at CPack time, why?
>
>
> May be because no one did really tackle the cross-packaging problem?
> Cross-compiling is one thing, cross packaging is another one
> (which may be difficult or impossible in the general case).
>
Ah okay :-)
> > This is the reason my code in the patch is not in the WIN32 block above
> and
> > I couldn't guess the gp_tool correctly.
>
> In order to be sure that nothing else is breaking you can try to
> [manually] add the missing definition in the CPackConfig.cmake file.
> This file is loaded by CPack at CPack-time so that any definitions in there
> will be seen during CPack run.
>
Went fine.
An alternative would be to do it in a CPack Project Config file:
>
> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29
>
Might make sense, indeed. That way you could explicitly say if you want to
cross-package or not.
By the way how does GetPrerequisite get called ? Is it does through
> BundleUtilities?
> I'm not using those so, are they called at [CPack-]install time ?
>
Yes. I'm using DeployQt4, which uses BundleUtilities, which use
GetPrerequisites.
> > A hardcoded list of .dll names is for sure not really elegant, but I
> don't
> > know of any way to check if a required .dll is a windows system library.
> On
> > Linux of course there are no Windows system dlls in a certain folder and
> the
> > absence of such a dll doesn't mean anything either because an import lib
> > (.dll.a usually) is enough to link against.
> >
> > The patch is probably not ready to be upstreamed but I'm happy to fix
> issues
> > or follow a nicer approach if you point me to it.
>
> Before going on may be you could explain us what kind of
> cross-packaging your are targeting:
> NSIS, Archive generator, etc...
>
NSIS is the one I'm aiming for :-)
> Setting WIN32 and/or CMAKE_CROSSCOMPILING may be done in CPack list
> interpreter
> but it remains to be seen whether it would be enough in order to
> achieve what you want.
>
I think so, it already works when gp_tool is manually set to objdump!
--
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>
Best regards,
Dominik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120306/81e15617/attachment.html>
More information about the cmake-developers
mailing list