Merge pull request #221 from girtsf/update-osx-environment
add checks to osx_environment.sh
This commit is contained in:
commit
4dedd88ab2
|
@ -1,15 +1,26 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Checks if directory exists, otherwise asks to install package.
|
||||||
|
function check_dir_exists() {
|
||||||
|
local path=$1
|
||||||
|
local package=$2
|
||||||
|
|
||||||
|
if [ ! -d "$path" ]; then
|
||||||
|
echo "Please install $package"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! $BARRIER_BUILD_ENV ]; then
|
if [ ! $BARRIER_BUILD_ENV ]; then
|
||||||
|
check_dir_exists '/Applications/Xcode.app' 'Xcode'
|
||||||
|
|
||||||
printf "Modifying environment for Barrier build...\n"
|
printf "Modifying environment for Barrier build...\n"
|
||||||
|
|
||||||
if command -v port; then
|
if command -v port; then
|
||||||
printf "Detected Macports\n"
|
printf "Detected Macports\n"
|
||||||
|
|
||||||
if [ ! -d /opt/local/lib/cmake/Qt5 ]; then
|
check_dir_exists '/opt/local/lib/cmake/Qt5' 'qt5-qtbase port'
|
||||||
printf "Please install qt5-qtbase port\n"
|
|
||||||
fi
|
|
||||||
export BARRIER_BUILD_MACPORTS=1
|
export BARRIER_BUILD_MACPORTS=1
|
||||||
export CMAKE_PREFIX_PATH="/opt/local/lib/cmake/Qt5:$CMAKE_PREFIX_PATH"
|
export CMAKE_PREFIX_PATH="/opt/local/lib/cmake/Qt5:$CMAKE_PREFIX_PATH"
|
||||||
export LD_LIBRARY_PATH="/opt/local/lib:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="/opt/local/lib:$LD_LIBRARY_PATH"
|
||||||
|
@ -21,6 +32,9 @@ if [ ! $BARRIER_BUILD_ENV ]; then
|
||||||
QT_PATH=$(brew --prefix qt)
|
QT_PATH=$(brew --prefix qt)
|
||||||
OPENSSL_PATH=$(brew --prefix openssl)
|
OPENSSL_PATH=$(brew --prefix openssl)
|
||||||
|
|
||||||
|
check_dir_exists "$QT_PATH" 'qt'
|
||||||
|
check_dir_exists "$OPENSSL_PATH" 'openssl'
|
||||||
|
|
||||||
export BARRIER_BUILD_BREW=1
|
export BARRIER_BUILD_BREW=1
|
||||||
export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
|
export CMAKE_PREFIX_PATH="$QT_PATH:$CMAKE_PREFIX_PATH"
|
||||||
export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
|
export LD_LIBRARY_PATH="$OPENSSL_PATH/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
Loading…
Reference in New Issue