[CMake] cmake integration
Pavel Volkovitskiy
int at mtx.ru
Tue Feb 6 11:39:49 EST 2007
Hello!
I'm trying to implement initial cmake support for conary
(distributed software management system, http://wiki.rpath.com/wiki/Conary)
PS: Note, i'm not official developer of it
right now it has good support for configure based applications
let's for example we have "foo" application which uses configure script
so we will write in foo.recipe:
r.Configure('--extra-arg')
and this will translate into real ./configure call:
===================================
cd /home/int/conary/builds/foo/foo-1.2.3/; \
CLASSPATH="" CFLAGS="-O2 -g" CXXFLAGS="-O2 -g " CPPFLAGS="" LDFLAGS="-g"
CC=gcc CXX=g++ \
./configure \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib64 \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--extra-arg
===================================
after some reading i "translate" this into cmake call:
===================================
cd /home/int/conary/builds/foo/foo-1.2.3/; \
mkdir -p CMakeObj; cd CMakeObj; \
CC=gcc CXX=g++ cmake \
-DCMAKE_C_FLAGS:STRING="-O2 -g" \
-DCMAKE_CXX_FLAGS:STRING="-O2 -g " \
-DCMAKE_EXE_LINKER_FLAGS:STRING="-g" \
-DCMAKE_MODULE_LINKER_FLAGS:STRING="-g" \
-DCMAKE_SHARED_LINKER_FLAGS:STRING="-g" \
-DCMAKE_INSTALL_PREFIX:PATH="/usr" \
-DEXTRA_ARG=YES \
/home/int/conary/builds/foo/foo-1.2.3/
===================================
I assume that all cmake based projects work well with out-of-source
build (srcdir!=objdir)
Also it seems there is no standart way to specify libdir = /usr/lib or
/usr/lib64 ?
Am I right there is no equivalent for LDFLAGS?
We prefer this to be close to configure call for convenience
Any comments?
--
Pavel
More information about the CMake
mailing list