summaryrefslogtreecommitdiff
authorChristian Wiese <chris@opensde.org>2010-08-03 09:35:40 (GMT)
committer Christian Wiese <chris@opensde.org>2010-08-03 17:24:26 (GMT)
commitdbafffc9c9cc055f97f470f56193b624f586e9d1 (patch)
tree7cf78178e61e4804b0c424884b6bacf3710d41bf
parentce65e70df3bb02b337d87bb0221d74113a780ea2 (diff)
added cmake detection for packages
Note: The current implementation can be summarized like this: - check if $runcmake is set to '1' and if there is no Makefile but a CMakeLists.txt file inside of the srcdir - create a dedicated 'build' directory and cd into it - run cmake using the provided $cmakeopt
Diffstat
-rw-r--r--doc/PKG-BUILD-VARS2
-rw-r--r--lib/functions.in13
2 files changed, 14 insertions, 1 deletions
diff --git a/doc/PKG-BUILD-VARS b/doc/PKG-BUILD-VARS
index 084c722..823a30f 100644
--- a/doc/PKG-BUILD-VARS
+++ b/doc/PKG-BUILD-VARS
@@ -85,10 +85,12 @@ pyscript ...... script to run 'setup.py', python by default.
pyconfopt ..... options for 'setup.py' - Python setup scripts
plconfopt ..... options for 'Makefile.pl' - Perl setup scripts
+runcmake ...... set to '0' if you want to skip running 'cmake' (default 1)
runxmkmf ...... set to '0' if you want to skip running 'xmkmf'
runmkpl ....... set to '0' if you want to skip running 'perl Makefile.PL'
runpysetup .... set to '0' if you want to skip running 'python setup.py'
+cmakeopt ...... options for 'cmake'
makeopt ....... options for 'make' (default = ' ')
makeinstopt ... options for 'make install' (default = 'install')
diff --git a/lib/functions.in b/lib/functions.in
index 03cd436..31d7e0c 100644
--- a/lib/functions.in
+++ b/lib/functions.in
@@ -929,6 +929,16 @@ build_this_package() {
fi
fi
+ # CMake based Makefile generation
+ #
+ if [ -f CMakeLists.txt -a $runcmake = 1 -a ! -f Makefile ]; then
+ # use a dedicated build directory
+ mkdir -p build
+ cd build
+ eval echo "Running cmake $cmakeopt"
+ cmake $( eval echo $cmakeopt ) ..
+ fi
+
# automated package build
# styles without make run first:
@@ -1128,6 +1138,7 @@ detect_confdir()
init_vars_and_hooks()
{
makeopt='CC="$CC" CPP="$CPP" CXX="$CXX"'
+ cmakeopt='-DCMAKE_INSTALL_PREFIX="$root/$prefix"'
if atstage toolchain; then
makeopt="$makeopt"' prefix="$root${prefix:+/$prefix}"'
@@ -1171,7 +1182,7 @@ init_vars_and_hooks()
taropt="--use-compress-program=bzip2 -xf"
mainfunction="build_this_package"
- runconf=1 ; runxmkmf=1 ; runmkpl=1 ; runpysetup=1 ; autopatch=1
+ runconf=1 ; runcmake=1 ; runxmkmf=1 ; runmkpl=1 ; runpysetup=1 ; autopatch=1
autoextract=1 ; chownsrcdir=1 ; nocvsinsrcdir=1 ; cleanconfopt=1
patchopt="-bfp1 -z .orig"
createprefix=1 ; createdocs= ; rmemptydir=