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

Last change on this file since 28 was 24, checked in by Sanahuja Guillaume, 9 years ago

m

  • Property svn:executable set to *
File size: 1.3 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
21CMAKE=${OECORE_HOST_NATIVE_SYSROOT}/usr/bin/cmake
22
23#verifie l'existence du lien symbolique build
24if [ -d build ];then
25 if ! readlink build > /dev/null ; then
26 #it is a directory, exit to do not erase anything
27 err "Error: build already exsits and is a directory; it should be a symlink."
28 fi
29 if ! readlink build | grep -w $DIR >/dev/null; then
30 warn "Warnink, build was pointing to another directory."
31 fi
32 rm build
33fi
34
35#creation du repertoire
36mkdir -p $DIR
37#creation du lien symbolique
38ln -s $DIR build
39
40#creation project x86
41info "************* Creating project for x86 *************"
42cd build
43rm -f CMakeCache.txt
44rm -rf CMakeFiles
45${CMAKE} ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_HOST_TOOLCHAIN}
46# -DCMAKE_BUILD_TYPE=Release
47
48#creation projet ARM
49info "************* Creating project for ARM *************"
50cd ..
51mkdir -p build_arm
52cd build_arm
53rm -f CMakeCache.txt
54rm -rf CMakeFiles
55
56${CMAKE} ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_CROSS_TOOLCHAIN}
57# -DCMAKE_BUILD_TYPE=Release
Note: See TracBrowser for help on using the repository browser.