::
:: Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
::
:: This file is part of Orfeo Toolbox
::
::     https://www.orfeo-toolbox.org/
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::     http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

@echo off
::
:: Autogenerated by OTB installation process
:: DO NOT MODIFY
::

set CURRENT_SCRIPT_DIR=%~dp0

if exist %CURRENT_SCRIPT_DIR%otbApplicationLauncherCommandLine.exe (
  :: Prefer using the launcher inside the script dir
  set OTB_CLI_LAUNCHER=%CURRENT_SCRIPT_DIR%otbApplicationLauncherCommandLine.exe
) else (
  :: Use the one from the PATH
  set OTB_CLI_LAUNCHER=otbApplicationLauncherCommandLine.exe
)

setlocal
:: works for install tree
if exist %CURRENT_SCRIPT_DIR%..\@OTB_INSTALL_APP_DIR_NATIVE@ (
  set OTB_APPLICATION_PATH=%CURRENT_SCRIPT_DIR%..\@OTB_INSTALL_APP_DIR_NATIVE@;%OTB_APPLICATION_PATH%
)

::set GDAL_DATAs and update PATH
if exist %CURRENT_SCRIPT_DIR%\..\otbenv.bat (
    call %CURRENT_SCRIPT_DIR%\..\otbenv.bat
)

set LC_NUMERIC=C

:: start the application
%OTB_CLI_LAUNCHER% %*
endlocal
