Welcome to mirror list, hosted at ThFree Co, Russian Federation.

find_generator_tool.sh « unix « tools - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 156ca53f1294f6a2cfe478a16b2b918e17e72389 (plain)
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
#!/bin/bash
#####################################
# Locates generator_tool executable #
#####################################

# Set GENERATOR_TOOL to explicitly use one
# Or BUILD_PATH to point to a build directory

OMIM_PATH="${OMIM_PATH:-$(cd "$(dirname "$0")/../.."; pwd)}"

if [ -z "${GENERATOR_TOOL-}" -o ! -x "${GENERATOR_TOOL-}" ]; then
  IT_PATHS_ARRAY=()
  for i in "${BUILD_PATH-}" "$OMIM_PATH" "$OMIM_PATH/.."/*omim*elease* "$OMIM_PATH/.."/*omim*ebug; do
    IT_PATHS_ARRAY+=("$i/generator_tool")
  done

  if [ -d "$OMIM_PATH/../omim-xcode-build" ]; then
    IT_PATHS_ARRAY+=("$OMIM_PATH/../omim-xcode-build/Release" "$OMIM_PATH/../omim-xcode-build/Debug")
  fi

  for i in "${BUILD_PATH:+$BUILD_PATH/generator_tool}" "${IT_PATHS_ARRAY[@]}"; do
    if [ -x "$i" ]; then
      GENERATOR_TOOL="$i"
      break
    fi
  done
fi

[ -z "${GENERATOR_TOOL-}" -o ! -x "${GENERATOR_TOOL-}" ] && fail "No generator_tool found in ${IT_PATHS_ARRAY[*]-${GENERATOR_TOOL-}}"
echo "Using tool: $GENERATOR_TOOL"