Browse Source

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
user/chris/test/lib64
Christian Wiese 14 years ago
parent
commit
dbafffc9c9
2 changed files with 14 additions and 1 deletions
  1. +2
    -0
      doc/PKG-BUILD-VARS
  2. +12
    -1
      lib/functions.in

+ 2
- 0
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')

+ 12
- 1
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=

Loading…
Cancel
Save