Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

configure: Use system-installed CMake if available.

  • Loading branch information...
commit 858c70bf77613650cb69dda4a3f2c15802b3aed7 1 parent b444888
Ariya Hidayat ariya authored

Showing 1 changed file with 20 additions and 17 deletions. Show diff stats Hide diff stats

  1. +20 17 configure
37 configure
@@ -2,24 +2,27 @@
2 2
3 3 echo "Configuring HammerJS..."
4 4
5   -ABSPATH="$( cd "$( dirname "$0" )" && pwd )"
  5 +CMAKE=$(command -v cmake)
6 6
7   -if [ ! -f $ABSPATH/bin/cmake ]
8   -then
9   - echo "Building CMake..."
10   - CMAKE_VERSION=cmake-2.8.4
11   - CMAKE_TARBALL=$CMAKE_VERSION.tar.gz
12   - CMAKE_URL=http://www.cmake.org/files/v2.8/$CMAKE_TARBALL
13   - [ -d cmake ] || mkdir cmake
14   - cd cmake
15   - [ -f $CMAKE_TARBALL ] || curl -C - -O -S $CMAKE_URL
16   - tar xf $CMAKE_TARBALL
17   - cd $CMAKE_VERSION
18   - ./bootstrap --prefix=$ABSPATH
19   - make && make install
20   - echo "Local CMake is installed to $ABSPATH."
21   - cd .. && cd .. && echo "CMake build is completed."
  7 +if [ -z "$CMAKE" ]; then
  8 + ABSPATH="$( cd "$( dirname "$0" )" && pwd )"
  9 + CMAKE=$ABSPATH/bin/cmake
  10 + if [ ! -f $CMAKE ]; then
  11 + echo "Building CMake..."
  12 + CMAKE_VERSION=cmake-2.8.4
  13 + CMAKE_TARBALL=$CMAKE_VERSION.tar.gz
  14 + CMAKE_URL=http://www.cmake.org/files/v2.8/$CMAKE_TARBALL
  15 + [ -d cmake ] || mkdir cmake
  16 + cd cmake
  17 + [ -f $CMAKE_TARBALL ] || curl -C - -O -S $CMAKE_URL
  18 + tar xf $CMAKE_TARBALL
  19 + cd $CMAKE_VERSION
  20 + ./bootstrap --prefix=$ABSPATH
  21 + make && make install
  22 + echo "Local CMake is installed to $ABSPATH."
  23 + cd .. && cd .. && echo "CMake build is completed."
  24 + fi
22 25 fi
23 26
24   -$ABSPATH/bin/cmake .
  27 +$CMAKE .
25 28 echo "Configuration is done."

0 comments on commit 858c70b

Please sign in to comment.
Something went wrong with that request. Please try again.