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

Fix that libs are now in build/lib/ . Add option to generate sublime projects.

parent 3a6d72d5
......@@ -12,41 +12,42 @@ 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
if [ $# -ne 3 ]
then
echo "You need 3 arguments but you only have $#"
echo "Usage : create_project.sh <project directory> <build directory> <eclipse|xcode>"
exit 1
fi
build_type=Debug #By default we consider we are debugging in a IDE
#We go to the project directory and get the directory name then we go back to seach for the baar directory
cd $1
project_dir="$PWD"
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)/..
blaar_dir="$PWD"
blaar_build_dir="${blaar_dir}_build"
current_dir=$PWD
if [ $# -ne 3 ]
then
echo "You need 3 arguments but you only have $#"
echo "Usage : create_project project_directory build_directory platform"
exit 1
fi
blaar_build_dir=$2
case "$3" in
"eclipse") generator="Eclipse CDT4 - Unix Makefiles";;
"eclipse") generator="Eclipse CDT4 - Ninja";;
"xcode") generator="Xcode";;
"sublime") generator="Sublime Text 2 - Ninja";;
"*") echo "The platform can be 'eclipse' or 'xcode', '$3' is unknowned"
exit 1;;
esac
ide_name=$3
build_dir=${blaar_build_dir}/cmake_files_$3/$project_name
project_name=`basename $1`
build_dir=${blaar_build_dir}/cmake_files_$ide_name/$project_name
mkdir -p "$build_dir"
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}
cd "$build_dir" && cmake --no-warn-unused-cli -G"$generator" "$project_dir" -DCMAKE_BUILD_TYPE=$build_type -DLIBRARY_OUTPUT_PATH=${blaar_build_dir}/$build_type/lib -DEXECUTABLE_OUTPUT_PATH=${blaar_build_dir}/$build_type
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