source: flair-dev/trunk/scripts/cmake_codeblocks.sh @ 2

Last change on this file since 2 was 2, checked in by Sanahuja Guillaume, 5 years ago

initial commit flaircore

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1DIR=build_$(uname -m)
2
3function info () {
4        echo -e "\033[32m$1\033[0m"
5}
6
7function warn () {
8        echo -e "\033[33m$1\033[0m"
9}
10
11function err () {
12        echo -e "\033[31m$1\033[0m"
13        exit 1
14}
15
16if ! [ -f  ./CMakeLists.txt ]; then
17        err "Current directory does not contain CMakeLists.txt"
18fi
19
20#get cmake
21#if [ -f  ${OECORE_NATIVE_SYSROOT}/usr/bin/cmake ]; then
22#       CMAKE_NATIVE=${OECORE_NATIVE_SYSROOT}/usr/bin/cmake
23#else
24#       err "cross toolchain is not installed, please read https://devel.hds.utc.fr/projects/igep/wiki/toolchain/install"
25        CMAKE_NATIVE=cmake
26#fi
27
28#verifie l'existence du lien symbolique build
29if [ -d build ];then
30        if ! readlink build > /dev/null ; then
31                #it is a directory, exit to do not erase anything
32                err "Error: build already exsits and is a directory; it should be a symlink."
33        fi
34        if ! readlink build | grep -w $DIR >/dev/null; then
35                warn "Warnink, build was pointing to another directory."
36        fi
37        rm build
38fi
39
40#creation du repertoire
41mkdir -p $DIR
42#creation du lien symbolique
43ln -s $DIR build
44
45#creation project x86
46info "*************  Creating project for x86 *************"
47cd build
48rm -f CMakeCache.txt
49rm -rf CMakeFiles
50cmake ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_HOST_TOOLCHAIN}
51# -DCMAKE_BUILD_TYPE=Release
52
53#creation projet ARM
54info "************* Creating project for ARM *************"
55cd ..
56mkdir -p build_arm
57cd build_arm
58rm -f CMakeCache.txt
59rm -rf CMakeFiles
60
61$CMAKE_NATIVE ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_CROSS_TOOLCHAIN}
62# -DCMAKE_BUILD_TYPE=Release
Note: See TracBrowser for help on using the repository browser.