-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·55 lines (46 loc) · 1.66 KB
/
run.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
#!/bin/bash
CMAKE_BINARY=cmake
GENERATOR="Unix Makefiles"
mkdir -p build
cd build
mkdir -p Release
cd Release
if [ -d "C:\Program Files (x86)\Microsoft Visual Studio\2017" ]; then
GENERATOR='Visual Studio 15 2017 Win64'
VS_CMAKE_BINARY="C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe"
GENERATOR="Visual Studio 15 2017 Win64"
echo Tryng VS 2017 build.
if [ -f "${VS_CMAKE_BINARY}" ]; then
echo Using VS 2017 CMaake
CMAKE_BINARY=$VS_CMAKE_BINARY
fi
set -x
"${CMAKE_BINARY}" -G "${GENERATOR}" -DCMAKE_GENERATOR_INSTANCE="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" -DCMAKE_BUILD_TYPE="Release" ../..
set +x
elif [ -d "C:\Program Files (x86)\Microsoft Visual Studio\2019" ]; then
VS_CMAKE_BINARY="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe"
GENERATOR="Visual Studio 16 2019"
echo Tryng VS 2019 build.
if [ ! -f "${CMAKE_BINARY}" ]; then
echo Using VS 2019 CMaake
CMAKE_BINARY=$VS_CMAKE_BINARY
fi
set -x
"${CMAKE_BINARY}" -G "${GENERATOR}" -DTINC_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE="Release" ../..
set +x
else
set -x
"${CMAKE_BINARY}" -G "${GENERATOR}" -DTINC_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE="Release" ../..
set +x
fi
set -x
"${CMAKE_BINARY}" --build . --config Release --target casm_viewer -j7
set +x
if [ $? == 0 ]; then
if [[ -z "$LD_LIBRARY_PATH" ]]; then
export LD_LIBRARY_PATH=`pwd`"/../../external/tinc/external/usr/lib"
echo "Setting LD_LIBRARY_PATH to $LD_LIBRARY_PATH"
fi
cd ../../bin
./casm_viewer
fi