- install cmake configfile for host and target build
- cosmetics
This commit is contained in:
Stephan Raue 2010-03-20 13:20:20 +01:00
parent be560907dd
commit c2ed3538e4
2 changed files with 57 additions and 5 deletions

View File

@ -162,6 +162,10 @@ setup_toolchain() {
export CXXFLAGS="$TARGET_CXXFLAGS"
export LDFLAGS="$TARGET_LDFLAGS"
export PKG_CONFIG_PATH="$TARGET_PKG_CONFIG_PATH"
# set CMAKE configfile for target
export CMAKE_CONF=$ROOT/$TOOLCHAIN/etc/cmake-$TARGET_NAME.conf
elif [ "$1" = host ]; then
export AWK=$HOST_AWK
export CC=$HOST_CC
@ -178,6 +182,10 @@ setup_toolchain() {
export CXXFLAGS="$HOST_CXXFLAGS"
export LDFLAGS="$HOST_LDFLAGS"
export PKG_CONFIG_PATH="$HOST_PKG_CONFIG_PATH"
# set CMAKE configfile for host
export CMAKE_CONF=$ROOT/$TOOLCHAIN/etc/cmake-$HOST_NAME.conf
fi
}
setup_toolchain target

View File

@ -2,9 +2,53 @@
. config/options
cp $PKG_BUILD/bin/cmake \
$PKG_BUILD/bin/cpack \
$PKG_BUILD/bin/ctest \
$ROOT/$TOOLCHAIN/bin
mkdir -p $ROOT/$TOOLCHAIN/bin
cp -P $PKG_BUILD/bin/cmake $ROOT/$TOOLCHAIN/bin
cp -P $PKG_BUILD/bin/cpack $ROOT/$TOOLCHAIN/bin
cp -P $PKG_BUILD/bin/ctest $ROOT/$TOOLCHAIN/bin
# $PKG_BUILD/bin/ccmake \
mkdir -p $ROOT/$TOOLCHAIN/etc
cat >$ROOT/$TOOLCHAIN/etc/cmake-$TARGET_NAME.conf <<EOF
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
SET(CMAKE_C_COMPILER $TARGET_CC)
SET(CMAKE_CXX_COMPILER $TARGET_CXX)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH $SYSROOT_PREFIX)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
EOF
cat >$ROOT/$TOOLCHAIN/etc/cmake-$HOST_NAME.conf <<EOF
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
# specify the host compiler
SET(CMAKE_C_COMPILER $HOST_CC)
SET(CMAKE_CXX_COMPILER $HOST_CXX)
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH $ROOT/$TOOLCHAIN)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
EOF