# Copyright (C)2013, 2015-2016 D. R. Commander
#
# This library is free software and may be redistributed and/or modified under
# the terms of the wxWindows Library License, Version 3.1 or (at your option)
# any later version.  The full license is in the LICENSE.txt file included
# with this distribution.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# wxWindows Library License for more details.

# If the faker libraries are packaged in a non-system directory, then this
# script adds that directory to VGL_LIBRARY_PATH, which is later added to
# LD_LIBRARY_PATH so that LD_PRELOAD can find the libraries.

VGL_LIBDIR=@CMAKE_INSTALL_FULL_LIBDIR@

if [ -d "$VGL_LIBDIR" -a -f "$VGL_LIBDIR/lib@VGL_FAKER_NAME@.so" ] && \
	[ $__VGL_DL -eq 0 -o -f "$VGL_LIBDIR/lib@VGL_DLFAKER_NAME@.so" ] && \
	[ $__VGL_GE -eq 0 -o -f "$VGL_LIBDIR/lib@VGL_GEFAKER_NAME@.so" ]; then
	if [ -z "$VGL_LIBRARY_PATH" ]; then
		VGL_LIBRARY_PATH=$VGL_LIBDIR
	else
		VGL_LIBRARY_PATH=$VGL_LIBRARY_PATH:$VGL_LIBDIR
	fi
fi
