Index: trunk/scripts/cmake_codelite.sh
===================================================================
--- trunk/scripts/cmake_codelite.sh	(revision 98)
+++ trunk/scripts/cmake_codelite.sh	(revision 99)
@@ -32,5 +32,5 @@
 	fi
 	if ! readlink build | grep -w build_core2_64 >/dev/null; then
-		warn "Warnink, build was pointing to another directory."
+		warn "Warning, build was pointing to another directory."
 	fi
 	rm build
Index: trunk/scripts/cmake_codelite_outofsource.sh
===================================================================
--- trunk/scripts/cmake_codelite_outofsource.sh	(revision 99)
+++ trunk/scripts/cmake_codelite_outofsource.sh	(revision 99)
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+function info () {
+	echo -e "\033[32m$1\033[0m"
+}
+
+function warn () {
+	echo -e "\033[33m$1\033[0m"
+}
+
+function err () {
+	echo -e "\033[31m$1\033[0m"
+	exit 1
+}
+
+if [ $(uname -m) != "x86_64" ]; then
+    err "unsupported host architecture, you need a x86_64 cpu"
+fi
+
+if ! [ -f  ${1}/CMakeLists.txt ]; then
+	err "${1} directory does not contain CMakeLists.txt"
+fi
+
+#get cmake
+CMAKE=${OECORE_HOST_NATIVE_SYSROOT}/usr/bin/cmake
+
+#verifie l'existence du lien symbolique build
+if [ -d build ];then
+	if ! readlink build > /dev/null ; then
+		#it is a directory, exit to do not erase anything
+		err "Error: build already exsits and is a directory; it should be a symlink."
+	fi
+	if ! readlink build | grep -w build_core2_64 >/dev/null; then
+		warn "Warning, build was pointing to another directory."
+	fi
+	rm build
+fi
+
+#iterate over available toolchains
+toolchains=($OECORE_CMAKE_TOOLCHAINS)
+for arch in ${toolchains[@]}; do
+    info "*************  Creating project for $arch *************"
+    toolchain=$(eval "echo \"\$OECORE_CMAKE_${arch^^}_TOOLCHAIN\"")
+    mkdir -p build_${arch}
+    cd build_${arch}
+    rm -f CMakeCache.txt
+    rm -rf CMakeFiles
+    ${CMAKE} ${1} -G "CodeLite - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${toolchain} -DCMAKE_CODELITE_USE_TARGETS=ON
+    cd ..
+done
+
+#creation du lien symbolique
+ln -s build_core2_64 build
Index: trunk/scripts/flair_compile_all.sh
===================================================================
--- trunk/scripts/flair_compile_all.sh	(revision 98)
+++ 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
