forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpprestsdk.sh
51 lines (47 loc) · 1.65 KB
/
cpprestsdk.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
41
42
43
44
45
46
47
48
49
50
51
package: cpprestsdk
version: "%(commit_hash)s"
tag: master
source: https://github.com/Microsoft/cpprestsdk
requires:
- boost
- OpenSSL:(?!osx)
build_requires:
- CMake
---
#!/bin/sh
case $ARCHITECTURE in
osx*)
[[ ! $BOOST_ROOT ]] && BOOST_ROOT=$(brew --prefix boost)
[[ ! $OPENSSL_ROOT ]] && OPENSSL_ROOT=$(brew --prefix openssl)
;;
esac
cmake "$SOURCEDIR/Release" \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
-DBUILD_TESTS=OFF \
-DBUILD_SAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS=-Wno-error=conversion \
-DCPPREST_EXCLUDE_WEBSOCKETS=ON \
${BOOST_REVISION:+-DBOOST_ROOT=$BOOST_ROOT} \
${OPENSSL_ROOT:+-DOPENSSL_ROOT_DIR=$OPENSSL_ROOT}
make ${JOBS:+-j $JOBS}
make install
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat > "$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0 \\
${BOOST_REVISION:+boost/$BOOST_VERSION-$BOOST_REVISION} \\
${OPENSSL_REVISION:+OpenSSL/$OPENSSL_VERSION-$OPENSSL_REVISION}
# Our environment
set CPPRESTSDK_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path LD_LIBRARY_PATH \$CPPRESTSDK_ROOT/lib64
EoF