repo/extra/cmake/build

39 lines
914 B
Plaintext
Raw Normal View History

2019-06-27 06:45:20 -06:00
#!/bin/sh -e
2019-11-16 18:19:20 -07:00
# 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 \
2019-11-16 18:38:48 -07:00
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_USE_SYSTEM_CURL=True \
-DCMAKE_USE_SYSTEM_EXPAT=True \
-DCMAKE_USE_SYSTEM_ZLIB=True \
2019-11-26 14:51:21 -07:00
-DCMAKE_USE_SYSTEM_BZIP2=True \
-DBUILD_TESTING=OFF
2019-06-27 06:45:20 -06:00
2019-11-16 18:19:20 -07:00
cmake --build build
DESTDIR="$1" cmake --install build
else
./configure \
2019-11-16 18:38:48 -07:00
--prefix=/usr \
--system-curl \
--system-expat \
--system-zlib \
--system-bzip2 \
--parallel="$(nproc)"
2019-11-16 18:19:20 -07:00
make
make DESTDIR="$1" install
fi
2019-08-18 18:33:32 -06:00
# Grab the package version.
2019-08-20 18:28:20 -06:00
IFS=. read -r ver1 ver2 _ < "${0%/*}/version"
2019-08-18 18:33:32 -06:00
# Remove docs.
rm -rf "$1/usr/doc"
rm -rf "$1/usr/share/cmake-$ver1.$ver2/Help"