source: tol/building/Linux/build_contrib.sh

devel
Last change on this file was be65acb, checked in by Pedro Gea <pgea@…>, 11 years ago

Refs #1880
Se usan la primera letra en mayúscula para las opciones Release y Debug.
Se incorpora un scripta para gestionar la versión de TOL en Linux.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7214 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100755
File size: 1.6 KB
Line 
1#!/bin/bash
2#*********************************************************
3# La llamada al script recibe dos argumentos:
4#   ./build_contrib.sh [|<contrib_name>] [|Release|Debug]
5#*********************************************************
6# Durante el proceso se pregunta por cada una de las etapas.
7
8BUILD_DIR=$PWD/$(dirname $0)
9
10if [ "$1" = "" ]; then
11  echo -n "contrib? "
12  read contrib
13else
14  contrib=$1
15fi
16
17CONTRIB_DIR=$BUILD_DIR/../../../contribs/$contrib
18
19if ! [ -d "$CONTRIB_DIR" ]; then
20  echo "(!) Cannot find the contrib $contrib."
21  exit
22fi
23
24if [ "$2" = "" ]; then
25  mode=Release
26else
27  mode=$2
28fi
29if !([ "$mode" = "Release" ] || [ "$mode" = "Debug" ]); then
30  echo "(!) Second argument should be: Release, Debug or should be avoided."
31  exit
32fi
33suffix=-$mode
34if [ "$mode" = "Release" ]; then
35  suffix=
36fi
37
38CMAKE_DIR=~/CMake_Build/contrib/$contrib/$mode
39
40echo "----------------------------------------------------"
41echo " Building contrib $contrib - $mode"
42echo "----------------------------------------------------"
43
44if [ -d "$CMAKE_DIR" ]; then
45  echo "/!\ There is already a built folder of $contrib."
46  echo -n "mkdir? (y/n) "
47  read answer
48  if [ "$answer" = "y" ]; then
49    rm -r "$CMAKE_DIR"
50    mkdir -p "$CMAKE_DIR"
51  fi
52else
53  mkdir -p "$CMAKE_DIR"
54fi
55
56cd $CMAKE_DIR
57
58echo -n "cmake? (y/n) "
59read answer
60if [ "$answer" = "y" ]; then
61  #cmake para ZipArchive
62  cmake $CONTRIB_DIR -DCMAKE_BUILD_TYPE=$mode -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/$contrib$suffix
63fi
64
65echo -n "make? (y/n) "
66read answer
67if [ "$answer" = "y" ]; then
68  make
69fi
70
71echo -n "install? (y/n) "
72read answer
73if [ "$answer" = "y" ]; then
74  sudo make install
75fi
Note: See TracBrowser for help on using the repository browser.