From 3a36ae23fb98651aecdda8576b0fb2bc6a7bd08e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 17 Nov 2019 01:19:20 +0000 Subject: [PATCH] cmake: build with cmake if available --- extra/cmake/build | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/extra/cmake/build b/extra/cmake/build index ec73252c..958f69a0 100755 --- a/extra/cmake/build +++ b/extra/cmake/build @@ -1,10 +1,24 @@ #!/bin/sh -e -./configure \ - --prefix=/usr +# Use cmake to build cmake if installed. +# This leads to a much faster build. +if kiss l cmake; then + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DCMAKE_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=Release -make -make DESTDIR="$1" install + cmake --build build + DESTDIR="$1" cmake --install build + +else + ./configure \ + --prefix=/usr + + make + make DESTDIR="$1" install +fi # Grab the package version. IFS=. read -r ver1 ver2 _ < "${0%/*}/version"