summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-17 01:13:54 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-17 01:13:54 (GMT)
commit8facf1f4069fcf56f2b2baf14211ed39030c4214 (patch)
treec3ab87a51412cecb3abd74115ad6c86758078b5d /bootstrap
parentf09778c4a5484d8d26cecdf31c02e44bdb881f9d (diff)
downloadCMake-8facf1f4069fcf56f2b2baf14211ed39030c4214.zip
CMake-8facf1f4069fcf56f2b2baf14211ed39030c4214.tar.gz
CMake-8facf1f4069fcf56f2b2baf14211ed39030c4214.tar.bz2
ENH: Made default install prefix consistent with building with another CMake.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap28
1 files changed, 26 insertions, 2 deletions
diff --git a/bootstrap b/bootstrap
index 30466cc..0e858d2 100755
--- a/bootstrap
+++ b/bootstrap
@@ -44,6 +44,29 @@ else
cmake_bootstrap_generator="Unix Makefiles"
fi
+# Helper function to fix windows paths.
+cmake_fix_slashes ()
+{
+ echo "$1" | sed 's/\\/\//g'
+}
+
+# Choose the default install prefix.
+if ${cmake_system_mingw}; then
+ if [ "x${PROGRAMFILES}" != "x" ]; then
+ cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
+ elif [ "x${ProgramFiles}" != "x" ]; then
+ cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
+ elif [ "x${SYSTEMDRIVE}" != "x" ]; then
+ cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
+ elif [ "x${SystemDrive}" != "x" ]; then
+ cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
+ else
+ cmake_default_prefix="c:/Program Files/CMake"
+ fi
+else
+ cmake_default_prefix="/usr/local"
+fi
+
CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc"
CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como "
CMAKE_KNOWN_MAKE_PROCESSORS="gmake make"
@@ -159,7 +182,7 @@ Configuration:
Directory and file names:
--prefix=PREFIX install files in tree rooted at PREFIX
- [/usr/local]
+ [${cmake_default_prefix}]
--datadir=DIR install data files in PREFIX/DIR
[/share/CMake]
--docdir=DIR install documentation files in PREFIX/DIR
@@ -372,10 +395,11 @@ cmake_try_make ()
# Parse arguments
cmake_verbose=
cmake_parallel_make=
-cmake_prefix_dir="/usr/local"
+cmake_prefix_dir="${cmake_default_prefix}"
for a in "$@"; do
if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"`
+ cmake_prefix_dir=`cmake_fix_slashes "${cmake_prefix_dir}"`
fi
if echo $a | grep "^--parallel=" > /dev/null 2> /dev/null; then
cmake_parallel_make=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`