-
Notifications
You must be signed in to change notification settings - Fork 161
/
cmake.sh
40 lines (35 loc) · 1.33 KB
/
cmake.sh
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
39
40
package: CMake
version: "%(tag_basename)s"
tag: "v3.28.1"
source: https://github.com/Kitware/CMake
requires:
- "OpenSSL:(?!osx)"
- "GCC-Toolchain:(?!osx)"
build_requires:
- make
- alibuild-recipe-tools
prefer_system: .*
prefer_system_check: |
verge() { [[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]]; }
type cmake && verge 3.28.1 `cmake --version | sed -e 's/.* //' | cut -d. -f1,2,3`
---
#!/bin/bash -e
cat > build-flags.cmake <<- EOF
# Disable Java capabilities; we don't need it and on OS X might miss the
# required /System/Library/Frameworks/JavaVM.framework/Headers/jni.h.
SET(JNI_H FALSE CACHE BOOL "" FORCE)
SET(Java_JAVA_EXECUTABLE FALSE CACHE BOOL "" FORCE)
SET(Java_JAVAC_EXECUTABLE FALSE CACHE BOOL "" FORCE)
# SL6 with GCC 4.6.1 and LTO requires -ltinfo with -lcurses for link to succeed,
# but cmake is not smart enough to find it. We do not really need ccmake anyway,
# so just disable it.
SET(BUILD_CursesDialog FALSE CACHE BOOL "" FORCE)
EOF
$SOURCEDIR/bootstrap --prefix=$INSTALLROOT \
--init=build-flags.cmake \
${JOBS:+--parallel=$JOBS}
make ${JOBS+-j $JOBS}
make install/strip
mkdir -p etc/modulefiles
alibuild-generate-module --bin --lib > etc/modulefiles/$PKGNAME
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles