Commit c4aa7c93 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Do not install if there is no install rule. The install path is not personalisable anymore.

parent c2f89fe6
......@@ -17,7 +17,7 @@ usage()
echo "Usage: install [-b directory] [-h] [-i diectory] <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 " -i directory :Directory to install the binaries. Default: $install_prefix"
echo
}
......@@ -29,7 +29,7 @@ do
case "$1" in
(-b) build_dir="$2"; shift;;
(-h) usage; exit 0;;
(-i) install_dir=$PWD/$2; install_prefix="-DCMAKE_INSTALL_PREFIX=$install_dir"; shift;;
# (-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;;
(*) break;;
......@@ -72,15 +72,19 @@ echo
echo " Install $project"
echo "=========================="
mkdir -p $build_dir && cd $build_dir && cmake -GNinja -q $project_dir $install_prefix -DCMAKE_BUILD_TYPE="$build_type" &&
./compile.sh $project_dir $build_type && echo "Success compiling $project"
{
cd $build_dir
if ninja -t targets all | grep --quiet "install: phony";
then
if [ -w $install_dir ]; then
ninja install;
else
sudo ninja install
fi
}
if [ $? -ne 0 ]
then
......@@ -93,4 +97,6 @@ echo
echo "\nSuccess installing $project"
echo
fi
else echo "Skipped install $project. It is not needed" ;
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