Commit 00755c7d authored by Arnaud Blanchard's avatar Arnaud Blanchard

Add all target to install all projects

parent e89967db
......@@ -12,35 +12,34 @@
# Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured  and, more generally, to use and operate it in the same conditions as regards security.
# The fact that you are presently reading this means that you have had knowledge of the CeCILL v2.1 license and that you accept its terms.
#Default values
usage()
{
echo "Usage: install [options] <project_directory> [Release|Debug|RelWithDebugInfo|MinSizeRel]"
echo "Usage: install [options] [all|<project_directory>] [Release|Debug|RelWithDebugInfo|MinSizeRel]"
echo " -b directory :Directory to create the build. (default: $build_dir)"
echo " -h :Display this help."
echo " -i directory :Directory to install the binaries. Default: $install_prefix"
echo
}
install_dir=/usr/local
install_dir="/usr/local"
set -- $(getopt b:hi: "$@")
while [ $# -gt 0 ]
do
case "$1" in
(-b) build_dir="$2"; shift;;
(-h) usage;exit 0;;
(-h) usage; exit 0;;
(-i) install_dir=$PWD/$2; install_prefix="-DCMAKE_INSTALL_PREFIX=$install_dir"; shift;;
(--) shift; break;;
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
(*) break;;
esac
shift
done
[ "$1" = "all" ] && { git submodule foreach --quiet '../install.sh' ; exit $? ; }
if [ "$2" ]; then
case "$2" in
Release|Debug|RelWithDebugInfo|MinSizeRel) build_type="$2";;
......@@ -61,14 +60,24 @@ echo
echo " Install $project"
echo "=========================="
mkdir -p $build_dir && cd $build_dir && cmake -q $current_dir/$1 $install_prefix -DCMAKE_BUILD_TYPE="Release" && make && {
[ -w $install_dir ] && { make install; } || sudo make install
mkdir -p $build_dir && cd $build_dir && cmake -q $current_dir/$1 $install_prefix -DCMAKE_BUILD_TYPE="Release" && make &&
{
if [ -w $install_dir ]; then
make install;
else
sudo make install
fi
}
if [ $? -ne 0 ]
then
echo "\nFail installing $1\n"
else
echo "\nSuccess installing $1"
then
echo
echo "\nFail installing $project\n"
echo
exit 1;
else
echo
echo "\nSuccess installing $project"
echo
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment