forked from modelica-3rdparty/ExternalMedia
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BuildLib-CMake.sh
executable file
·58 lines (52 loc) · 1.81 KB
/
BuildLib-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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#REM ******************* README *********************************
#REM You might have to adjust some settings manually. This file
#REM requires that you know the name of your CMake generator, if
#REM you have more than one development environment installed.
#REM ******************* README *********************************
#if [ "$(uname)" == "Darwin" ]; then
# echo "Mac OS X is untested..."
# CMake_generator="Unix Makefiles"
# exit 1
#elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# CMake_generator="Unix Makefiles"
#elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# CMake_generator="MinGW Makefiles"
#fi
NCPU=`nproc --all`
CMAKE_SYSTEM_NAME='linux64'
EXTERNALS="../externals"
if [ ! -d "$EXTERNALS" ]; then mkdir -p "$EXTERNALS"; fi
EXTERNALS=`readlink -f "$EXTERNALS"`
CP_SRC="${EXTERNALS}/CoolProp.git"
BUILD_DIR="build"
if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
BUILD_DIR=`readlink -f "$BUILD_DIR"`
echo " "
echo "********* Detecting supported property libraries ***********"
FLUIDP=0
COOLP=1
echo "FluidProp support set to: $FLUIDP"
echo "CoolProp support set to: $COOLP"
if [ "$COOLP" == "1" ]; then
echo "******************** CoolProp ******************************"
echo "Sources are located in $CP_SRC"
if [ -d "$CP_SRC" ]; then
pushd "$CP_SRC"
git pull origin master
git checkout v6.1.0
git submodule init
git submodule update
# git submodule foreach git pull origin master
popd
else
git clone -b v6.1.0 --single-branch --recursive https://github.com/CoolProp/CoolProp.git "$CP_SRC"
# git clone --recursive https://github.com/CoolProp/CoolProp.git "$CP_SRC"
fi
fi
pushd "$BUILD_DIR"
# cmake .. -G "%CMake_generator%"
cmake ..
cmake --build . --config Release --target install -- -j$NCPU
popd
exit 0