mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] package proposal: cmake


From: Martin Müllenhaupt
Subject: Re: [Mingw-cross-env-list] package proposal: cmake
Date: Tue, 06 Dec 2011 19:21:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0

Hi list, hi Matthias,

On 04.12.2011 13:56, Matthias Gehre wrote:
> I never had problems
> with using
>
> cmake -G'Unix Makefiles'
> -DCMAKE_TOOLCHAIN_FILE=../mingw-cross-env/usr/i686-pc-mingw32/share/cmake/mingw-cross-env-conf.cmake
> ../src
> make
>
> I wonder what kind of problem your approach solves?
> I can see that for some packages custom Find*.cmake
> are needed to make static linking work, but why install a custom cmake
> command?
I supplied a custom cmake command just for convenience, like the
i686-pc-mingw32-pkg-config script. It eases the use of mingw-cross-env
from outside cmake based projects.
The $(CMAKE) command is for building cmake based packages inside
mingw-cross-env makefiles. It makes things easier to write, to change
and is less error prone, just like the existing $(CMAKE_TOOLCHAIN_FILE).

Currently the only goal of my cmake package approach is making static
linking work. Cmake based projects ideally should compile without
manually adding all the extra library dependencies which are not tracked
by cmake in the Find*.cmake modules.
I don't want to patch a project just to let it compile with
mingw-cross-env, when it perfectly did in a shared library environment.

There are quite a few Find*.cmake modules, which do not track the
linking dependencies. In fact the only module I found which tracks them
is FindPNG.cmake, which first looks up ZLIB (but I'm sure there are some
others).
FindQt4.cmake at least tries to resolve a few libraries (in
Qt4ConfigDependentSettings.cmake), but since there's no FindMNG module,
it's not tracking libmngs dependencies for example. Things get ugly when
you link against QtSql, because the dependencies are configurable (e.g.
support Postgres, MySQL, sqlite, ...).

Configurable dependencies are very hard to track for cmake, because they
are tracked very differently (pkg-config, libtool, cmake, qmake, ...).

My approach is that mingw-cross-env helps out here, because it defines
the dependencies. And many of mingw-cross-env's packages use pkg-config,
so I suggest that cmake just uses pkg-config for these packages (where
applicable).

Martin Müllenhaupt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]