summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-07-21 20:38:53 (GMT)
committerBrad King <brad.king@kitware.com>2003-07-21 20:38:53 (GMT)
commita1bb1a47129380421fd9490688502ce5bee2e59f (patch)
treefadcd7e650d2da27ca29c2a5da6195969abe355b /bootstrap
parentd4afed0724866e093f0ae5bf8895ab1e1db3e4c4 (diff)
downloadCMake-a1bb1a47129380421fd9490688502ce5bee2e59f.zip
CMake-a1bb1a47129380421fd9490688502ce5bee2e59f.tar.gz
CMake-a1bb1a47129380421fd9490688502ce5bee2e59f.tar.bz2
ENH: Added optional configuration of data/doc/man dirs. This will be useful for package maintainers.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap65
1 files changed, 55 insertions, 10 deletions
diff --git a/bootstrap b/bootstrap
index 8559932..d0ee9fa 100755
--- a/bootstrap
+++ b/bootstrap
@@ -69,11 +69,15 @@ cmake_source_dir=`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'`
cmake_source_dir=`(cd "${cmake_source_dir}";pwd)`
cmake_binary_dir=`pwd`
cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap.cmk"
+cmake_data_dir="/share/CMake"
+cmake_doc_dir="/doc/CMake"
+cmake_man_dir="/man"
+cmake_init_file=""
# Display CMake bootstrap usage
cmake_usage()
{
- cat<<EOF
+ cat <<EOF
Usage: $0 [options]
Options: [defaults in brackets after descriptions]
Configuration:
@@ -82,10 +86,17 @@ Configuration:
--verbose display more information
--parallel=n bootstrap cmake in parallel, where n is
number of nodes [1]
+ --init=FILE use FILE for cmake initialization
Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
+ --prefix=PREFIX install files in tree rooted at PREFIX
[/usr/local]
+ --datadir=DIR install data files in PREFIX/DIR
+ [/share/CMake]
+ --docdir=DIR install documentation files in PREFIX/DIR
+ [/doc/CMake]
+ --mandir=DIR install man pages files in PREFIX/DIR/manN
+ [/man]
EOF
exit 10
}
@@ -240,6 +251,18 @@ for a in "$@"; do
if echo $a | grep "^--parallel=" > /dev/null 2> /dev/null; then
cmake_parallel_make=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
fi
+ if echo $a | grep "^--datadir=" > /dev/null 2> /dev/null; then
+ cmake_data_dir=`echo $a | sed "s/^--datadir=//"`
+ fi
+ if echo $a | grep "^--docdir=" > /dev/null 2> /dev/null; then
+ cmake_doc_dir=`echo $a | sed "s/^--docdir=//"`
+ fi
+ if echo $a | grep "^--mandir=" > /dev/null 2> /dev/null; then
+ cmake_man_dir=`echo $a | sed "s/^--mandir=//"`
+ fi
+ if echo $a | grep "^--init=" > /dev/null 2> /dev/null; then
+ cmake_init_file=`echo $a | sed "s/^--init=//"`
+ fi
if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
cmake_usage
fi
@@ -306,7 +329,7 @@ fi
# Check if C compiler works
TMPFILE=`cmake_tmp_file`
-cat>"${TMPFILE}.c"<<EOF
+cat > "${TMPFILE}.c" <<EOF
#include<stdio.h>
int main()
{
@@ -341,7 +364,7 @@ fi
# Check if C++ compiler works
TMPFILE=`cmake_tmp_file`
-cat>"${TMPFILE}.cxx"<<EOF
+cat > "${TMPFILE}.cxx" <<EOF
#include <stdio.h>
class NeedCXX
{
@@ -412,7 +435,7 @@ echo "Make processor on this system is: ${cmake_make_processor}"
cmake_test_flags="-LANG:std"
if [ "x${cmake_system}" = "xIRIX64" ]; then
TMPFILE=`cmake_tmp_file`
- cat>${TMPFILE}.cxx<<EOF
+ cat > ${TMPFILE}.cxx <<EOF
#include <iostream>
int main() { std::cout << "No need for ${cmake_test_flags}" << std::endl; return 0;}
EOF
@@ -438,7 +461,7 @@ cmake_test_flags=
cmake_test_flags="-timplicit_local -no_implicit_include"
if [ "x${cmake_system}" = "xOSF1" ]; then
TMPFILE=`cmake_tmp_file`
- cat>${TMPFILE}.cxx<<EOF
+ cat > ${TMPFILE}.cxx <<EOF
#include <iostream>
int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
EOF
@@ -462,7 +485,7 @@ cmake_test_flags=
cmake_test_flags="-std strict_ansi -nopure_cname"
if [ "x${cmake_system}" = "xOSF1" ]; then
TMPFILE=`cmake_tmp_file`
- cat>${TMPFILE}.cxx<<EOF
+ cat > ${TMPFILE}.cxx <<EOF
#include <iostream>
int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
EOF
@@ -561,6 +584,7 @@ for a in MAJOR MINOR PATCH; do
cmake_report cmConfigure.h.tmp "#define CMake_VERSION_${a} ${CMake_VERSION}"
done
cmake_report cmConfigure.h.tmp "#define CMAKE_ROOT_DIR \"${cmake_source_dir}\""
+cmake_report cmConfigure.h.tmp "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
cmake_report cmConfigure.h.tmp "#define CMAKE_BOOTSTRAP"
# Regenerate real cmConfigure.h
@@ -625,8 +649,29 @@ for a in ${KWSYS_CXX_SOURCES}; do
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
done
-# Write prefix to Bootstrap.cmk/InitialConfigureFlags.cmake
-echo "SET (CMAKE_CONFIGURE_INSTALL_PREFIX \"${cmake_prefix_dir}\" CACHE PATH \"Install path prefix, prepended onto install directories, For CMake this will always override CMAKE_INSTALL_PREFIX in the cache.\")" > "${cmake_bootstrap_dir}/InitialConfigureFlags.cmake"
+# Write prefix to Bootstrap.cmk/InitialCacheFlags.cmake
+cat > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
+# Generated by ${cmake_source_dir}/bootstrap
+EOF
+
+# Start with user-specified settings. Handle relative-path case for
+# specification of cmake_init_file.
+(
+cd "${cmake_binary_dir}"
+if [ -f "${cmake_init_file}" ]; then
+ cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
+fi
+)
+
+# Add our default settings.
+cat >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
+
+# Default cmake settings. These will not override any settings above.
+SET (CMAKE_INSTALL_PREFIX "${cmake_prefix_dir}" CACHE PATH "Install path prefix, prepended onto install directories.")
+SET (CMAKE_DOC_DIR "${cmake_doc_dir}" CACHE PATH "Install location for documentation (relative to prefix).")
+SET (CMAKE_MAN_DIR "${cmake_man_dir}" CACHE PATH "Install location for man pages (relative to prefix).")
+SET (CMAKE_DATA_DIR "${cmake_data_dir}" CACHE PATH "Install location for data (relative to prefix).")
+EOF
echo "---------------------------------------------"
@@ -652,7 +697,7 @@ export CXX
export MAKE
# Run bootstrap CMake to configure real CMake
-"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}"
+"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
echo "---------------------------------------------"