| -rw-r--r-- | doc/PKG-BUILD-VARS | 2 | ||||
| -rw-r--r-- | lib/functions.in | 13 |
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= |
