Index: trunk/scripts/flair_compile_all.sh
===================================================================
--- trunk/scripts/flair_compile_all.sh	(revision 96)
+++ trunk/scripts/flair_compile_all.sh	(revision 99)
@@ -2,5 +2,5 @@
 NB_THREADS=$(nproc)
 from_scratch=no
-IDE_SCRIPT=cmake_codelite.sh
+IDE_SCRIPT=cmake_codelite_outofsource.sh
 toolchains=($OECORE_CMAKE_TOOLCHAINS)
 
@@ -25,101 +25,32 @@
 		exit 1
 	fi
-}
 
-function configure () {
-	if [ "$from_scratch" = "yes" ]; then
-		green_echo "Configuring $1/$2"
-		cd $1/$2
-
-		$FLAIR_ROOT/flair-dev/scripts/$IDE_SCRIPT > /dev/null
-	
-		check_error
-	else
-		green_echo "Not configuring $1/$2"
+    if ! [ -d $FLAIR_ROOT/flair-buil ]; then
+		green_echo "Creating $FLAIR_ROOT/flair-build directory"
+        mkdir -p $FLAIR_ROOT/flair-buil
 	fi
 }
 
-function compile () {
-    #iterate over available toolchains
-    for arch in ${toolchains[@]}; do
-        green_echo "Compiling and installing $2 for $arch"
-        cd $1/$2/build_$arch
-	    if [ "$from_scratch" = "yes" ]; then make clean > /dev/null; fi
-	    make -j$NB_THREADS > /dev/null
-	    check_error	
-	    make install
-    done
-}
-
-function compile_libs() {
-	for projects in FlairCore FlairSensorActuator FlairFilter FlairVisionFilter FlairMeta FlairSimulator ; do
-		configure $FLAIR_ROOT/flair-src/lib $projects
-	   	compile $FLAIR_ROOT/flair-src/lib $projects
-	done
-
-	if [ -d $FLAIR_ROOT/flair-hds ]; then
-		for projects in FlairBebop FlairArdrone2 FlairMinidrones FlairMamboEdu VisionFilter; do
-			configure $FLAIR_ROOT/flair-hds/src/lib $projects
-		   	compile $FLAIR_ROOT/flair-hds/src/lib $projects
-		done
-	fi
-}
-
-function compile_tools() {
-	for projects in FlairGCS Controller/DualShock3 Controller/Mavlink Dbt2csv VrpnBridge; do
-		configure $FLAIR_ROOT/flair-src/tools $projects
-	   	compile $FLAIR_ROOT/flair-src/tools $projects
-	done
-}
-
-function compile_uav_and_simulator_demo() {
-	for projects in simulator uav; do
-		configure $1/$2 $projects
-	   	compile $1/$2 $projects
-	done
-}
-
-function compile_demos() {
-	for projects in Sinus; do
-		configure $FLAIR_ROOT/flair-src/demos $projects
-	   	compile $FLAIR_ROOT/flair-src/demos $projects
-	done
-
-	for projects in OpticalFlow CircleFollower SimpleFleet Gps PidStandalone MixedReality/real MixedReality/virtual; do
-		compile_uav_and_simulator_demo $FLAIR_ROOT/flair-src/demos $projects
-	done
-
-	for projects in CustomReferenceAngles CustomTorques; do
-		configure $FLAIR_ROOT/flair-src/demos/Skeletons $projects
-	   	compile $FLAIR_ROOT/flair-src/demos/Skeletons $projects
-	done
-
-	if [ -d $FLAIR_ROOT/flair-hds ]; then
-		for projects in ApriltagFollower LineFollower; do
-			compile_uav_and_simulator_demo $FLAIR_ROOT/flair-hds/src/demos $projects
-		done
-	fi
-	
-}
 
 sanity_check
 
-if [ -d $FLAIR_ROOT/flair-hds ]; then
-	printf "Found flair-hds repository\n"
-fi
-
-printf "Compile all from scratch [Y/n]?"
+printf "Compile all from scratch (flair-build directory will be erased) [Y/n]?"
 read answer
 
 if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
-	from_scratch=yes
+	rm -rf $FLAIR_ROOT/flair-build/*
+    cd $FLAIR_ROOT/flair-build
+    $FLAIR_ROOT/flair-dev/scripts/$IDE_SCRIPT $FLAIR_ROOT/flair-src/
 fi
 
-printf "Compile Flair libs [Y/n]?"
-read answer
+#iterate over available toolchains
+for arch in ${toolchains[@]}; do
+    green_echo "Compiling and installing for $arch"
+    cd $FLAIR_ROOT/flair-build/build_$arch
+    make -j$NB_THREADS
+    check_error	
+    make install
+done
 
-if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
-	compile_libs
-fi
 
 printf "Compile Flair libs documentation [Y/n]?"
@@ -130,21 +61,4 @@
 fi
 
-printf "Compile Flair tools [Y/n]?"
-read answer
-
-if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
-	compile_tools
-fi
-
-printf "Compile demos [Y/n]?"
-read answer
-
-if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
-	compile_demos
-fi
 
 exit 0
-
-
-
-exit 0
