From f4b58d5e38fca7a3872341b436ba7964be13931b Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 4 May 2011 12:51:12 +0200 Subject: [PATCH] lib/functions.in: improved cmake handling to be able to not build within a dedicated build directory --- lib/functions.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/functions.in b/lib/functions.in index 374bff9..115faa5 100644 --- a/lib/functions.in +++ b/lib/functions.in @@ -1077,11 +1077,16 @@ build_this_package() { # 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 + local cmakesrcdir='..' + # check if we use a dedicated build directory + if [ $cmakebuilddir = 1 ]; then + mkdir -p build + cd build + else + cmakesrcdir='.' + fi eval echo "Running cmake $cmakeopt" - cmake $( eval echo $cmakeopt ) .. + cmake $( eval echo $cmakeopt $cmakesrcdir ) fi # automated package build @@ -1303,6 +1308,7 @@ init_vars_and_hooks() makeopt='CC="$CC" CPP="$CPP" CXX="$CXX"' cmakeopt='-DCMAKE_INSTALL_PREFIX="$root/$prefix"' cmakeopt="$cmakeopt"' -DCMAKE_LIBRARY_PATH="$libdir"' + cmakebuilddir=1 # some scons based builds are using 'prefix' others 'PREFIX' sconsopt='PREFIX=/$prefix prefix=/$prefix install'