[CMake] HowTo 'Getting Started Cross compilation with cmake' needed

Claus Klein claus.klein at arcormail.de
Tue Jan 9 10:37:27 EST 2007


Hi,

I have tested cmake to build packages on a i386/linux host for PPC targed.
I found only one hint in http://www.cmake.org/Wiki/CMake_Useful_Variables about cross-compile.

In my opinion, we need something like:
 "Getting Started Cross compilation with Autoconf/Libtool"
http://www.stlinux.com/docs/getting_started-1.0/autoconf_cross_compile.php3
see too:
http://www.stlinux.com/docs/getting_started-1.0/gtk2_cross_compile.php3


I miss some features needed for cross-compiling, linking and installing to a stage dir.
The PKGCONFIG(package includedir libdir linkflags cflags), 
for example, the --define-variable option can't be used.
pkg-config(1) support that:

P3linux:/etc/apt # PKG_CONFIG_PATH=/tools/build_i386/root/lib/pkgconfig pkg-config  --print-errors --define-variable=prefix=/tools/build_i386/root/ --cflags --libs dbus-1
-I/tools/build_i386/root//include/dbus-1.0 -I/tools/build_i386/root//lib/dbus-1.0/include  -L/tools/build_i386/root//lib -ldbus-1

P3linux:/etc/apt # pkg-config  --print-errors  --cflags --libs dbus-1
-I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include  -L/usr/local/lib -ldbus-1


It is important that installation to a stage dir works:
buildir # make DESTDIR=/tmp/wzdftpd install

and I want to be able to uninstall it again:
buildir # make DESTDIR=/tmp/wzdftpd uninstall

(see attachment; ck)


As long packages ignore that, we have problems like that:
#org: INSTALL(CODE "FILE(MAKE_DIRECTORY \"${localstatedir}/log/wzdftpd\")")
#FIXME: FILE problem creating directory: /usr/local/var/log/wzdftpd
#after: make DESTDIR=/tmp/wzdftpd install
INSTALL(CODE "FILE(MAKE_DIRECTORY \"$ENV{DESTDIR}${localstatedir}/log/wzdftpd\")")

Too, it should always possible to uninstall an installed package again.

As a last point, it wout be nice if cmake generates  makefiles according  to:
http://www.gnu.org/prep/standards/standards.html#Makefile-Conventions

I think, most people expect this as common standard, or not?

For me, cmake is a good tool, but if more project change to it without care,
the embeded world will become more problems!

Claus Klein




  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake_uninstall.cmake.in.patch
Type: text/x-diff
Size: 1220 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070109/70919403/cmake_uninstall.cmake.in.bin


More information about the CMake mailing list