diff --git a/CMake/UseJava.cmake b/CMake/UseJava.cmake deleted file mode 100644 index 013a3473a520167a70bd3a3e1e55ceed68039b1b..0000000000000000000000000000000000000000 --- a/CMake/UseJava.cmake +++ /dev/null @@ -1,862 +0,0 @@ -# - Use Module for Java -# This file provides functions for Java. It is assumed that FindJava.cmake -# has already been loaded. See FindJava.cmake for information on how to -# load Java into your CMake project. -# -# add_jar(TARGET_NAME SRC1 SRC2 .. SRCN RCS1 RCS2 .. RCSN) -# -# This command creates a <TARGET_NAME>.jar. It compiles the given source -# files (SRC) and adds the given resource files (RCS) to the jar file. -# If only resource files are given then just a jar file is created. -# -# Additional instructions: -# To add compile flags to the target you can set these flags with -# the following variable: -# -# set(CMAKE_JAVA_COMPILE_FLAGS -nowarn) -# -# To add a path or a jar file to the class path you can do this -# with the CMAKE_JAVA_INCLUDE_PATH variable. -# -# set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar) -# -# To use a different output name for the target you can set it with: -# -# set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar) -# add_jar(foobar foobar.java) -# -# To add a VERSION to the target output name you can set it using -# CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name -# shibboleet-1.0.0.jar and will create a symlink shibboleet.jar -# pointing to the jar with the version information. -# -# set(CMAKE_JAVA_TARGET_VERSION 1.2.0) -# add_jar(shibboleet shibbotleet.java) -# -# If the target is a JNI library, utilize the following commands to -# create a JNI symbolic link: -# -# set(CMAKE_JNI_TARGET TRUE) -# set(CMAKE_JAVA_TARGET_VERSION 1.2.0) -# add_jar(shibboleet shibbotleet.java) -# install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet) -# install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR}) -# -# If a single target needs to produce more than one jar from its -# java source code, to prevent the accumulation of duplicate class -# files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior -# to calling the add_jar() function: -# -# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo) -# add_jar(foo foo.java) -# -# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar) -# add_jar(bar bar.java) -# -# Target Properties: -# The add_jar() functions sets some target properties. You can get these -# properties with the -# get_property(TARGET <target_name> PROPERTY <propery_name>) -# command. -# -# INSTALL_FILES The files which should be installed. This is used by -# install_jar(). -# JNI_SYMLINK The JNI symlink which should be installed. -# This is used by install_jni_symlink(). -# JAR_FILE The location of the jar file so that you can include -# it. -# CLASS_DIR The directory where the class files can be found. For -# example to use them with javah. -# -# find_jar(<VAR> -# name | NAMES name1 [name2 ...] -# [PATHS path1 [path2 ... ENV var]] -# [VERSIONS version1 [version2]] -# [DOC "cache documentation string"] -# ) -# -# This command is used to find a full path to the named jar. A cache -# entry named by <VAR> is created to stor the result of this command. If -# the full path to a jar is found the result is stored in the variable -# and the search will not repeated unless the variable is cleared. If -# nothing is found, the result will be <VAR>-NOTFOUND, and the search -# will be attempted again next time find_jar is invoked with the same -# variable. -# The name of the full path to a file that is searched for is specified -# by the names listed after NAMES argument. Additional search locations -# can be specified after the PATHS argument. If you require special a -# version of a jar file you can specify it with the VERSIONS argument. -# The argument after DOC will be used for the documentation string in -# the cache. -# -# install_jar(TARGET_NAME DESTINATION) -# -# This command installs the TARGET_NAME files to the given DESTINATION. -# It should be called in the same scope as add_jar() or it will fail. -# -# install_jni_symlink(TARGET_NAME DESTINATION) -# -# This command installs the TARGET_NAME JNI symlinks to the given -# DESTINATION. It should be called in the same scope as add_jar() -# or it will fail. -# -# create_javadoc(<VAR> -# PACKAGES pkg1 [pkg2 ...] -# [SOURCEPATH <sourcepath>] -# [CLASSPATH <classpath>] -# [INSTALLPATH <install path>] -# [DOCTITLE "the documentation title"] -# [WINDOWTITLE "the title of the document"] -# [AUTHOR TRUE|FALSE] -# [USE TRUE|FALSE] -# [VERSION TRUE|FALSE] -# ) -# -# Create java documentation based on files or packages. For more -# details please read the javadoc manpage. -# -# There are two main signatures for create_javadoc. The first -# signature works with package names on a path with source files: -# -# Example: -# create_javadoc(my_example_doc -# PACKAGES com.example.foo com.example.bar -# SOURCEPATH ${CMAKE_CURRENT_SOURCE_PATH} -# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} -# WINDOWTITLE "My example" -# DOCTITLE "<h1>My example</h1>" -# AUTHOR TRUE -# USE TRUE -# VERSION TRUE -# ) -# -# The second signature for create_javadoc works on a given list of -# files. -# -# create_javadoc(<VAR> -# FILES file1 [file2 ...] -# [CLASSPATH <classpath>] -# [INSTALLPATH <install path>] -# [DOCTITLE "the documentation title"] -# [WINDOWTITLE "the title of the document"] -# [AUTHOR TRUE|FALSE] -# [USE TRUE|FALSE] -# [VERSION TRUE|FALSE] -# ) -# -# Example: -# create_javadoc(my_example_doc -# FILES ${example_SRCS} -# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} -# WINDOWTITLE "My example" -# DOCTITLE "<h1>My example</h1>" -# AUTHOR TRUE -# USE TRUE -# VERSION TRUE -# ) -# -# Both signatures share most of the options. These options are the -# same as what you can find in the javadoc manpage. Please look at -# the manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and -# VERSION. -# -# The documentation will be by default installed to -# -# ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR> -# -# if you don't set the INSTALLPATH. -# - -#============================================================================= -# Copyright 2010-2011 Andreas schneider <asn@redhat.com> -# Copyright 2010 Ben Boeckel <ben.boeckel@kitware.com> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -function (__java_copy_file src dest comment) - add_custom_command( - OUTPUT ${dest} - COMMAND cmake -E copy_if_different - ARGS ${src} - ${dest} - DEPENDS ${src} - COMMENT ${comment}) -endfunction () - -# define helper scripts -get_filename_component(_UseJava_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -set(_JAVA_CLASS_FILELIST_SCRIPT ${_UseJava_LIST_DIR}/UseJavaClassFilelist.cmake) -set(_JAVA_SYMLINK_SCRIPT ${_UseJava_LIST_DIR}/UseJavaSymlinks.cmake) - -function(add_jar _TARGET_NAME) - set(_JAVA_SOURCE_FILES ${ARGN}) - - if (LIBRARY_OUTPUT_PATH) - set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) - else () - set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) - endif () - - set(CMAKE_JAVA_INCLUDE_PATH - ${CMAKE_JAVA_INCLUDE_PATH} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_JAVA_OBJECT_OUTPUT_PATH} - ${CMAKE_JAVA_LIBRARY_OUTPUT_PATH} - ) - - if (WIN32 AND NOT CYGWIN) - set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";") - else () - set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":") - endif() - - foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") - endforeach() - - set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") - - set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar") - if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION) - set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar") - set(_JAVA_TARGET_OUTPUT_LINK "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar") - elseif (CMAKE_JAVA_TARGET_VERSION) - set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar") - set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar") - elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME) - set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar") - endif () - # reset - set(CMAKE_JAVA_TARGET_OUTPUT_NAME) - - set(_JAVA_CLASS_FILES) - set(_JAVA_COMPILE_FILES) - set(_JAVA_DEPENDS) - set(_JAVA_RESOURCE_FILES) - foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES}) - get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT) - get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE) - get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH) - get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE) - - file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR} ${_JAVA_FULL}) - file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL}) - string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN) - string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) - if (${_BIN_LEN} LESS ${_SRC_LEN}) - set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH}) - else () - set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH}) - endif () - get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH) - - if (_JAVA_EXT MATCHES ".java") - list(APPEND _JAVA_COMPILE_FILES ${_JAVA_SOURCE_FILE}) - set(_JAVA_CLASS_FILE "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_REL_PATH}/${_JAVA_FILE}.class") - set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES} ${_JAVA_CLASS_FILE}) - - elseif (_JAVA_EXT MATCHES ".jar" - OR _JAVA_EXT MATCHES ".war" - OR _JAVA_EXT MATCHES ".ear" - OR _JAVA_EXT MATCHES ".sar") - list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_SOURCE_FILE}) - - elseif (_JAVA_EXT STREQUAL "") - list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH}) - list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}}) - - else () - __java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE} - ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE} - "Copying ${_JAVA_SOURCE_FILE} to the build directory") - list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE}) - endif () - endforeach() - - # create an empty java_class_filelist - if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist) - file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "") - endif() - - if (_JAVA_COMPILE_FILES) - # Compile the java files and create a list of class files - add_custom_command( - # NOTE: this command generates an artificial dependency file - OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME} - COMMAND ${Java_JAVAC_EXECUTABLE} - ${CMAKE_JAVA_COMPILE_FLAGS} - -classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}" - -d ${CMAKE_JAVA_CLASS_OUTPUT_PATH} - ${_JAVA_COMPILE_FILES} - COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME} - DEPENDS ${_JAVA_COMPILE_FILES} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Building Java objects for ${_TARGET_NAME}.jar" - ) - add_custom_command( - OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist - COMMAND ${CMAKE_COMMAND} - -DCMAKE_JAVA_CLASS_OUTPUT_PATH=${CMAKE_JAVA_CLASS_OUTPUT_PATH} - -DCMAKE_JAR_CLASSES_PREFIX="${CMAKE_JAR_CLASSES_PREFIX}" - -P ${_JAVA_CLASS_FILELIST_SCRIPT} - DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - endif () - - # create the jar file - if (CMAKE_JNI_TARGET) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - COMMAND ${Java_JAR_EXECUTABLE} - -cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - ${_JAVA_RESOURCE_FILES} @java_class_filelist - COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} - -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} - -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} - -P ${_JAVA_SYMLINK_SCRIPT} - COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} - -D_JAVA_TARGET_OUTPUT_NAME=${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} - -P ${_JAVA_SYMLINK_SCRIPT} - DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist - WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH} - COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}" - ) - else () - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - COMMAND ${Java_JAR_EXECUTABLE} - -cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - ${_JAVA_RESOURCE_FILES} @java_class_filelist - COMMAND ${CMAKE_COMMAND} - -D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} - -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} - -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} - -P ${_JAVA_SYMLINK_SCRIPT} - WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH} - DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist - COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}" - ) - endif () - - # Add the target and make sure we have the latest resource files. - add_custom_target(${_TARGET_NAME} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) - - set_property( - TARGET - ${_TARGET_NAME} - PROPERTY - INSTALL_FILES - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - ) - - if (_JAVA_TARGET_OUTPUT_LINK) - set_property( - TARGET - ${_TARGET_NAME} - PROPERTY - INSTALL_FILES - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK} - ) - - if (CMAKE_JNI_TARGET) - set_property( - TARGET - ${_TARGET_NAME} - PROPERTY - JNI_SYMLINK - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK} - ) - endif () - endif () - - set_property( - TARGET - ${_TARGET_NAME} - PROPERTY - JAR_FILE - ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} - ) - - set_property( - TARGET - ${_TARGET_NAME} - PROPERTY - CLASSDIR - ${CMAKE_JAVA_CLASS_OUTPUT_PATH} - ) - -endfunction() - -function(INSTALL_JAR _TARGET_NAME _DESTINATION) - get_property(__FILES - TARGET - ${_TARGET_NAME} - PROPERTY - INSTALL_FILES - ) - - if (__FILES) - install( - FILES - ${__FILES} - DESTINATION - ${_DESTINATION} - ) - else () - message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.") - endif () -endfunction() - -function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION) - get_property(__SYMLINK - TARGET - ${_TARGET_NAME} - PROPERTY - JNI_SYMLINK - ) - - if (__SYMLINK) - install( - FILES - ${__SYMLINK} - DESTINATION - ${_DESTINATION} - ) - else () - message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.") - endif () -endfunction() - -function (find_jar VARIABLE) - set(_jar_names) - set(_jar_files) - set(_jar_versions) - set(_jar_paths - /usr/share/java/ - /usr/local/share/java/ - ${Java_JAR_PATHS}) - set(_jar_doc "NOTSET") - - set(_state "name") - - foreach (arg ${ARGN}) - if (${_state} STREQUAL "name") - if (${arg} STREQUAL "VERSIONS") - set(_state "versions") - elseif (${arg} STREQUAL "NAMES") - set(_state "names") - elseif (${arg} STREQUAL "PATHS") - set(_state "paths") - elseif (${arg} STREQUAL "DOC") - set(_state "doc") - else () - set(_jar_names ${arg}) - if (_jar_doc STREQUAL "NOTSET") - set(_jar_doc "Finding ${arg} jar") - endif () - endif () - elseif (${_state} STREQUAL "versions") - if (${arg} STREQUAL "NAMES") - set(_state "names") - elseif (${arg} STREQUAL "PATHS") - set(_state "paths") - elseif (${arg} STREQUAL "DOC") - set(_state "doc") - else () - set(_jar_versions ${_jar_versions} ${arg}) - endif () - elseif (${_state} STREQUAL "names") - if (${arg} STREQUAL "VERSIONS") - set(_state "versions") - elseif (${arg} STREQUAL "PATHS") - set(_state "paths") - elseif (${arg} STREQUAL "DOC") - set(_state "doc") - else () - set(_jar_names ${_jar_names} ${arg}) - if (_jar_doc STREQUAL "NOTSET") - set(_jar_doc "Finding ${arg} jar") - endif () - endif () - elseif (${_state} STREQUAL "paths") - if (${arg} STREQUAL "VERSIONS") - set(_state "versions") - elseif (${arg} STREQUAL "NAMES") - set(_state "names") - elseif (${arg} STREQUAL "DOC") - set(_state "doc") - else () - set(_jar_paths ${_jar_paths} ${arg}) - endif () - elseif (${_state} STREQUAL "doc") - if (${arg} STREQUAL "VERSIONS") - set(_state "versions") - elseif (${arg} STREQUAL "NAMES") - set(_state "names") - elseif (${arg} STREQUAL "PATHS") - set(_state "paths") - else () - set(_jar_doc ${arg}) - endif () - endif () - endforeach () - - if (${_jar_names} STREQUAL "") - message(FATAL_ERROR "find_jar: No name to search for given") - endif () - - foreach (jar_name ${_jar_names}) - foreach (version ${_jar_versions}) - set(_jar_files ${_jar_files} ${jar_name}-${version}.jar) - endforeach () - set(_jar_files ${_jar_files} ${jar_name}.jar) - endforeach () - - find_file(${VARIABLE} - NAMES ${_jar_files} - PATHS ${_jar_paths} - DOC ${_jar_doc} - NO_DEFAULT_PATH) -endfunction () - -function(create_javadoc _target) - set(_javadoc_packages) - set(_javadoc_files) - set(_javadoc_sourcepath) - set(_javadoc_classpath) - set(_javadoc_installpath "${CMAKE_INSTALL_PREFIX}/share/javadoc") - set(_javadoc_doctitle) - set(_javadoc_windowtitle) - set(_javadoc_author FALSE) - set(_javadoc_version FALSE) - set(_javadoc_use FALSE) - - set(_state "package") - - foreach (arg ${ARGN}) - if (${_state} STREQUAL "package") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_packages ${arg}) - set(_state "packages") - endif () - elseif (${_state} STREQUAL "packages") - if (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - list(APPEND _javadoc_packages ${arg}) - endif () - elseif (${_state} STREQUAL "files") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - list(APPEND _javadoc_files ${arg}) - endif () - elseif (${_state} STREQUAL "sourcepath") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - list(APPEND _javadoc_sourcepath ${arg}) - endif () - elseif (${_state} STREQUAL "classpath") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - list(APPEND _javadoc_classpath ${arg}) - endif () - elseif (${_state} STREQUAL "installpath") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_installpath ${arg}) - endif () - elseif (${_state} STREQUAL "doctitle") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_doctitle ${arg}) - endif () - elseif (${_state} STREQUAL "windowtitle") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_windowtitle ${arg}) - endif () - elseif (${_state} STREQUAL "author") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_author ${arg}) - endif () - elseif (${_state} STREQUAL "use") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_use ${arg}) - endif () - elseif (${_state} STREQUAL "version") - if (${arg} STREQUAL "PACKAGES") - set(_state "packages") - elseif (${arg} STREQUAL "FILES") - set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") - set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") - set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") - set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") - set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") - set(_state "author") - elseif (${arg} STREQUAL "USE") - set(_state "use") - elseif (${arg} STREQUAL "VERSION") - set(_state "version") - else () - set(_javadoc_version ${arg}) - endif () - endif () - endforeach () - - set(_javadoc_builddir ${CMAKE_CURRENT_BINARY_DIR}/javadoc/${_target}) - set(_javadoc_options -d ${_javadoc_builddir}) - - if (_javadoc_sourcepath) - set(_start TRUE) - foreach(_path ${_javadoc_sourcepath}) - if (_start) - set(_sourcepath ${_path}) - set(_start FALSE) - else () - set(_sourcepath ${_sourcepath}:${_path}) - endif () - endforeach() - set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath}) - endif () - - if (_javadoc_classpath) - set(_start TRUE) - foreach(_path ${_javadoc_classpath}) - if (_start) - set(_classpath ${_path}) - set(_start FALSE) - else () - set(_classpath ${_classpath}:${_path}) - endif () - endforeach() - set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}") - endif () - - if (_javadoc_doctitle) - set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}') - endif () - - if (_javadoc_windowtitle) - set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}') - endif () - - if (_javadoc_author) - set(_javadoc_options ${_javadoc_options} -author) - endif () - - if (_javadoc_use) - set(_javadoc_options ${_javadoc_options} -use) - endif () - - if (_javadoc_version) - set(_javadoc_options ${_javadoc_options} -version) - endif () - - add_custom_target(${_target}_javadoc ALL - COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options} - ${_javadoc_files} - ${_javadoc_packages} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - - install( - DIRECTORY ${_javadoc_builddir} - DESTINATION ${_javadoc_installpath} - ) -endfunction() diff --git a/CMake/UseJavaClassFilelist.cmake b/CMake/UseJavaClassFilelist.cmake deleted file mode 100644 index 6f3a4e7a988120d07590ebdaaadedbc5045883c1..0000000000000000000000000000000000000000 --- a/CMake/UseJavaClassFilelist.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# -# This script create a list of compiled Java class files to be added to a -# jar file. This avoids including cmake files which get created in the -# binary directory. -# - -#============================================================================= -# Copyright 2010-2011 Andreas schneider <asn@redhat.com> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -if (CMAKE_JAVA_CLASS_OUTPUT_PATH) - if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}") - - set(_JAVA_GLOBBED_FILES) - if (CMAKE_JAR_CLASSES_PREFIX) - foreach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX}) - message(STATUS "JAR_CLASS_PREFIX: ${JAR_CLASS_PREFIX}") - - file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class") - if (_JAVA_GLOBBED_TMP_FILES) - list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES}) - endif () - endforeach() - else() - file(GLOB_RECURSE _JAVA_GLOBBED_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/*.class") - endif () - - set(_JAVA_CLASS_FILES) - # file(GLOB_RECURSE foo RELATIVE) is broken so we need this. - foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES}) - file(RELATIVE_PATH _JAVA_CLASS_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ${_JAVA_GLOBBED_FILE}) - set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES}${_JAVA_CLASS_FILE}\n) - endforeach() - - # write to file - file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist ${_JAVA_CLASS_FILES}) - - else () - message(SEND_ERROR "FATAL: Java class output path doesn't exist") - endif () -else () - message(SEND_ERROR "FATAL: Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH") -endif () diff --git a/CMake/UseJavaSymlinks.cmake b/CMake/UseJavaSymlinks.cmake deleted file mode 100644 index 88dd7689c8c8cf9cfdc175e8326decfbc22c8a53..0000000000000000000000000000000000000000 --- a/CMake/UseJavaSymlinks.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# -# Helper script for UseJava.cmake -# - -#============================================================================= -# Copyright 2010-2011 Andreas schneider <asn@redhat.com> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -if (UNIX AND _JAVA_TARGET_OUTPUT_LINK) - if (_JAVA_TARGET_OUTPUT_NAME) - find_program(LN_EXECUTABLE - NAMES - ln - ) - - execute_process( - COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}" - WORKING_DIRECTORY ${_JAVA_TARGET_DIR} - ) - else () - message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME") - endif () -endif () diff --git a/Documentation/Cookbook/rst/CliInterface.rst b/Documentation/Cookbook/rst/CliInterface.rst index f2bd7ec6889c79fe4756438139641a50a2fccb30..eebd130fe3f08995be54e36ddf4c822fc247b3de 100644 --- a/Documentation/Cookbook/rst/CliInterface.rst +++ b/Documentation/Cookbook/rst/CliInterface.rst @@ -21,7 +21,7 @@ entry points. While the framework can be extended, the Orfeo ToolBox ships with reporting, - A SWIG interface, which means that any application can be loaded, - set-up and executed into a high-level language such as Python or Java + set-up and executed into a high-level language such as Python for instance. - `QGIS <http://www.qgis.org/>`_ plugin built on top of diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperDocExampleStructure.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperDocExampleStructure.h index 0c77787e20c491a6e572f305e9fd3f4ad89c20bd..f52c96441f7dbd2e58bc68530c92f06f26447e56 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperDocExampleStructure.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperDocExampleStructure.h @@ -37,8 +37,7 @@ namespace Wrapper /** \class DocExampleStructure * \brief This class is a structure that gathered the necessary - * element to generate an example (for CommandLine, python, Java - * ...). + * element to generate an example (for CommandLine, python ...). * User has to set the application name, the binary path and a list of * key/value couple. * diff --git a/Modules/Wrappers/SWIG/otb-module-init.cmake b/Modules/Wrappers/SWIG/otb-module-init.cmake index 496497bd52198a20e428cb635caeb515aaed8b9b..0730626d29de3406d57c5f1ea68373c74d1521a1 100644 --- a/Modules/Wrappers/SWIG/otb-module-init.cmake +++ b/Modules/Wrappers/SWIG/otb-module-init.cmake @@ -19,9 +19,8 @@ # option ( OTB_WRAP_PYTHON "Wrap Python" OFF ) -option ( OTB_WRAP_JAVA "Wrap Java" OFF ) -if ( OTB_WRAP_PYTHON OR OTB_WRAP_JAVA ) +if ( OTB_WRAP_PYTHON ) find_package ( SWIG REQUIRED ) mark_as_advanced(SWIG_DIR) mark_as_advanced(SWIG_EXECUTABLE) @@ -51,14 +50,4 @@ if ( OTB_WRAP_PYTHON ) message( WARNING "OTB wrappers will be done without support for NumPy (not found).") endif() -endif() - -# -# JAVA SWIG configuration -# -if ( OTB_WRAP_JAVA ) - check_PIC_flag ( Java ) - find_package ( Java REQUIRED ) - find_package ( JNI REQUIRED ) - mark_as_advanced( JAVA_HOME ) -endif() +endif() \ No newline at end of file diff --git a/Modules/Wrappers/SWIG/src/CMakeLists.txt b/Modules/Wrappers/SWIG/src/CMakeLists.txt index bf7b888185f28195bf2d696bb67ee2dd06c58b11..ebae699688ad14b987db947246cb24dd719da0fa 100644 --- a/Modules/Wrappers/SWIG/src/CMakeLists.txt +++ b/Modules/Wrappers/SWIG/src/CMakeLists.txt @@ -18,7 +18,7 @@ # limitations under the License. # -if ( OTB_WRAP_PYTHON OR OTB_WRAP_JAVA ) +if ( OTB_WRAP_PYTHON ) include ( UseSWIGLocal ) list(APPEND SWIG_EXTRA_DEPS otbWrapperSWIGIncludes.h @@ -32,9 +32,4 @@ endif() # Python SWIG configuration if ( OTB_WRAP_PYTHON ) add_subdirectory(python) -endif() - -# JAVA SWIG configuration -if ( OTB_WRAP_JAVA ) - add_subdirectory(java) -endif() +endif() \ No newline at end of file diff --git a/Modules/Wrappers/SWIG/src/Java.i b/Modules/Wrappers/SWIG/src/Java.i deleted file mode 100644 index 877629f5f6ceaeeb6263cd8f552ed2b38508742d..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/src/Java.i +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -#if SWIGJAVA - -%ignore CreateAnother; -%ignore Delete; -%ignore Register; -%ignore UnRegister; -%ignore GetReferenceCount; -%ignore SetReferenceCount; -%ignore DebugOn; -%ignore DebugOff; -%ignore GetDebug; -%ignore SetDebug; -%ignore GetMTime; -%ignore Modified; -%ignore SetGlobalWarningDisplay; -%ignore GetGlobalWarningDisplay; -%ignore GlobalWarningDisplayOn; -%ignore GlobalWarningDisplayOff; - -%ignore New; - - -//###################################################################### -// Simulating smart pointers in SWIG -// This gets rid of wrapping ITK smart pointers. - -// TODO: always tell swig we're the owner -// TODO: itk classes with no New() must be marked as abstract -%define DECLARE_REF_COUNT_CLASS(itkClass) - - class itkClass##_Pointer - { - public: - itkClass##_Pointer(); - itkClass##_Pointer(itkClass##_Pointer const & p); - itkClass##_Pointer(itkClass * p); - ~itkClass##_Pointer(); - itkClass * operator->() const; - bool IsNotNull() const; - bool IsNull() const; - itkClass * GetPointer() const; - private: - void Register(); - void UnRegister(); - protected: - }; -/* - %extend itkClass { - public: - itkClass() { - typedef ::itk::SmartPointer<itkLightObject> Pointer; - Pointer smtPtr = itkClass::New().GetPointer(); - itkClass *rawPtr = dynamic_cast<itkClass *>(smtPtr.GetPointer()); - rawPtr->Register(); - return rawPtr; - } - ~itkClass() { - self->UnRegister(); - } - } - - %typemap(out) itkClass##_Pointer { - itkClass* ptrRaw = $1.GetPointer(); - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } - - %typemap(out) itkClass##_Pointer & { - itkClass* ptrRaw = (*$1).GetPointer(); - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } - - // Do not wrap the corresponding itkSmartPointer - //%ignore itkClass##_Pointer; -*/ -%enddef - -%pragma(java) jniclasscode=%{ - static { - System.loadLibrary ( "otbApplicationJava" ); - } -%} - -%rename(CreateApplicationInternal) Registry::CreateApplication(const std::string& name); - -%typemap(javacode) Registry %{ - - public static Application CreateApplication(String name) { - Application_Pointer app = CreateApplicationInternal(name); - return app.__deref__(); - } -%} - -/* This tells SWIG to treat char ** as a special case when used as a parameter - in a function call */ -%typemap(in) std::vector< std::string > { - int i = 0; - int size = jenv->GetArrayLength($input); - for (i = 0; i<size; i++) { - jstring j_string = (jstring)jenv->GetObjectArrayElement($input, i); - const char * c_string = jenv->GetStringUTFChars(j_string, 0); - $1.push_back(c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - -} - -// transform std::vector< std::string > to a more standard String Array -%typemap(out) std::vector< std::string > - { - int i; - int len=$1.size(); - jstring temp_string; - const jclass clazz = jenv->FindClass("java/lang/String"); - - jresult = jenv->NewObjectArray(len, clazz, NULL); - /* exception checking omitted */ - - for (i=0; i<len; i++) - { - temp_string = jenv->NewStringUTF($1[i].c_str()); - jenv->SetObjectArrayElement(jresult, i, temp_string); - jenv->DeleteLocalRef(temp_string); - } - } - -%typemap(jni) std::vector< std::string > "jobjectArray" -%typemap(jtype) std::vector< std::string > "String[]" -%typemap(jstype) std::vector< std::string > "String[]" - -%typemap(javain) std::vector< std::string > "$javainput" -%typemap(javaout) std::vector< std::string > { - return $jnicall; - } - - -#endif diff --git a/Modules/Wrappers/SWIG/src/Lua.i b/Modules/Wrappers/SWIG/src/Lua.i deleted file mode 100644 index 226867e52c8131853f4299702dbc444049ed1316..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/src/Lua.i +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2005-2019 CS Systemes d'Information (CS SI) - * - * 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. - */ - -#if SWIGLUA - - -%ignore CreateAnother; -%ignore Delete; -%ignore Register; -%ignore UnRegister; -%ignore GetReferenceCount; -%ignore SetReferenceCount; -%ignore DebugOn; -%ignore DebugOff; -%ignore GetDebug; -%ignore SetDebug; -%ignore GetMTime; -%ignore Modified; -%ignore SetGlobalWarningDisplay; -%ignore GetGlobalWarningDisplay; -%ignore GlobalWarningDisplayOn; -%ignore GlobalWarningDisplayOff; - -%ignore New; - - -//###################################################################### -// Simulating smart pointers in SWIG -// This gets rid of wrapping ITK smart pointers. - -// TODO: always tell swig we're the owner -// TODO: itk classes with no New() must be marked as abstract -%define DECLARE_REF_COUNT_CLASS(itkClass) - - class itkClass##_Pointer - { - public: - itkClass##_Pointer(); - itkClass##_Pointer(itkClass##_Pointer const & p); - itkClass##_Pointer(itkClass * p); - ~itkClass##_Pointer(); - itkClass * operator->() const; - bool IsNotNull() const; - bool IsNull() const; - itkClass * GetPointer() const; - bool operator<(itkClass##_Pointer const & r) const; - bool operator>(itkClass##_Pointer const & r) const; - bool operator<=(itkClass##_Pointer const & r) const; - bool operator>=(itkClass##_Pointer const & r) const; - itkClass##_Pointer & operator=(itkClass##_Pointer const & r); - itkClass##_Pointer & operator=(itkClass## * r); -// itkClass * Print(std::ostream & os) const; - private: - void Register(); - void UnRegister(); - protected: - }; - - - // Extend the itk classtype defined for wrapping to simulate a smart pointer in SWIG. - // Also, make the ctor public to make the 'new' operator available in java - %extend itkClass { - public: - itkClass() { - typedef ::itk::SmartPointer<itkLightObject> Pointer; - Pointer smtPtr = itkClass::New().GetPointer(); - itkClass *rawPtr = dynamic_cast<itkClass *>(smtPtr.GetPointer()); - rawPtr->Register(); - return rawPtr; - }; - ~itkClass() { - self->UnRegister(); - }; - } -/* - %typemap(out) itkClass * { - itkClass* ptrRaw = $1; - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } -*/ - %typemap(out) itkClass##_Pointer { - itkClass* ptrRaw = $1.GetPointer(); - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } - - %typemap(out) itkClass##_Pointer & { - itkClass* ptrRaw = (*$1).GetPointer(); - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } - - // Do not wrap the corresponding itkSmartPointer - %ignore itkClass##_Pointer; - -%enddef - -#endif - diff --git a/Modules/Wrappers/SWIG/src/Ruby.i b/Modules/Wrappers/SWIG/src/Ruby.i deleted file mode 100644 index 25ce05695f8b5524b781359d1754fde0c1eb0e57..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/src/Ruby.i +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -#if SWIGRUBY - -%ignore CreateAnother; -%ignore Delete; -%ignore Register; -%ignore UnRegister; -%ignore GetReferenceCount; -%ignore SetReferenceCount; -%ignore DebugOn; -%ignore DebugOff; -%ignore GetDebug; -%ignore SetDebug; -%ignore GetMTime; -%ignore Modified; -%ignore SetGlobalWarningDisplay; -%ignore GetGlobalWarningDisplay; -%ignore GlobalWarningDisplayOn; -%ignore GlobalWarningDisplayOff; - -%ignore New; - - -//###################################################################### -// Simulating smart pointers in SWIG -// This gets rid of wrapping ITK smart pointers. - -// TODO: always tell swig we're the owner -// TODO: itk classes with no New() must be marked as abstract -%define DECLARE_REF_COUNT_CLASS(itkClass) - - class itkClass##_Pointer - { - public: - itkClass##_Pointer(); - itkClass##_Pointer(itkClass##_Pointer const & p); - itkClass##_Pointer(itkClass * p); - ~itkClass##_Pointer(); - itkClass * operator->() const; - bool IsNotNull() const; - bool IsNull() const; - itkClass * GetPointer() const; - bool operator<(itkClass##_Pointer const & r) const; - bool operator>(itkClass##_Pointer const & r) const; - bool operator<=(itkClass##_Pointer const & r) const; - bool operator>=(itkClass##_Pointer const & r) const; - itkClass##_Pointer & operator=(itkClass##_Pointer const & r); - itkClass##_Pointer & operator=(itkClass## * r); -// itkClass * Print(std::ostream & os) const; - private: - void Register(); - void UnRegister(); - protected: - }; - - - // Extend the itk classtype defined for wrapping to simulate a smart pointer in SWIG. - // Also, make the ctor public to make the 'new' operator available in java - %extend itkClass { - public: - itkClass() { - typedef ::itk::SmartPointer<itkLightObject> Pointer; - Pointer smtPtr = itkClass::New().GetPointer(); - itkClass *rawPtr = dynamic_cast<itkClass *>(smtPtr.GetPointer()); - rawPtr->Register(); - return rawPtr; - }; - ~itkClass() { - self->UnRegister(); - }; - } -/* - %typemap(out) itkClass * { - itkClass* ptrRaw = $1; - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } -*/ - %typemap(out) itkClass##_Pointer { - itkClass* ptrRaw = $1.GetPointer(); - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } - - %typemap(out) itkClass##_Pointer & { - itkClass* ptrRaw = (*$1).GetPointer(); - if (ptrRaw) { - ptrRaw->Register(); - } - *(itkClass **)&$result = ptrRaw; - } - - // Do not wrap the corresponding itkSmartPointer - %ignore itkClass##_Pointer; - -%enddef - -%pragma(java) jniclasscode=%{ - static { - System.loadLibrary ( "otbApplicationJava" ); - } -%} - - -#endif diff --git a/Modules/Wrappers/SWIG/src/itkBase.i b/Modules/Wrappers/SWIG/src/itkBase.i index 60e352a8a8b7578c42c321dd37a76305503c20a9..6c2a2a35ae3daeb2d00129e1c60dd2bc79299d37 100644 --- a/Modules/Wrappers/SWIG/src/itkBase.i +++ b/Modules/Wrappers/SWIG/src/itkBase.i @@ -256,9 +256,6 @@ class itkIndent { virtual void SetReferenceCount(int arg0); protected: itkLightObject(); -#if SWIGJAVA - ~itkLightObject(); -#endif }; DECLARE_REF_COUNT_CLASS( itkLightObject ) @@ -290,9 +287,6 @@ class itkIndent { void SetMetaDataDictionary(itkMetaDataDictionary const & rhs); protected: itkObject(); -#if SWIGJAVA - ~itkObject(); -#endif }; DECLARE_REF_COUNT_CLASS( itkObject ) @@ -302,9 +296,6 @@ class itkIndent { const float& GetProgress(); protected: itkProcessObject(); -#if SWIGJAVA - ~itkProcessObject(); -#endif }; DECLARE_REF_COUNT_CLASS( itkProcessObject ) @@ -330,9 +321,6 @@ class itkIndent { char const * GetLibraryPath(); protected: itkObjectFactoryBase(); -#if SWIGJAVA - ~itkObjectFactoryBase(); -#endif }; DECLARE_REF_COUNT_CLASS( itkObjectFactoryBase ) @@ -345,9 +333,6 @@ public: virtual void Print(std::ostream &os) const; protected: itkMetaDataObjectBase(); -#if SWIGJAVA - ~itkMetaDataObjectBase(); -#endif }; DECLARE_REF_COUNT_CLASS(itkMetaDataObjectBase) @@ -380,9 +365,6 @@ inline void EncapsulateMetaData(itkMetaDataDictionary & Dictionary, const std::s virtual void Execute(itkObject * caller, itkEventObject const & event) = 0; protected: itkCommand(); -#if SWIGJAVA - ~itkCommand(); -#endif }; DECLARE_REF_COUNT_CLASS( itkCommand ) diff --git a/Modules/Wrappers/SWIG/src/java/CMakeLists.txt b/Modules/Wrappers/SWIG/src/java/CMakeLists.txt deleted file mode 100644 index d0c6a4bffeeecbfd2f31cba6c62e5bc3ddb255fd..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/src/java/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright (C) 2005-2019 CS Systemes d'Information (CS SI) -# -# 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. -# - -include_directories ( ${JAVA_INCLUDE_PATH} ${JNI_INCLUDE_DIRS} ) -set_source_files_properties ( ../otbApplication.i PROPERTIES CPLUSPLUS ON ) - -# Make sure the nested directory structure exists -set(JAVA_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/org/otb/application) -set(JAVA_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build) -file(MAKE_DIRECTORY ${JAVA_SOURCE_DIRECTORY}) -file(MAKE_DIRECTORY ${JAVA_BINARY_DIRECTORY}) - -# Nicely write the bridge code in org/itk/simple -set(CMAKE_SWIG_OUTDIR ${JAVA_SOURCE_DIRECTORY}) -set(CMAKE_SWIG_FLAGS -package "org.otb.application" ${CMAKE_SWIG_GLOBAL_FLAGS}) -set(SWIG_MODULE_otbApplicationJava_EXTRA_DEPS - ${CMAKE_CURRENT_SOURCE_DIR}/../Java.i - OTBApplicationEngine) -SWIG_add_module ( otbApplicationJava java ../otbApplication.i otbApplicationJAVA_wrap.cxx) -SWIG_link_libraries(otbApplicationJava OTBApplicationEngine ) - -if(MSVC) - set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/otbApplicationJAVA_wrap.cxx COMPILE_FLAGS "/wd4005" ) -else() - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/otbApplicationJAVA_wrap.cxx COMPILE_FLAGS "-w") -endif() - -# Add target for org.otb.Application.jar -add_custom_target(org_otb_Application_jar ALL DEPENDS org.otb.application.jar) - -otb_module_target_label( org_otb_Application_jar ) - -# Add custom command and target to compile the generated files and put them in a jar file -# Make sure the commands depend on the output library from SWIG -add_custom_command( - OUTPUT org.otb.application.jar - COMMENT "Creating jar file..." - COMMAND ${Java_JAVAC_EXECUTABLE} -d ${JAVA_BINARY_DIRECTORY} ${JAVA_SOURCE_DIRECTORY}/*.java - COMMAND ${Java_JAR_EXECUTABLE} cf ${CMAKE_CURRENT_BINARY_DIR}/org.otb.application.jar -C ${JAVA_BINARY_DIRECTORY} org - DEPENDS ${SWIG_MODULE_otbApplication_REAL_NAME} otbApplicationJava OTBApplicationEngine - ) - -# Get the location of the extension directory -string(REGEX REPLACE "include" "jre/lib/ext" JAVA_EXTENSION_DIR ${JAVA_INCLUDE_PATH} ) - -# Add the install target -# -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.otb.application.jar DESTINATION ${JAVA_EXTENSION_DIR}) -# Prefer using OTB_INSTALL_JAVA_DIR which defaults to something that honors CMAKE_INSTALL_PREFIX -# Using the system-wide Java extension dir usually require admin privileges, -# and shall better be left to packagers. -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.otb.application.jar - DESTINATION ${OTB_INSTALL_JAVA_DIR} - COMPONENT RuntimeLibraries ) diff --git a/Modules/Wrappers/SWIG/src/otbApplication.i b/Modules/Wrappers/SWIG/src/otbApplication.i index 6f84595c2462083646ae6a559896e058831c0e66..7a260b2fd6ba52779c63af5bd77462db88eba126 100644 --- a/Modules/Wrappers/SWIG/src/otbApplication.i +++ b/Modules/Wrappers/SWIG/src/otbApplication.i @@ -31,9 +31,6 @@ // Language specific extension %include "Python.i" -%include "Java.i" -%include "Ruby.i" -%include "Lua.i" %include "itkMacro.i" %include "itkBase.i" @@ -515,9 +512,6 @@ public: protected: Application(); -#if SWIGJAVA - virtual ~Application(); -#endif private: Application(const Application &); void operator =(const Application&); diff --git a/Modules/Wrappers/SWIG/test/CMakeLists.txt b/Modules/Wrappers/SWIG/test/CMakeLists.txt index d1b14cdbd5110fb009d225b288a06e6bc6d66bbe..47c7553e7a8a69c8f1d4256cedefdbfe8971af12 100644 --- a/Modules/Wrappers/SWIG/test/CMakeLists.txt +++ b/Modules/Wrappers/SWIG/test/CMakeLists.txt @@ -20,8 +20,4 @@ if (OTB_WRAP_PYTHON) add_subdirectory(python) -endif() - -if (OTB_WRAP_JAVA) - add_subdirectory(java) -endif() +endif() \ No newline at end of file diff --git a/Modules/Wrappers/SWIG/test/java/CMakeLists.txt b/Modules/Wrappers/SWIG/test/java/CMakeLists.txt deleted file mode 100644 index d57617cc2029cfabb836fc4012d74bee939b8824..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/test/java/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -# -# Copyright (C) 2005-2019 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. -# - -include( UseJava ) - -set(TEST_DRIVER otbTestDriver - --add-before-env OTB_APPLICATION_PATH $<TARGET_FILE_DIR:otbapp_Smoothing> -) - -set( PATH_SEPARATOR ":") -if (WIN32) - set( PATH_SEPARATOR ";") - # on windows, loading the module _otbApplication requires the otbossimplugins*.dll - # which is in the 'bin' folder - set(TEST_DRIVER ${TEST_DRIVER} - --add-before-env PATH ${OTB_BINARY_DIR}/bin) -endif() - -set( CMAKE_JAVA_INCLUDE_PATH ${OTBSWIGWrapper_BINARY_DIR}/src/java/org.otb.application.jar ) -set( JAVA_COMMAND "${Java_JAVA_EXECUTABLE}" - "-Djava.library.path=${OTB_BINARY_DIR}/Code/Wrappers/SWIG${PATH_SEPARATOR}$<TARGET_FILE_DIR:otbApplicationJava>" ) - -add_jar( JavaSmoothingTest JavaSmoothingTest.java ) -add_dependencies( JavaSmoothingTest org_otb_Application_jar ) -add_dependencies( OTBSWIGWrapper-all JavaSmoothingTest ) -add_test( NAME jaTvSmoothing - COMMAND ${TEST_DRIVER} Execute - ${Java_JAVA_EXECUTABLE} - "-Djava.library.path=${OTB_BINARY_DIR}/Code/Wrappers/SWIG${PATH_SEPARATOR}$<TARGET_FILE_DIR:otbApplicationJava>" - -cp "${CMAKE_JAVA_INCLUDE_PATH}${PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}/JavaSmoothingTest.jar" - SmoothingTest - ${OTB_DATA_ROOT}/Input/ToulouseExtract_WithGeom.tif - ${TEMP}/jaTvSmoothing_ ) - -add_jar( JavaRescaleTest JavaRescaleTest.java ) -add_dependencies( JavaRescaleTest org_otb_Application_jar ) -add_dependencies( OTBSWIGWrapper-all JavaRescaleTest ) -add_test( NAME jaTvRescale - COMMAND ${TEST_DRIVER} Execute - ${Java_JAVA_EXECUTABLE} - "-Djava.library.path=${OTB_BINARY_DIR}/Code/Wrappers/SWIG${PATH_SEPARATOR}$<TARGET_FILE_DIR:otbApplicationJava>" - -cp "${CMAKE_JAVA_INCLUDE_PATH}${PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}/JavaRescaleTest.jar" - RescaleTest - ${INPUTDATA}/poupees.tif - ${TEMP}/jaTvRescaleTest.tif - 20 - 150 ) - -add_jar( JavaRescaleOutXMLTest JavaRescaleOutXMLTest.java ) -add_dependencies( JavaRescaleOutXMLTest org_otb_Application_jar ) -add_dependencies( OTBSWIGWrapper-all JavaRescaleOutXMLTest ) -add_test( NAME jaTvRescaleOutXML - COMMAND ${TEST_DRIVER} Execute - ${Java_JAVA_EXECUTABLE} - "-Djava.library.path=${OTB_BINARY_DIR}/Code/Wrappers/SWIG${PATH_SEPARATOR}$<TARGET_FILE_DIR:otbApplicationJava>" - -cp "${CMAKE_JAVA_INCLUDE_PATH}${PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}/JavaRescaleOutXMLTest.jar" - RescaleOutXMLTest - ${INPUTDATA}/poupees.tif - ${TEMP}/jaTvRescaleOutXMLTest.tif - 20 - 150 - ${TEMP}/jaTvRescaleOutXMLTest.xml ) - -add_jar( JavaRescaleInXMLTest JavaRescaleInXMLTest.java ) -add_dependencies( JavaRescaleInXMLTest org_otb_Application_jar ) -add_dependencies( OTBSWIGWrapper-all JavaRescaleInXMLTest ) -add_test( NAME jaTvRescaleInXML - COMMAND ${TEST_DRIVER} Execute - ${Java_JAVA_EXECUTABLE} - "-Djava.library.path=${OTB_BINARY_DIR}/Code/Wrappers/SWIG${PATH_SEPARATOR}$<TARGET_FILE_DIR:otbApplicationJava>" - -cp "${CMAKE_JAVA_INCLUDE_PATH}${PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}/JavaRescaleInXMLTest.jar" - RescaleInXMLTest - ${INPUTDATA}/jaTvRescaleInXMLTest.xml - ${INPUTDATA}/poupees.tif - ${TEMP}/jaTvRescaleInXMLTest.tif) diff --git a/Modules/Wrappers/SWIG/test/java/JavaRescaleInXMLTest.java b/Modules/Wrappers/SWIG/test/java/JavaRescaleInXMLTest.java deleted file mode 100644 index bfef2f5ad3774efa3805f04225507714b40a8e73..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/test/java/JavaRescaleInXMLTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -/* - * Example on the use of the Rescale with inxml - */ - -import java.lang.Float; -import org.otb.application.*; - -class RescaleInXMLTest { - - public static void main( String argv[] ) { - - Application app = Registry.CreateApplication("Rescale"); - - app.SetParameterString("inxml", argv[0]); - app.UpdateParameters(); - - app.SetParameterString("in", argv[1]); - app.SetParameterString("out", argv[2]); - - int result = app.ExecuteAndWriteOutput(); - - System.exit( result ); - } - -} diff --git a/Modules/Wrappers/SWIG/test/java/JavaRescaleOutXMLTest.java b/Modules/Wrappers/SWIG/test/java/JavaRescaleOutXMLTest.java deleted file mode 100644 index a79e3590c33f2ca5d3c94553ed70d41c137f39b3..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/test/java/JavaRescaleOutXMLTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -/* - * Example on the use of the Rescale with outxml - */ - -import java.lang.Float; -import org.otb.application.*; - -class RescaleOutXMLTest { - - public static void main( String argv[] ) { - - Application app = Registry.CreateApplication("Rescale"); - app.SetParameterString("in", argv[0], true); - app.SetParameterString("out", argv[1], true); - app.SetParameterFloat ("outmin", Float.valueOf(argv[2]).floatValue(), true); - app.SetParameterFloat ("outmax", Float.valueOf(argv[3]).floatValue(), true); - app.SetParameterString("outxml", argv[4]); - int result = app.ExecuteAndWriteOutput(); - - System.exit( result ); - } - -} diff --git a/Modules/Wrappers/SWIG/test/java/JavaRescaleTest.java b/Modules/Wrappers/SWIG/test/java/JavaRescaleTest.java deleted file mode 100644 index 3a56893ccd9493db03f4437091036c3d3cfe4996..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/test/java/JavaRescaleTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -/* - * Example on the use of the Rescale - */ - -import java.lang.Float; -import org.otb.application.*; - -class RescaleTest { - - public static void main( String argv[] ) { - - String[] appAvailable = Registry.GetAvailableApplications(); - System.out.println( "Available applications :" ); - - for (int i = 0; i < appAvailable.length; i++) - { - System.out.println( " " + appAvailable[i] ); - } - System.out.println(); - - System.out.println( "Creating application " + "Rescale"); - Application app = Registry.CreateApplication("Rescale"); - System.out.println( "Created application Rescale"); - System.out.println( "Rescale doc : " + app.GetDescription() ); - - String[] paramlist = app.GetParametersKeys(); - System.out.println( ); - System.out.println( "Rescale parameters : " ); - for (int i = 0; i < paramlist.length; i++) - { - System.out.println( " " + paramlist[i] ); - } - System.out.println(); - - app.SetParameterString("in", argv[0]); - app.SetParameterString("out", argv[1]); - app.SetParameterFloat ("outmin", Float.valueOf(argv[2]).floatValue() ); - app.SetParameterFloat ("outmax", Float.valueOf(argv[3]).floatValue() ); - - int result = app.ExecuteAndWriteOutput(); - - System.exit( result ); - } - -} diff --git a/Modules/Wrappers/SWIG/test/java/JavaSmoothingTest.java b/Modules/Wrappers/SWIG/test/java/JavaSmoothingTest.java deleted file mode 100644 index 6fe47ed94de3c458a78874b120e3532e42597da5..0000000000000000000000000000000000000000 --- a/Modules/Wrappers/SWIG/test/java/JavaSmoothingTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2005-2019 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. - */ - -/* - * Example on the use of the Smoothing - */ - -import org.otb.application.*; - - -class SmoothingTest { - - public static void main( String argv[] ) { - - String[] appAvailable = Registry.GetAvailableApplications(); - System.out.println( "Available applications :" ); - - for (int i = 0; i < appAvailable.length; i++) - { - System.out.println( appAvailable[i] ); - } - - System.out.println( "Creating application " + "Smoothing"); - Application app = Registry.CreateApplication("Smoothing"); - - System.out.println( Registry.CreateApplication("Smoothing").GetDescription() ); - - } - -} diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt index 698edc7321baa9eab96003aa917a0c7c8f26e185..ca735ac2a31163959094441a3163fc86f3f2a9d3 100644 --- a/Packaging/CMakeLists.txt +++ b/Packaging/CMakeLists.txt @@ -178,11 +178,6 @@ if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/python/_otbApplication${PYMODULE_EX set(HAVE_PYTHON 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") diff --git a/SuperBuild/CMake/External_swig.cmake b/SuperBuild/CMake/External_swig.cmake index ce8f49a3360c34b6874991be4beaa755b19e9f21..6cc55d22bbfbc1cdb5f026229f993921a63a329e 100644 --- a/SuperBuild/CMake/External_swig.cmake +++ b/SuperBuild/CMake/External_swig.cmake @@ -29,14 +29,6 @@ else() message(WARNING " No suitable python interpreter was found !") endif() -find_package(Java) -if(JAVA_FOUND) - set(SWIG_SB_JAVA_CONFIG "--with-java=${Java_JAVA_EXECUTABLE}") -else() - set(SWIG_SB_JAVA_CONFIG) - message(WARNING " No Java executable was found !") -endif() - if(MSVC) # Use pre-built swig executable (no linking is required, no install done) ExternalProject_Add(SWIG @@ -69,7 +61,6 @@ else() ${SWIG_SB_BUILD_DIR}/configure --prefix=${SB_INSTALL_PREFIX} ${SWIG_SB_PYTHON_CONFIG} - ${SWIG_SB_JAVA_CONFIG} ${SWIG_SB_CONFIG} BUILD_COMMAND $(MAKE) INSTALL_COMMAND $(MAKE) install