#!/bin/sh
BDIR=Build/x86-linux

export MARTE_ENV="MARTe"

MARTE_ENV_PATH="${HOME}/workspace"
export MARTE_ENV_PATH="$MARTE_ENV_PATH"
export EPICS_BASE=/opt/epics/

export MARTe2_DIR="$MARTE_ENV_PATH/MARTe2"
export MARTe2_LIB_DIR="$MARTe2_DIR/$BDIR/Core"
export MARTe2_Components_DIR="$MARTE_ENV_PATH/MARTe2-components"

export LCOV_FLAGS="--ignore-errors mismatch,mismatch"


export GTEST_DIR="$MARTe2_DIR/Lib/gtest-1.7.0"


LIBRARIES+=("$MARTe2_LIB_DIR")
LIBRARIES+=("$MARTe2_Components_DIR/$BDIR/Components/GAMs/IOGAM")
LIBRARIES+=("$MARTe2_Components_DIR/$BDIR/Components/GAMs/WaveformGAM")
LIBRARIES+=("$MARTe2_Components_DIR/$BDIR/Components/DataSources/LinuxTimer")
LIBRARIES+=("$MARTe2_Components_DIR/$BDIR/Components/DataSources/LoggerDataSource")
LIBRARIES+=("/opt/epics/lib/linux-x86_64")

export CODAC_ROOT="${MARTE_ENV_PATH}/codac"

export _OLD_LIBRARY_PATH="$LD_LIBRARY_PATH"
_NEW_LIB_PATH=""
for _lib in "${LIBRARIES[@]}"; do
    if [ -z "$_NEW_LIB_PATH" ]; then
        _NEW_LIB_PATH="$_lib"
    else
        _NEW_LIB_PATH="$_NEW_LIB_PATH:$_lib"
    fi
done
export LD_LIBRARY_PATH="$_NEW_LIB_PATH"
