Last change
on this file since 16 was 2, checked in by Sanahuja Guillaume, 9 years ago |
initial commit flaircore
|
-
Property svn:executable
set to
*
|
File size:
1.5 KB
|
Rev | Line | |
---|
[2] | 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 | #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
|
---|
| 29 | if [ -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
|
---|
| 38 | fi
|
---|
| 39 |
|
---|
| 40 | #creation du repertoire
|
---|
| 41 | mkdir -p $DIR
|
---|
| 42 | #creation du lien symbolique
|
---|
| 43 | ln -s $DIR build
|
---|
| 44 |
|
---|
| 45 | #creation project x86
|
---|
| 46 | info "************* Creating project for x86 *************"
|
---|
| 47 | cd build
|
---|
| 48 | rm -f CMakeCache.txt
|
---|
| 49 | rm -rf CMakeFiles
|
---|
| 50 | cmake ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_HOST_TOOLCHAIN}
|
---|
| 51 | # -DCMAKE_BUILD_TYPE=Release
|
---|
| 52 |
|
---|
| 53 | #creation projet ARM
|
---|
| 54 | info "************* Creating project for ARM *************"
|
---|
| 55 | cd ..
|
---|
| 56 | mkdir -p build_arm
|
---|
| 57 | cd build_arm
|
---|
| 58 | rm -f CMakeCache.txt
|
---|
| 59 | rm -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.