#!/bin/bash
export PKG_CONFIG_PATH=$MINGW/lib/pkgconfig
export PKG_CONFIG_LIBDIR=$MINGW/lib/pkgconfig
export PATH=$MINGW/bin:$PATH
pkg-config --list-all
#export DEBUG="-DVERBOSE=1   -DCMAKE_BUILD_TYPE=Debug"
export DEBUG="-G \"Unix Makefiles\""
echo "<<<<<<<<<<<<Cross compiling core>>>>>>>>>>>>>>>"
cmake   -DCROSS=$MINGW/ \
	-DTOOLCHAIN_LOCATION=$TOOLCHAIN_LOCATION \
        -DCMAKE_INCLUDE_PATH=$MINGW/include -DCMAKE_LIBRARY_PATH=$MINGW/lib \
        -DCMAKE_INSTALL_PREFIX=$MINGW/Release \
        -DCMAKE_CROSS_PREFIX=$CROSS_PREFIX \
        -DCMAKE_C_COMPILER:STRING=$CROSS_PREFIX-${CROSS_C_COMPILER} \
        -DCMAKE_CXX_COMPILER:STRING=$CROSS_PREFIX-${CROSS_CXX_COMPILER} \
        -DCMAKE_RC_COMPILER:STRING=$MINGW/bin/$CROSS_PREFIX-windres \
        -DCMAKE_LINKER:STRING=$CROSS_PREFIX-ld \
        -DCMAKE_AR:STRING=$CROSS_PREFIX-ar \
        -DCMAKE_SYSTEM_NAME:STRING=Windows \
        -DAVIDEMUX_TOP_SOURCE_DIR="$TOP"  \
        -G "Unix Makefiles" \
        $TOP/avidemux_core
