#!/bin/sh
# generated auomatically by configure

yajl="@YAJL_LIBS@"

TARGET=@PACKAGE_NAME@

VERSION=@OYRANOS_VERSION@
VERSION_L=$((@OYRANOS_VERSION_MAJOR@*10000+@OYRANOS_VERSION_MINOR@*100+@OYRANOS_VERSION_MICRO@))
VERSION_A=@OYRANOS_VERSION_MAJOR@
VERSION_B=@OYRANOS_VERSION_MINOR@
VERSION_C=@OYRANOS_VERSION_MICRO@

prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix="$prefix"
bindir="@CMAKE_INSTALL_PREFIX@/bin"
libdir="@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@"
framedir="@CMAKE_INSTALL_PREFIX@/@FRAMEWORK_DIR@"
cmmsubpath=@OY_CMMSUBPATH@
metasubpath=@OY_METASUBPATH@
cmmdir="$libdir/$cmmsubpath"
includedir="$prefix/include/oyranos"
datadir="$prefix/share"
mandir="$datadir/man"
syscolordir="$datadir/color"
usercolordir=~/.config/color
usercolordata=~/.local/share/color
iccdirname=icc
settingsdirname=settings
targetdirname=target
pixmapdir="$datadir/pixmaps"
icondir="$datadir/icons"
desktopdir="$datadir/applications"
oyranos_add="$ltdl $xml2 $iconv $intl $yajl"
sourcedir=@CMAKE_SOURCE_DIR@
builddir=@CMAKE_BINARY_DIR@

if [ -n "$PKG_CONFIG_PATH" ]; then
  PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libdir/pkgconfig
else
  PKG_CONFIG_PATH=$libdir/pkgconfig
fi
export PKG_CONFIG_PATH


if [ $# -eq 0 ]; then
  echo "$TARGET"
fi


while test $# -gt 0 
do
    case "$1" in
	-*=*) 
	    optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
	    ;;
	*)
	    optarg=
	    ;;
    esac

    case $1 in
	--version)
	    echo $VERSION
	    ;;
	--num-version)
	    echo $VERSION_L
	    ;;
	--api-version)
	    echo $VERSION_A
	    ;;
	--cflags)
	    echo_cflags=yes
	    ;;
	--ldflags)
	    echo_ldflags=yes
	    ;;
	--ldstaticflags)
	    echo_ldstaticflags=yes
	    ;;
	--syscolordir)
	    echo_syscolordir=yes
	    ;;
	--usercolordir)
	    echo_usercolordir=yes
	    ;;
	--iccdirname)
	    echo_iccdirname=yes
	    ;;
	--settingsdirname)
	    echo_settingsdirname=yes
	    ;;
        --cmmdir)
	    echo_cmmdirname=yes
	    ;;
        --metadir)
	    echo_metadirname=yes
	    ;;
        --builddir)
	    echo_builddirname=yes
	    ;;
        --sourcedir)
	    echo_sourcedirname=yes
	    ;;
	*)
	    echo_help=yes
	    ;;
    esac
    shift
done

if [ "$echo_help" = "yes" ]; then
  echo "usage:"
  echo "  $0 --version           get official version"
  echo "  $0 --api-version       get version of API"
  echo "  $0 --num-version       get version as a simple number"
  echo "  $0 --cflags            compiler flags"
  echo "  $0 --ldflags           dynamic link flags"
  echo "  $0 --ldstaticflags     static linking flags"
  echo "  $0 --syscolordir       path to system main color directory"
  echo "  $0 --usercolordir      path to users main color directory"
  echo "  $0 --iccdirname        ICC profile directory name"
  echo "  $0 --settingsdirname   Oyranos settings directory name"
  echo "  $0 --cmmdir            Oyranos CMM directory name"
  echo "  $0 --metadir           Oyranos meta module directory name"
  echo "  $0 --sourcedir         Oyranos local source directory name"
  echo "  $0 --builddir          Oyranos local build directory name"
fi

if [ "$echo_ldflags" = "yes" ]; then
    elektra_dyn="`pkg-config --libs elektra`"
    elektra="$elektra_dyn"
fi

if [ -z "$elektra" ]; then
  if [ -f $libdir/libelektra.a ]; then
    elektra="$libdir/libelektra.a"
    if [ -f $libdir/libelektra-filesys.a ]; then
      elektra="$elektra $libdir/libelektra-filesys.a"
    fi
    if [ -f $libdir/elektra/libelektra-filesys.a ]; then
      elektra="$elektra $libdir/elektra/libelektra-filesys.a"
    fi
  fi
  if [ -f $libdir/libelektra-static.a ]; then
    elektra="-lelektra-static"
  fi
fi

if [ -z "$elektra" ]; then
    elektra="`pkg-config --libs elektra`"
fi

if [ "$echo_cflags" = "yes" ]; then
  echo "@OYRANOS_INCLUDE_FLAGS@"
fi

if [ "$echo_ldflags" = "yes" ]; then
  if [ -f libOyranos.so ]; then
    echo "-L. -lOyranos -lOyranosConfig -lOyranosModules -lOyranosObject -lOyranosCore"
  else
    if [ -d $framedir/Oyranos.framework ]; then
      echo "@GCC_LINK_PATH_FLAG@$framedir @GCC_LINK_LIB_FLAG@Oyranos @GCC_LINK_LIB_FLAG@OyranosConfig @GCC_LINK_LIB_FLAG@OyranosModules @GCC_LINK_LIB_FLAG@OyranosObject @GCC_LINK_LIB_FLAG@OyranosCore"
    else
      echo "@GCC_LINK_PATH_FLAG@$libdir @GCC_LINK_LIB_FLAG@Oyranos @GCC_LINK_LIB_FLAG@OyranosConfig @GCC_LINK_LIB_FLAG@OyranosModules @GCC_LINK_LIB_FLAG@OyranosObject @GCC_LINK_LIB_FLAG@OyranosCore"
    fi
  fi
fi

if [ "$echo_ldstaticflags" = "yes" ]; then
  if [ -f liboyranos-static.a ]; then
    echo "liboyranos-static.a liboyranos_config-static.a liboyranos_modules-static.a liboyranos_object-static.a liboyranos_core-static.a $elektra $oyranos_add"
  else
    echo "-L$libdir -loyranos-static -loyranos_config-static -loyranos_modules-static -loyranos_object-static -loyranos_core-static $elektra $oyranos_add"
  fi
fi

if [ "$echo_syscolordir" = "yes" ]; then
  echo "$syscolordir"
fi
if [ "$echo_usercolordir" = "yes" ]; then
  echo "$usercolordir"
fi
if [ "$echo_iccdirname" = "yes" ]; then
  echo "$iccdirname"
fi
if [ "$echo_settingsdirname" = "yes" ]; then
  echo "$settingsdirname"
fi
if [ "$echo_cmmdirname" = "yes" ]; then
  echo "$cmmdir"
fi
if [ "$echo_metadirname" = "yes" ]; then
  echo "$libdir/$metasubpath"
fi
if [ "$echo_sourcedirname" = "yes" ]; then
  echo "$sourcedir"
fi
if [ "$echo_builddirname" = "yes" ]; then
  echo "$builddir"
fi

