Commit b1a0eeca authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Homogenisation of script files

parent 3b845e68
......@@ -19,8 +19,9 @@ set -o pipefail #Error if a pipe fail
#Go in blaar directory
cd $(dirname $0)/..
basic_libraries=(blc_core blc_channel blc_network blc_program blc_image)
standard_projects=(i_channels i_keyboard)
#blc_core has to be first. It is used by all others projects
basic_libraries=(blc_core blc_channel blc_network blc_processes blc_program blc_image)
standard_projects=(blc_channels i_keyboard)
# We do not use function in purpose as 'set -o errexit' has no effect in it
......@@ -26,6 +26,5 @@ developer_tools/
#It has been deprecated on Sierra we do not automatically install it
#git submodule add
#On mac we add i_coreaudio for sound acquisition
git submodule add
#Basic Librairies And Applications for Robotics (BLAAR)
#Copyright ETIS — ENSEA, Université de Cergy-Pontoise, CNRS (2015 - 2017)
#This software is governed by the CeCILL v2.1 license under French law and abiding by the rules of distribution of free software.
#You can use, modify and/ or redistribute the software under the terms of the CeCILL v2.1 license as circulated by CEA, CNRS and INRIA at the following URL "".
#As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
#In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge.
#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.
#!/usr/bin/env bash #Use your $PATH to find bash
set -o errexit #Exit on first error
set -o nounset #Error if a variable is used but nont defined
set -o pipefail #Error if a pipe fail
#We go to the project directory and get the directory name then we go back to seach for the baar directory
cd $1
project_name=$(basename $project_dir)
cd - >/dev/null #Now we have the project directory we go back in current directory without message (/dev/null)
#We go in blaar directory
cd $(dirname $0)/..
if [ $# != 3 ]
if [ $# -ne 3 ]
echo "You need 3 arguments but you only have $#"
echo "Usage : create_project project_directory build_directory platform"
......@@ -19,21 +42,11 @@ case "$3" in
exit 1;;
project_name=`basename $1`
mkdir -p "$build_dir"
cd "$build_dir" && cmake -G"$generator" "$current_dir/$1" -DCMAKE_BUILD_TYPE="Debug" -DLIBRARY_OUTPUT_PATH=${blaar_build_dir} -DEXECUTABLE_OUTPUT_PATH=${blaar_build_dir}
if [ ! $ERROR ]; then
echo "Project created in $build_dir"
exit $ERROR
cd "$build_dir" && cmake --no-warn-unused-cli -G"$generator" "$current_dir/$1" -DCMAKE_BUILD_TYPE="Debug" -DLIBRARY_OUTPUT_PATH=${blaar_build_dir} -DEXECUTABLE_OUTPUT_PATH=${blaar_build_dir}
......@@ -17,22 +17,22 @@ set -o nounset #Error if a variable is used but nont defined
set -o pipefail #Error if a pipe fail
echo "Usage: install [-b directory] [-h] <project_directory> <Release|Debug|RelWithDebugInfo|MinSizeRel>"
echo "Usage: install [-h] <project_directory> <Release|Debug|RelWithDebugInfo|MinSizeRel>"
echo " -h :Display this help."
set -- $(getopt b:hi:q "$@")
args=$(getopt h $*) || { usage; exit 1; }
set -- $args #update positional parameter
while [ $# -gt 0 ]
case "$1" in
(-h) usage; exit 0;;
(--) shift; break;;
(-*) echo "$0: error - unrecognized option $1" ; exit 1;;
(*) break;;
(-h) usage; exit 0;;
(--) shift; break;;
(-*) echo "$0: error - unrecognized option $1" ; exit 1;;
(*) break;;
[ $# -ne 2 ] && { echo "$0: You need 2 arguments. You have '$@'"; usage; exit 1;}
......@@ -50,7 +50,7 @@ project_dir="$PWD"
project_name=`basename $project_dir` #Name of the project is name of the directory
echo " Install $1"
......@@ -60,12 +60,11 @@ cd $blaar_dir
./ $project_dir $build_type
cd $build_dir
ninja -t targets all | grep "install: phony" && echo "Install"
#We check if there is an install target if Yes we install it.
if ninja -t targets all | grep "install: phony" ; then
sudo ninja install || echo "Fail intalling '$project_path'"
sudo ninja install
echo "Nothing to install"
echo "Nothing to install"
Supports Markdown
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