From df081b8cf9f9e79d2f909cbd21ce0ad37cdf41cf Mon Sep 17 00:00:00 2001 From: Guillaume Pasero <guillaume.pasero@c-s.fr> Date: Tue, 9 Jan 2018 17:37:41 +0100 Subject: [PATCH] PKG: support installation of Java wrappings --- Packaging/CMakeLists.txt | 12 ++++++++++-- Packaging/Files/uninstall_otb.bat | 4 +++- Packaging/Files/uninstall_otb.sh | 2 +- Packaging/install_java_bindings.cmake | 27 +++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 Packaging/install_java_bindings.cmake diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt index e18cd06250..83d8487151 100644 --- a/Packaging/CMakeLists.txt +++ b/Packaging/CMakeLists.txt @@ -140,6 +140,7 @@ include(cleanup_package) include(install_include_dirs) include(install_importlibs) include(install_python_bindings) +include(install_java_bindings) include(install_share_dirs) include(install_cmake_files) include(install_qtdev_files) @@ -176,16 +177,21 @@ if(EXISTS "${SUPERBUILD_INSTALL_DIR}/bin/monteverdi${EXE_EXT}") set(HAVE_MVD TRUE) endif() -set(HAVE_PYTHON FALSE CACHE INTERNAL "HAVE_PYTHON") +set(HAVE_PYTHON FALSE CACHE INTERNAL "Python wrappings") if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/python/_otbApplication${PYMODULE_EXT}") set(HAVE_PYTHON TRUE) endif() -set(HAVE_PYTHON3 FALSE CACHE INTERNAL "HAVE_PYTHON3") +set(HAVE_PYTHON3 FALSE CACHE INTERNAL "Python3 wrappings") if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/python3/_otbApplication${PYMODULE_EXT}") set(HAVE_PYTHON3 TRUE) endif() +set(HAVE_JAVA FALSE CACHE INTERNAL "Java wrappings") +if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/java/org.otb.application.jar") + set(HAVE_JAVA TRUE) +endif() + #only for *nix if(UNIX) file(WRITE ${CMAKE_BINARY_DIR}/make_symlinks "#!/bin/sh\n") @@ -209,6 +215,8 @@ install_importlibs() install_python_bindings() +install_java_bindings() + install_share_dirs() install_cmake_files() diff --git a/Packaging/Files/uninstall_otb.bat b/Packaging/Files/uninstall_otb.bat index b437444cee..257d2ec730 100644 --- a/Packaging/Files/uninstall_otb.bat +++ b/Packaging/Files/uninstall_otb.bat @@ -26,7 +26,9 @@ set MY_INSTALL_DIR=%cd% del /S /Q %MY_INSTALL_DIR%\include\OTB* || exit 1 del /S /Q %MY_INSTALL_DIR%\lib\cmake\OTB* || exit 1 del /S /Q %MY_INSTALL_DIR%\lib\otb* || exit 1 -del /S /Q %MY_INSTALL_DIR%\lib\python\_otbApplication.* || exit 1 +del /S /Q %MY_INSTALL_DIR%\lib\python\*otbApplication.* || exit 1 +del /S /Q %MY_INSTALL_DIR%\lib\python3\*otbApplication.* || exit 1 +del /S /Q %MY_INSTALL_DIR%\lib\java\org.otb.application.jar || exit 1 del /S /Q %MY_INSTALL_DIR%\bin\otb* || exit 1 del /S /Q %MY_INSTALL_DIR%\bin\monteverdi.exe || exit 1 del /S /Q %MY_INSTALL_DIR%\bin\mapla.exe || exit 1 diff --git a/Packaging/Files/uninstall_otb.sh b/Packaging/Files/uninstall_otb.sh index 4f596f38ed..94ee967a48 100755 --- a/Packaging/Files/uninstall_otb.sh +++ b/Packaging/Files/uninstall_otb.sh @@ -21,7 +21,7 @@ set -e rm -fr OUT_DIR/include/OTB-* rm -f OUT_DIR/lib/{libotb*,libOTB*} -rm -fr OUT_DIR/lib/{otb,python/_otbApplication*} +rm -fr OUT_DIR/lib/{otb,python/*otbApplication*,python3/*otbApplication*,java/org.otb.application.jar} rm -fr OUT_DIR/share/OTB* rm -fv OUT_DIR/bin/{otb*,monteverdi,mapla} rm -fv OUT_DIR/{mapla.sh,monteverdi.sh} diff --git a/Packaging/install_java_bindings.cmake b/Packaging/install_java_bindings.cmake new file mode 100644 index 0000000000..d71c7b0217 --- /dev/null +++ b/Packaging/install_java_bindings.cmake @@ -0,0 +1,27 @@ +# +# Copyright (C) 2005-2017 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. +# + +function(install_java_bindings) + if(HAVE_JAVA) + install(FILE ${SUPERBUILD_INSTALL_DIR}/lib/otb/java/org.otb.application.jar + DESTINATION ${PKG_STAGE_DIR}/lib/java + ) + endif() +endfunction() -- GitLab