~carbslinux/repository

ref: 3f17c8c2a94792638ef1849c97862bd1380cbb0e repository/extra/cmake/build -rwxr-xr-x 916 bytes
3f17c8c2Cem Keylan META: Fix all usage of kiss, replace all with cpt 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh -e

# Use cmake to build cmake if installed.
# This leads to a much faster build.
if cpt-list cmake; then
    cmake -B build \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=/usr/lib \
        -DCMAKE_SHARED_LIBS=True \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_USE_SYSTEM_CURL=True \
        -DCMAKE_USE_SYSTEM_EXPAT=True \
        -DCMAKE_USE_SYSTEM_ZLIB=True \
        -DCMAKE_USE_SYSTEM_BZIP2=True \
        -DBUILD_TESTING=OFF

    cmake --build   build
    DESTDIR="$1" cmake --install build

else
    ./configure \
        --prefix=/usr \
        --system-curl \
        --system-expat \
        --system-zlib \
        --system-bzip2 \
        --parallel="$(nproc)"

    make
    make DESTDIR="$1" install
fi

# Grab the package version.
IFS=. read -r ver1 ver2 _ < "${0%/*}/version"

# Remove docs.
rm -rf "$1/usr/doc"
rm -rf "$1/usr/share/cmake-$ver1.$ver2/Help"