source: flair-src/tags/latest/scripts/cmake_codelite_outofsource.sh@ 411

Last change on this file since 411 was 302, checked in by Sanahuja Guillaume, 3 years ago

modifs nouveau build system

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
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 [ $(uname -m) != "x86_64" ]; then
17 err "unsupported host architecture, you need a x86_64 cpu"
18fi
19
20if ! [ -f ${1}/CMakeLists.txt ]; then
21 err "${1} directory does not contain CMakeLists.txt"
22fi
23
24#get cmake
25CMAKE=${OECORE_HOST_NATIVE_SYSROOT}/usr/bin/cmake
26
27#verifie l'existence du lien symbolique build
28if [ -d build ];then
29 if ! readlink build > /dev/null ; then
30 #it is a directory, exit to do not erase anything
31 err "Error: build already exsits and is a directory; it should be a symlink."
32 fi
33 if ! readlink build | grep -w build_core2_64 >/dev/null; then
34 warn "Warning, build was pointing to another directory."
35 fi
36 rm build
37fi
38
39#iterate over available toolchains
40toolchains=($OECORE_CMAKE_TOOLCHAINS)
41for arch in ${toolchains[@]}; do
42 info "************* Creating project for $arch *************"
43 toolchain=$(eval "echo \"\$OECORE_CMAKE_${arch^^}_TOOLCHAIN\"")
44 mkdir -p build_${arch}
45 cd build_${arch}
46 rm -f CMakeCache.txt
47 rm -rf CMakeFiles
48 ${CMAKE} ${1} -G "CodeLite - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${toolchain} -DCMAKE_CODELITE_USE_TARGETS=ON
49 cd ..
50done
51
52#creation du lien symbolique
53ln -s build_core2_64 build
Note: See TracBrowser for help on using the repository browser.