Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

configure: Use system-installed CMake if available.

  • Loading branch information...
commit 858c70bf77613650cb69dda4a3f2c15802b3aed7 1 parent b444888
Ariya Hidayat ariya authored
Showing with 20 additions and 17 deletions.
  1. +20 −17 configure
37 configure
View
@@ -2,24 +2,27 @@
echo "Configuring HammerJS..."
-ABSPATH="$( cd "$( dirname "$0" )" && pwd )"
+CMAKE=$(command -v cmake)
-if [ ! -f $ABSPATH/bin/cmake ]
-then
- echo "Building CMake..."
- CMAKE_VERSION=cmake-2.8.4
- CMAKE_TARBALL=$CMAKE_VERSION.tar.gz
- CMAKE_URL=http://www.cmake.org/files/v2.8/$CMAKE_TARBALL
- [ -d cmake ] || mkdir cmake
- cd cmake
- [ -f $CMAKE_TARBALL ] || curl -C - -O -S $CMAKE_URL
- tar xf $CMAKE_TARBALL
- cd $CMAKE_VERSION
- ./bootstrap --prefix=$ABSPATH
- make && make install
- echo "Local CMake is installed to $ABSPATH."
- cd .. && cd .. && echo "CMake build is completed."
+if [ -z "$CMAKE" ]; then
+ ABSPATH="$( cd "$( dirname "$0" )" && pwd )"
+ CMAKE=$ABSPATH/bin/cmake
+ if [ ! -f $CMAKE ]; then
+ echo "Building CMake..."
+ CMAKE_VERSION=cmake-2.8.4
+ CMAKE_TARBALL=$CMAKE_VERSION.tar.gz
+ CMAKE_URL=http://www.cmake.org/files/v2.8/$CMAKE_TARBALL
+ [ -d cmake ] || mkdir cmake
+ cd cmake
+ [ -f $CMAKE_TARBALL ] || curl -C - -O -S $CMAKE_URL
+ tar xf $CMAKE_TARBALL
+ cd $CMAKE_VERSION
+ ./bootstrap --prefix=$ABSPATH
+ make && make install
+ echo "Local CMake is installed to $ABSPATH."
+ cd .. && cd .. && echo "CMake build is completed."
+ fi
fi
-$ABSPATH/bin/cmake .
+$CMAKE .
echo "Configuration is done."
Please sign in to comment.
Something went wrong with that request. Please try again.