Skip to content

Commit

Permalink
Export FFmpeg path and then echo to SHELLRC
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Dec 18, 2019
1 parent 9c7547a commit c33c1f2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions opencvDirectInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ execute () {
fi
}

# Executes first command passed &
# echo's it to the file passed as second argument
run_and_echo () {
eval $1
echo "$1" >> $2
}


if [[ -n $(echo $SHELL | grep "zsh") ]] ; then
SHELLRC=~/.zshrc
elif [[ -n $(echo $SHELL | grep "bash") ]] ; then
Expand Down Expand Up @@ -90,17 +98,17 @@ if [[ ! -n $(cat $SHELLRC | grep '# ffmpeg-build-script') ]]; then
sed -i 's/execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} ./execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DBUILD_SHARED_LIBS=1 ./g' build-ffmpeg

AUTOINSTALL=yes ./build-ffmpeg --build

echo "Adding ffmpeg's libraries to LD_LIBRARY_PATH"
{
echo ""
echo "# ffmpeg-build-script"
echo "export LD_LIBRARY_PATH=$(pwd)/workspace/lib:\$LD_LIBRARY_PATH"
echo "export PKG_CONFIG_PATH=$(pwd)/workspace/lib/pkgconfig:\$(pkg-config --variable pc_path pkg-config)"
echo "export PKG_CONFIG_LIBDIR=$(pwd)/workspace/lib/:\$PKG_CONFIG_LIBDIR"

} >> $SHELLRC

run_and_echo "export LD_LIBRARY_PATH=$(pwd)/workspace/lib:\$LD_LIBRARY_PATH" $SHELLRC
run_and_echo "export PKG_CONFIG_PATH=$(pwd)/workspace/lib/pkgconfig:\$(pkg-config --variable pc_path pkg-config)" $SHELLRC
run_and_echo "export PKG_CONFIG_LIBDIR=$(pwd)/workspace/lib/:\$PKG_CONFIG_LIBDIR" $SHELLRC
)
source $SHELLRC
fi

spatialPrint "GUI and openGL extensions"
Expand Down

0 comments on commit c33c1f2

Please sign in to comment.