source: flair-src/branches/mavlink/tools/Dbt2csv/cmake_codeblocks.sh@ 49

Last change on this file since 49 was 46, checked in by Thomas Fuhrmann, 8 years ago

Add the mavlink branch

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1DIR=build_$(uname -m)
2
3function replace_cxx_flags () {
4 cmake_version=$(cmake --version)
5 cmake_version_number=$(expr match "$cmake_version" '.*\([0-9]\.[0-9]*\.[0-9]*\)')
6 first_digit=$(expr match "$cmake_version_number" '\([0-9]*\)')
7 second_digit=$(expr match "$cmake_version_number" '.*\.\([0-9]*\)\..*')
8 if [ "$first_digit" -ge "3" ] || [ "$second_digit" -ge "4" ]; then
9 find . -name build.make -type f -exec sed -i 's/CXX_FLAGS/CXX_FLAGS) $(CXX_INCLUDES/g' {} \;
10 fi
11}
12
13#verifie l'existence du lien symbolique build
14if [ -d build ];then
15 if ! readlink build > /dev/null ; then
16 #it is a directory, exit to do not erase anything
17 err "Error: build already exsits and is a directory; it should be a symlink."
18 exit 1
19 fi
20 if ! readlink build | grep -w $DIR >/dev/null; then
21 echo "Warnink, build was pointing to another directory."
22 fi
23 rm build
24fi
25
26#creation du repertoire
27mkdir -p $DIR
28#creation du lien symbolique
29ln -s $DIR build
30
31#creation project x86
32cd build
33
34rm -f CMakeCache.txt
35rm -rf CMakeFiles
36cmake ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_HOST_TOOLCHAIN}
37replace_cxx_flags
Note: See TracBrowser for help on using the repository browser.