ENH: Add parallel build support, fix bug in verbose and clean output when adding arguments

This commit is contained in:
Andy Cedilnik 2003-05-14 09:27:39 -04:00
parent df7ae80a21
commit 5e548d41d3

View File

@ -141,15 +141,19 @@ cmake_try_make ()
} }
cmake_verbose= cmake_verbose=
cmake_parallel_make=
cmake_prefix_dir="/usr/local" cmake_prefix_dir="/usr/local"
for a in "$@"; do for a in "$@"; do
if echo $a | grep "^--prefix="; then if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"` cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"`
fi fi
if echo $a | grep "^--help"; then 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 "^--help" > /dev/null 2> /dev/null; then
cmake_usage cmake_usage
fi fi
if echo $a | grep "^--verbose"; then if echo $a | grep "^--verbose" > /dev/null 2> /dev/null; then
cmake_verbose=TRUE cmake_verbose=TRUE
fi fi
done done
@ -160,6 +164,10 @@ if [ -n "${cmake_verbose}" ]; then
echo "Binary directory: ${cmake_binary_dir}" echo "Binary directory: ${cmake_binary_dir}"
echo "Prefix directory: ${cmake_prefix_dir}" echo "Prefix directory: ${cmake_prefix_dir}"
echo "System: ${cmake_system}" echo "System: ${cmake_system}"
if [ "x${cmake_parallel_make}" != "x" ]; then
echo "Doing parallel make: ${cmake_parallel_make}"
fi
echo ""
fi fi
echo "---------------------------------------------" echo "---------------------------------------------"
@ -359,7 +367,11 @@ echo "SET (CMAKE_CONFIGURE_INSTALL_PREFIX \"${cmake_prefix_dir}\" CACHE PATH \"I
echo "---------------------------------------------" echo "---------------------------------------------"
${cmake_make_processor} if [ "x${cmake_parallel_make}" != "x" ]; then
${cmake_make_processor} -j ${cmake_parallel_make}
else
${cmake_make_processor}
fi
RES=$? RES=$?
if [ "${RES}" -ne "0" ]; then if [ "${RES}" -ne "0" ]; then
cmake_error "Problem while bootstrapping CMake" cmake_error "Problem while bootstrapping CMake"