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 | |
---|
1 | DIR=build_$(uname -m)
|
---|
2 |
|
---|
3 | function info () {
|
---|
4 | echo -e "\033[32m$1\033[0m"
|
---|
5 | }
|
---|
6 |
|
---|
7 | function warn () {
|
---|
8 | echo -e "\033[33m$1\033[0m"
|
---|
9 | }
|
---|
10 |
|
---|
11 | function err () {
|
---|
12 | echo -e "\033[31m$1\033[0m"
|
---|
13 | exit 1
|
---|
14 | }
|
---|
15 |
|
---|
16 | if ! [ -f ./CMakeLists.txt ]; then
|
---|
17 | err "Current directory does not contain CMakeLists.txt"
|
---|
18 | fi
|
---|
19 |
|
---|
20 | #get cmake
|
---|
21 | CMAKE=${OECORE_HOST_NATIVE_SYSROOT}/usr/bin/cmake
|
---|
22 |
|
---|
23 | #verifie l'existence du lien symbolique build
|
---|
24 | if [ -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
|
---|
33 | fi
|
---|
34 |
|
---|
35 | #creation du repertoire
|
---|
36 | mkdir -p $DIR
|
---|
37 | #creation du lien symbolique
|
---|
38 | ln -s $DIR build
|
---|
39 |
|
---|
40 | #creation project x86
|
---|
41 | info "************* Creating project for x86 *************"
|
---|
42 | cd build
|
---|
43 | rm -f CMakeCache.txt
|
---|
44 | rm -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
|
---|
49 | info "************* Creating project for ARM *************"
|
---|
50 | cd ..
|
---|
51 | mkdir -p build_arm
|
---|
52 | cd build_arm
|
---|
53 | rm -f CMakeCache.txt
|
---|
54 | rm -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.