diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 65def7b43acea7e9e88f650bfbb992e32c8433cf..667b51655dd58000fbecf75e03c608901a9f93a9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -44,6 +44,7 @@ fast-build:
     - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
     - ccache -s
 
+
 .common-build:
   extends: .general
   only: [merge_requests]
@@ -56,6 +57,12 @@ fast-build:
     - git checkout -f -q $CI_COMMIT_SHA
   after_script:
     - python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH $CI_MERGE_REQUEST_REF_PATH
+  artifacts:
+    when: on_failure
+    expire_in: 24 hrs
+    paths:
+      - build/*/*.log #CMake log
+      - log/*.txt # Others
 
 debian-build:
   extends: .common-build
@@ -87,34 +94,62 @@ ubuntu-llvm:
     expire_in: 24 hrs
     when: always
     paths:
-      - sb_branch.txt
-      # This recovers logs from superbuild build
-      - build/*/*/*/*.log
+      - sb_branch.txt # Needed to checkout correct branch in build step
+      - build/*/*/*/*.log # Superbuild log
 
+## Ubuntu superbuild
 ubuntu-superbuild-prepare:
   extends: .common-prepare
   image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
   script:
     - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
 
-centos-superbuild-prepare:
-  extends: .common-prepare
-  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
-  script:
-    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
-
 ubuntu-superbuild-build:
   extends: .common-build
   image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
   script:
     - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
+    - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
   dependencies:
     - ubuntu-superbuild-prepare
 
+## CentOS superbuild
+centos-superbuild-prepare:
+  extends: .common-prepare
+  image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
+  script:
+    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
+
 centos-superbuild-build:
   extends: .common-build
   image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
   script:
     - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
+    - xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
   dependencies:
     - centos-superbuild-prepare
+
+## MacOS superbuild
+macos-superbuild-prepare:
+  tags:
+    - macos
+  extends: .common-prepare
+  before_script:
+    # No need to install lfs as this machine is persistent
+    # No need to do git config
+    # Checkout the expected branch
+    - export GIT_LFS_SKIP_SMUDGE=1
+    - git checkout -f -q $CI_COMMIT_SHA
+    - export GIT_LFS_SKIP_SMUDGE=0
+  script:
+    - ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
+
+macos-superbuild-build:
+  tags:
+    - macos
+  extends: .common-build
+  script:
+    - ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
+    - ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
+  dependencies:
+    - macos-superbuild-prepare
diff --git a/CI/configure_options.cmake b/CI/configure_options.cmake
index 861e24eeccea3d816cdb31da419ef6fda03459af..844c2d1b743252ad1f44426d569ac7062edcda39 100644
--- a/CI/configure_options.cmake
+++ b/CI/configure_options.cmake
@@ -38,7 +38,7 @@ OTB_USE_GLEW:BOOL=ON
 OTB_USE_GLFW:BOOL=ON
 OTB_USE_GLUT:BOOL=ON
 OTB_USE_GSL:BOOL=ON
-OTB_USE_LIBKML:BOOL=ON
+OTB_USE_LIBKML:BOOL=OFF
 OTB_USE_LIBSVM:BOOL=ON
 OTB_USE_MPI:BOOL=OFF
 OTB_USE_MUPARSER:BOOL=ON
diff --git a/CI/main_packages.cmake b/CI/main_packages.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..cb2d8c1175de8397ccd9c562a4d8cc6d356c5768
--- /dev/null
+++ b/CI/main_packages.cmake
@@ -0,0 +1,110 @@
+#
+# 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.
+#
+# We are included from main_superbuild.cmake
+# This script is a prototype for the future CI, it may evolve rapidly in a near future
+
+include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
+
+set (ENV{LANG} "C") # Only ascii output
+
+get_filename_component( OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY )
+
+set ( DEBUG "1" )
+
+set ( CTEST_BUILD_CONFIGURATION "Release" )
+set ( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
+set ( CTEST_BUILD_FLAGS "-j1" )
+set ( CTEST_BUILD_NAME "Packages" )
+set ( CTEST_SITE "${IMAGE_NAME}" )
+
+# Find the build name and CI profile
+set_dash_build_name()
+
+# Directory variable
+set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}/Packaging" )
+set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build_packages/" )
+set ( CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install_packages" )
+set ( PROJECT_SOURCE_DIR "${CTEST_SOURCE_DIRECTORY}" )
+
+# Copy back xdk for RUN_PATH reason
+# We might want to change the name of artifact in main_superbuild
+# file ( COPY "${OTB_SOURCE_DIR}/install/xdk" DESTINATION "${CI_ROOT_DIR}")
+# Packages case:
+# SUPERBUILD_BINARY_DIR this is needed for OTB_BINARY_DIR, not sure we need it
+# SUPERBUILD_INSTALL_DIR do we need it? it seems so... We will set it to anything
+# DOWNLOAD_LOCATION
+# OTB_BINARY_DIR
+# CMAKE_INSTALL_PREFIX
+set ( CONFIGURE_OPTIONS
+"-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIRECTORY};\
+-DOTB_BINARY_DIR=${OTB_SOURCE_DIR}/build;\
+-DSUPERBUILD_INSTALL_DIR=${OTB_SOURCE_DIR}/xdk;\
+-DSUPERBUILD_BINARY_DIR=${OTB_SOURCE_DIR}/build;" )
+
+# Look for a GIT command-line client.
+find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
+
+# Sources are already checked out : do nothing for update
+set(CTEST_GIT_UPDATE_CUSTOM echo No update)
+
+
+ctest_start( Experimental TRACK CI_Package )
+
+ctest_update( SOURCE "${OTB_SOURCE_DIR}" )
+
+
+ctest_configure(
+  BUILD "${CTEST_BINARY_DIRECTORY}"
+  SOURCE "${CTEST_SOURCE_DIRECTORY}"
+  OPTIONS "${CONFIGURE_OPTIONS}"
+  RETURN_VALUE _configure_rv
+  CAPTURE_CMAKE_ERROR _configure_error
+  )
+
+if( NOT _configure_rv EQUAL 0 )
+  ctest_submit()
+  message( SEND_ERROR "An error occurs during ctest_configure.")
+  return()
+endif()
+
+
+ctest_build(
+  BUILD "${CTEST_BINARY_DIRECTORY}"
+  TARGET PACKAGE-OTB
+  RETURN_VALUE _build_rv
+  CAPTURE_CMAKE_ERROR _build_error
+  )
+
+if( NOT _build_rv EQUAL 0 )
+  message( SEND_ERROR "An error occurs during ctest_build.")
+endif()
+
+
+ctest_test(
+  PARALLEL_LEVEL 1
+  RETURN_VALUE _test_rv
+  CAPTURE_CMAKE_ERROR _test_error
+  )
+
+if( NOT _test_rv EQUAL 0 )
+  message( SEND_ERROR "An error occurs during ctest_test.")
+endif()
+
+ctest_submit()
diff --git a/CI/main_superbuild.cmake b/CI/main_superbuild.cmake
index f0cdf59053159554084cc9f2c147bca392dc2e06..383e501311393ab761b7b74223ad51340e6b1317 100644
--- a/CI/main_superbuild.cmake
+++ b/CI/main_superbuild.cmake
@@ -24,6 +24,7 @@ include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
 set (ENV{LANG} "C") # Only ascii output
 get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
 
+set ( DEBUG "1" )
 ###########################################################################
 ###########################################################################
 # Download xkd
@@ -69,6 +70,12 @@ endif()
 
 if (clone_res)
   message( SEND_ERROR "Problem in retreiving the archive")
+  message( "Command : COMMAND ${GIT} clone ${REMOTE} --branch ${BRANCH_NAME} \
+    --depth 1 superbuild-artifact")
+  message( "Result :")
+  message( "clone_res = ${clone_res}" )
+  message( "clone_out = ${clone_out}" )
+  message( "clone_err = ${clone_err}" )
   return()
 endif()
 
@@ -76,9 +83,19 @@ set (CMAKE_COMMAND "cmake")
 execute_process(
   COMMAND ${CMAKE_COMMAND} "-E" "tar" "xf"
   "${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar"
+  RESULT_VARIABLE tar_res
+  OUTPUT_VARIABLE tar_out
+  ERROR_VARIABLE tar_err
   WORKING_DIRECTORY ${OTB_SOURCE_DIR}
   )
 
+if ( DEBUG )
+  message( "${CMAKE_COMMAND} -E tar xf ${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar")
+  message( "tar_res: '${clone_res}'" )
+  message( "tar_out: '${tar_out}'" )
+  message( "tar_err: '${tar_err}'" )
+endif()
+
 set( XDK_PATH "${OTB_SOURCE_DIR}/xdk")
 
 if ( DEBUG )
@@ -107,19 +124,24 @@ set_dash_build_name()
 # Directory variable
 set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}" )
 set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/" )
-set ( CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/" )
+# install in same directory as xdk to be able to produce
+# package afterwards
+set ( CTEST_INSTALL_DIRECTORY "${XDK_PATH}" )
 set ( PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}" )
 
 set (CONFIGURE_OPTIONS  "")
 include ( "${CMAKE_CURRENT_LIST_DIR}/configure_options.cmake" )
+
+# For superbuild we need remote module 
+foreach(remote_module DiapOTBModule OTBTemporalGapFilling)#otbGRM #Mosaic # #SertitObject
+    set ( CONFIGURE_OPTIONS 
+      "${CONFIGURE_OPTIONS}-DModule_${remote_module}:BOOL=ON;")
+endforeach()
+
 # SuperBuild case : one more configure option
 set ( CONFIGURE_OPTIONS
   "${CONFIGURE_OPTIONS}-DCMAKE_PREFIX_PATH=${XDK_PATH};")
 
-# Hack because there is no more superbuild available (LIBKML)
-set ( CONFIGURE_OPTIONS
-  "${CONFIGURE_OPTIONS}-DOTB_USE_LIBKML:BOOL=OFF;" )
-
 # FIX ME this part might platform dependent
 set( GDAL_DATA "${XDK_PATH}/share/gdal" )
 set( GEOTIFF_CSV "${XDK_PATH}/share/epsg_csv" )
@@ -145,6 +167,11 @@ ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
     RETURN_VALUE _configure_rv
     CAPTURE_CMAKE_ERROR _configure_error
     )
+# Configure log
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/configure_return_value_log.txt" "${_configure_rv}")
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/configure_cmake_error_log.txt" "${_configure_error}")
 
 if ( NOT _configure_rv EQUAL 0 )
   ctest_submit()
@@ -156,6 +183,14 @@ ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
             CAPTURE_CMAKE_ERROR _build_error
             )
 
+# Build log
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/build_return_value_log.txt" "${_build_rv}")
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/build_cmake_error_log.txt" "${_build_error}")
+
+# SEND_ERROR if build error
+# FATAL_ERROR if build error?
 if ( NOT _build_rv EQUAL 0 )
   message( SEND_ERROR "An error occurs during ctest_build.")
 endif()
@@ -166,8 +201,41 @@ ctest_test(PARALLEL_LEVEL 8
            CAPTURE_CMAKE_ERROR _test_error
            )
 
+# Test log
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/test_return_value_log.txt" "${_test_rv}")
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/test_cmake_error_log.txt" "${_test_error}")
+
 if ( NOT _test_rv EQUAL 0 )
   message( WARNING "Some tests have failed.")
 endif()
 
 ctest_submit()
+
+# We need to install OTB for package purposes
+set ( MAKE_COMMAND "make")
+execute_process(
+  COMMAND ${MAKE_COMMAND} "install"
+  WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
+  RESULT_VARIABLE install_rv
+  OUTPUT_VARIABLE install_out
+  ERROR_VARIABLE install_err
+  )
+
+if ( DEBUG )
+  message( "Install output")
+  message( "install_res = ${install_res}" )
+  message( "install_out = ${install_out}" )
+  message( "install_err = ${install_err}" )
+endif()
+
+# Install log
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/install_out_log.txt" "${install_out}")
+file ( WRITE 
+  "${OTB_SOURCE_DIR}/log/install_error_log.txt" "${install_err}")
+
+if ( NOT install_rv EQUAL 0 )
+  message( SEND_ERROR "Install have failed.")
+endif()
diff --git a/CI/otb-macos-superbuild.cmake b/CI/otb-macos-superbuild.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..2435ba3840bb3f559c375c06f4133feae4b3af19
--- /dev/null
+++ b/CI/otb-macos-superbuild.cmake
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+
+# Configuration options for macOS
+
+set(site_option
+"OTB_USE_GLUT=OFF
+OTB_USE_GLFW=OFF")
\ No newline at end of file
diff --git a/CI/prepare_superbuild.cmake b/CI/prepare_superbuild.cmake
index 1351510e2a7f759e6861a2dc84515a65f39ceeea..c77c73b17de7e1779f8a763ad15fd87a20e60081 100644
--- a/CI/prepare_superbuild.cmake
+++ b/CI/prepare_superbuild.cmake
@@ -152,7 +152,6 @@ if ( DEBUG )
 endif()
 
 if ( ( NOT ${_build_nb_err} EQUAL 0 ) OR ( ${_build_error} EQUAL -1 ))
-  ctest_submit()
   message( FATAL_ERROR "An error occurs during ctest_build.")
 endif()
 
@@ -287,4 +286,4 @@ if ( DEBUG )
   message( "push_res = ${push_res}" )
   message( "push_out = ${push_out}" )
   message( "push_err = ${push_err}" )
-endif()
+endif()
\ No newline at end of file
diff --git a/Data/Baseline/OTB/Images/apTvMosaicTestLargeFeathering.tif b/Data/Baseline/OTB/Images/apTvMosaicTestLargeFeathering.tif
new file mode 100644
index 0000000000000000000000000000000000000000..4e2583671856ffda730f2e79e48ceb3877c80308
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvMosaicTestLargeFeathering.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b36b238c88479b780f314f8c4ed4c1bbb4316a5944435213462486f416a269f0
+size 354611
diff --git a/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithCutline.tif b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithCutline.tif
new file mode 100644
index 0000000000000000000000000000000000000000..ba9b748b56babf7f902a0f874899732ca8505654
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithCutline.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c79bcd11a570bdad9218c1c7049d7d9285aad6bbc81caca415edf7ff9eb10896
+size 350966
diff --git a/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithHarmoBandRmse.tif b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithHarmoBandRmse.tif
new file mode 100644
index 0000000000000000000000000000000000000000..39ad71cb173ac7032f2b3f1cd4c6a008f078167a
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithHarmoBandRmse.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10f03362b16ee03717bb3d824be60b6ec956b97cabcf9989132e758022b9443b
+size 337536
diff --git a/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithHarmoRgbRmse.tif b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithHarmoRgbRmse.tif
new file mode 100644
index 0000000000000000000000000000000000000000..b9aa964a4c4ff8d612d10a41a7a5fb689272b42e
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithHarmoRgbRmse.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e05efa1858c74e5af54da3fbf35add9b613eb3c9a9d5640caa42611e865ae476
+size 299039
diff --git a/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithVdstats.tif b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithVdstats.tif
new file mode 100644
index 0000000000000000000000000000000000000000..dc4a625a824387d51c079ca8b18d778ed56bc5e7
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvMosaicTestSimpleWithVdstats.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:915af6bce970c205af88b6b36f8a8f58fed2172cb60b61fa37a90281d9ede0f9
+size 355309
diff --git a/Data/Baseline/OTB/Images/apTvMosaicTestSlimFeathering.tif b/Data/Baseline/OTB/Images/apTvMosaicTestSlimFeathering.tif
new file mode 100644
index 0000000000000000000000000000000000000000..2ec8b4fd94c3f12bd078acc0532dbaaae9f9bfa4
--- /dev/null
+++ b/Data/Baseline/OTB/Images/apTvMosaicTestSlimFeathering.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:348b058d7909005bf7e27a7f9a1d24b59f98831d114c2993786fc6e0992460a5
+size 363380
diff --git a/Data/Input/QB_Toulouse_Ortho_XS_6class_knn.tif b/Data/Input/QB_Toulouse_Ortho_XS_6class_knn.tif
new file mode 100644
index 0000000000000000000000000000000000000000..893152ee793a672205b2bfee87bf4cfdc6908092
--- /dev/null
+++ b/Data/Input/QB_Toulouse_Ortho_XS_6class_knn.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1cfb1bfa7918959d99cc34522595df94a63dd8b050a5474a5300f7e2ad8508a8
+size 27963
diff --git a/Data/Input/SP67_FR_subset_1.tif b/Data/Input/SP67_FR_subset_1.tif
new file mode 100644
index 0000000000000000000000000000000000000000..e7ec284c1e248c19e6214f6ff2707488877c478d
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_1.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:32e598fe0eca23e176de5158ffe017e4c2d62652201c2af906f1630c7ce95a06
+size 225542
diff --git a/Data/Input/SP67_FR_subset_1_cutline.dbf b/Data/Input/SP67_FR_subset_1_cutline.dbf
new file mode 100644
index 0000000000000000000000000000000000000000..000dc006e9ea0ecf0c8c5cd6d205436710c0aaa4
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_1_cutline.dbf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c50b18b1acf44ffefdbb9af3c65bafc4b87f0a8ea22adcea80b191c9d7def31
+size 76
diff --git a/Data/Input/SP67_FR_subset_1_cutline.prj b/Data/Input/SP67_FR_subset_1_cutline.prj
new file mode 100644
index 0000000000000000000000000000000000000000..5adb2a9108a4bd847464a2c506a40c8d199faa69
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_1_cutline.prj
@@ -0,0 +1 @@
+PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]
\ No newline at end of file
diff --git a/Data/Input/SP67_FR_subset_1_cutline.qpj b/Data/Input/SP67_FR_subset_1_cutline.qpj
new file mode 100644
index 0000000000000000000000000000000000000000..52a60bf44d9f6d1ad3e986837ac8859cf97d222f
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_1_cutline.qpj
@@ -0,0 +1 @@
+PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2154"]]
diff --git a/Data/Input/SP67_FR_subset_1_cutline.shp b/Data/Input/SP67_FR_subset_1_cutline.shp
new file mode 100644
index 0000000000000000000000000000000000000000..ce3ff833f1915e5461fd2225de74afc56fdbc46a
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_1_cutline.shp
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:198e7f18e031e3c78b4490d7bd7b85852c0d91a30ee8020b0eae1da0b153c2f8
+size 284
diff --git a/Data/Input/SP67_FR_subset_1_cutline.shx b/Data/Input/SP67_FR_subset_1_cutline.shx
new file mode 100644
index 0000000000000000000000000000000000000000..de7e9a8b6feda82d574ac0a01167be1b48f2f72c
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_1_cutline.shx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:41c1ff4d4f0126203df085ca9db0f887627872545ac0bb2df04d4f704fd1a11d
+size 108
diff --git a/Data/Input/SP67_FR_subset_2.tif b/Data/Input/SP67_FR_subset_2.tif
new file mode 100644
index 0000000000000000000000000000000000000000..f0c0d1d31952a911cc81fb3ece8ce807e96faef0
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_2.tif
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:99c69ca5c414e0fafea378323574490e4b59d8b4b59b2b7cedc1fc654b4e1a3c
+size 208724
diff --git a/Data/Input/SP67_FR_subset_2_cutline.dbf b/Data/Input/SP67_FR_subset_2_cutline.dbf
new file mode 100644
index 0000000000000000000000000000000000000000..000dc006e9ea0ecf0c8c5cd6d205436710c0aaa4
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_2_cutline.dbf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1c50b18b1acf44ffefdbb9af3c65bafc4b87f0a8ea22adcea80b191c9d7def31
+size 76
diff --git a/Data/Input/SP67_FR_subset_2_cutline.prj b/Data/Input/SP67_FR_subset_2_cutline.prj
new file mode 100644
index 0000000000000000000000000000000000000000..5adb2a9108a4bd847464a2c506a40c8d199faa69
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_2_cutline.prj
@@ -0,0 +1 @@
+PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]
\ No newline at end of file
diff --git a/Data/Input/SP67_FR_subset_2_cutline.qpj b/Data/Input/SP67_FR_subset_2_cutline.qpj
new file mode 100644
index 0000000000000000000000000000000000000000..52a60bf44d9f6d1ad3e986837ac8859cf97d222f
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_2_cutline.qpj
@@ -0,0 +1 @@
+PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2154"]]
diff --git a/Data/Input/SP67_FR_subset_2_cutline.shp b/Data/Input/SP67_FR_subset_2_cutline.shp
new file mode 100644
index 0000000000000000000000000000000000000000..9ec1f8af83f862350572fadcbd70329c42affeab
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_2_cutline.shp
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1ddd1bd6d919e1fbfbf16088633fd85ccbb81bf6fec838ed72846509959f7554
+size 300
diff --git a/Data/Input/SP67_FR_subset_2_cutline.shx b/Data/Input/SP67_FR_subset_2_cutline.shx
new file mode 100644
index 0000000000000000000000000000000000000000..6ab9a05d86790cd9d50c5f115bd4600d37ebb58d
--- /dev/null
+++ b/Data/Input/SP67_FR_subset_2_cutline.shx
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f45c7a45e92794789a7d56f0c1f5d8eeca690ea0ed9da34f568fe92ae783076
+size 108
diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt
index 18b1b9fc8b6526fc428792bf663d1a974a771ee9..65c599be710007be908128ab79bad5b21f09b85d 100644
--- a/Packaging/CMakeLists.txt
+++ b/Packaging/CMakeLists.txt
@@ -39,8 +39,11 @@ set(SUPERBUILD_BINARY_DIR "" CACHE PATH "path to superbuild binary directory")
 set(SUPERBUILD_INSTALL_DIR "" CACHE PATH "path to superbuild install directory")
 set(DOWNLOAD_LOCATION "" CACHE PATH "path to superbuild download archives")
 
-#variables based on above user-defined variables 
-set(OTB_BINARY_DIR            "${SUPERBUILD_BINARY_DIR}/OTB/build")
+#variables based on above user-defined variables
+message( "OTB_BINARY_DIR=${OTB_BINARY_DIR}" )
+if ( NOT OTB_BINARY_DIR )
+  set(OTB_BINARY_DIR            "${SUPERBUILD_BINARY_DIR}/OTB/build")
+endif()
 set(QT_TRANSLATIONS_DIR       "${SUPERBUILD_INSTALL_DIR}/translations")
 get_filename_component(PACKAGE_OTB_SRC_DIR ${OTBPackaging_SOURCE_DIR} PATH)
 set(SUPERBUILD_SOURCE_DIR     "${PACKAGE_OTB_SRC_DIR}/SuperBuild")
@@ -55,8 +58,9 @@ find_program(FILE_COMMAND NAMES  "file")
 find_program(READLINK NAMES "readlink")
 find_program(ZIP_EXECUTABLE NAMES 7z 7za)
 
-#install prefix is same as SUPERBUILD_INSTALL_DIR. could be changed later
-set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
+if ( NOT CMAKE_INSTALL_PREFIX )
+  set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
+endif()
 
 #set CMAKE_MODULE_PATH to be the current source directory.
 # This will allow including all cmake files without full path and .cmake extension!
@@ -200,8 +204,6 @@ install_importlibs()
 
 install_python_bindings()
 
-install_java_bindings()
-
 install_share_dirs()
 
 install_cmake_files()
diff --git a/Packaging/Files/build_examples.cmake b/Packaging/Files/build_examples.cmake
index f6aa55ecd134e369e96422dfebf6fcfaa9af8310..bb84429550886bf1ee6838c6b4ae08a3c7aab4dc 100644
--- a/Packaging/Files/build_examples.cmake
+++ b/Packaging/Files/build_examples.cmake
@@ -40,6 +40,8 @@ if(WIN32)
   set(cmake_gen "-GNinja")
 endif()
 
+message( "CMAKE_PREFIX_PATH: '${CMAKE_PREFIX_PATH}'" )
+
 execute_process(
   COMMAND ${CMAKE_COMMAND}
   -DCMAKE_INSTALL_PREFIX=${PKG_DIR}
@@ -93,5 +95,5 @@ if( build_Pipeline_rv )
   message(FATAL_ERROR "Build FAILED. build_Pipeline_ov=${build_Pipeline_ov}")
   return()
 else()
-  message("Build PASSED. build_Pipeline_ov=${build_Pipeline_ov}")  
+  message("Build PASSED. build_Pipeline_ov=${build_Pipeline_ov}")
 endif()
diff --git a/Packaging/Files/uninstall_otb.bat b/Packaging/Files/uninstall_otb.bat
index cc112505c175279155b5af2e31e3752ef4aab84e..6ca7b67208f0e6c65e93bcf5aa1222902d784bee 100644
--- a/Packaging/Files/uninstall_otb.bat
+++ b/Packaging/Files/uninstall_otb.bat
@@ -37,7 +37,6 @@ rd /S /Q lib\otb
 
 del /S /Q lib\otb*
 del /S /Q lib\python\*otbApplication.* || exit 1
-del /S /Q lib\java\org.otb.application.jar || exit 1
 del /S /Q bin\otb* || exit 1
 del /S /Q bin\monteverdi.exe || exit 1
 del /S /Q bin\mapla.exe || exit 1
diff --git a/Packaging/Files/uninstall_otb.sh b/Packaging/Files/uninstall_otb.sh
index d160333f402a31c77aa287c73b431ae182253214..be82c406e62579dda350c69333466a064fbd30cd 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*,java/org.otb.application.jar}
+rm -fr OUT_DIR/lib/{otb,python/*otbApplication*}
 rm -fr OUT_DIR/lib/cmake/OTB-*
 rm -fr OUT_DIR/share/otb/
 rm -fv OUT_DIR/bin/{otb*,monteverdi,mapla}
diff --git a/Packaging/detect_using_file_command.cmake b/Packaging/detect_using_file_command.cmake
index 20ede7609299e30651f910367d91ef4a1d1520ae..c22b1f02452bb2184ed859df87dc99797e9c8cce 100644
--- a/Packaging/detect_using_file_command.cmake
+++ b/Packaging/detect_using_file_command.cmake
@@ -18,7 +18,7 @@
 # limitations under the License.
 #
 function(detect_using_file_command input_file result_type result_dir)
-  
+
   execute_process(COMMAND "${FILE_COMMAND}" "${input_file}"
     RESULT_VARIABLE file_rv
     OUTPUT_VARIABLE file_ov
@@ -29,10 +29,17 @@ function(detect_using_file_command input_file result_type result_dir)
     message(FATAL_ERROR "${FILE_COMMAND} failed: ${file_rv}\n${file_ev}\n${file_ov}")
   endif()
 
+  # message( "file_ov: '${file_ov}'" )
+
   get_filename_component(input_file_NAME ${input_file} NAME)
   string(REPLACE "${input_file}" " _file_full_ " file_ov "${file_ov}")
   string(TOLOWER "${file_ov}" file_ov_lower)
 
+  # message( "input_file: '${input_file}'" )
+  # message( "input_file_NAME: '${input_file_NAME}'" )
+  # message( "file_ov: '${file_ov}'" )
+  # message( "file_ov_lower: '${file_ov_lower}'" )
+
   set(detected_type)
   set(detected_dir)
   # below executable check works for both mac osx and linux
@@ -85,9 +92,9 @@ function(detect_using_file_command input_file result_type result_dir)
 
     set(is_this_a_symbolic_link FALSE)
     set(target_file)
-    isfile_symlink("${input_file}" is_this_a_symbolic_link target_file)    
+    isfile_symlink("${input_file}" is_this_a_symbolic_link target_file)
     if(is_this_a_symbolic_link)
-      
+
       if(target_file)
 	set(libdir "lib")
 	setif_value_in_list(is_gtk_lib "${input_file_NAME}" GTK_LIB_LIST_1)
@@ -105,6 +112,18 @@ function(detect_using_file_command input_file result_type result_dir)
     message(FATAL_ERROR "unknown/untracked file type found: ${input_file}")
   endif() #if("${file_ov_lower}" MATCHES ...)
 
+  # Patch file command returning shared-oject for executable on Linux when -PIE is used.
+  if( LINUX )
+    get_filename_component( input_file_DIR ${input_file} DIRECTORY )
+    get_filename_component( input_file_dIR ${input_file_DIR} NAME )
+    string( TOLOWER "${input_file_DIR}" input_file_DIR )
+    if( ${input_file_DIR} MATCHES "bin" )
+      message( WARNING "${input_file} detected as shared-object." )
+      set(detected_type PROGRAMS)
+      set(detected_dir bin)
+    endif()
+  endif()
+
   #message("detected_type=${detected_type}")
   set(${result_type} "${detected_type}" PARENT_SCOPE)
   set(${result_dir} "${detected_dir}" PARENT_SCOPE)
diff --git a/Packaging/install_cmake_files.cmake b/Packaging/install_cmake_files.cmake
index 11d14dd4b1428df58a1969f777c3689d6f71394c..c890e19a19bddfc0960e031c80e94fada14f9627 100644
--- a/Packaging/install_cmake_files.cmake
+++ b/Packaging/install_cmake_files.cmake
@@ -22,13 +22,13 @@ include(patch_cmake_files.cmake)
 function(install_cmake_files)
  patch_cmake_files(NAME "ITK"
    VERSION "${PKG_ITK_SB_VERSION}"
-   MATCH_STRING  "${CMAKE_INSTALL_PREFIX}"
+   MATCH_STRING  "${SUPERBUILD_INSTALL_DIR}"
    REPLACE_VAR "ITK_INSTALL_PREFIX"
    )
  
  patch_cmake_files(NAME "OTB"
    VERSION "${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}"
-   MATCH_STRING  "${CMAKE_INSTALL_PREFIX}"
+   MATCH_STRING  "${SUPERBUILD_INSTALL_DIR}"
    REPLACE_VAR "OTB_INSTALL_PREFIX"
    )
 
diff --git a/SuperBuild/CMake/External_gdal.cmake b/SuperBuild/CMake/External_gdal.cmake
index 618ff71265f2c7928454d17f39ad73950e4a35fd..1652dc69a5c6004b28d7233692735586a6296508 100644
--- a/SuperBuild/CMake/External_gdal.cmake
+++ b/SuperBuild/CMake/External_gdal.cmake
@@ -52,6 +52,7 @@ if(UNIX)
   #we don't do any framework build on osx. So let's be sure on case of gdal
   if(APPLE)
     list(APPEND GDAL_SB_CONFIG "--with-macosx-framework=no")
+    list(APPEND GDAL_SB_CONFIG "LDFLAGS=-headerpad_max_install_names")
   endif()
 
   # PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
diff --git a/SuperBuild/CMake/External_netcdf.cmake b/SuperBuild/CMake/External_netcdf.cmake
index bdbd109f42d2bf2654b3d0f69d4031df20618d37..a1e53d569007f0d7a346054debcce88a5fcfcc7d 100644
--- a/SuperBuild/CMake/External_netcdf.cmake
+++ b/SuperBuild/CMake/External_netcdf.cmake
@@ -36,7 +36,7 @@ endif()
 
 ExternalProject_Add(NETCDF
   PREFIX NETCDF
-  URL "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.1.tar.gz"
+  URL "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.4.1.1.tar.gz"
   URL_MD5 503a2d6b6035d116ed53b1d80c811bda
   SOURCE_DIR ${NETCDF_SB_SRC}
   BINARY_DIR ${NETCDF_SB_BUILD_DIR}
diff --git a/SuperBuild/CMake/External_otb.cmake b/SuperBuild/CMake/External_otb.cmake
index d27d88196847396ba6037414ff4f47413b09bf0a..d056b4080a759b2ac992ff5da4ed58db4f6b6e68 100644
--- a/SuperBuild/CMake/External_otb.cmake
+++ b/SuperBuild/CMake/External_otb.cmake
@@ -164,6 +164,18 @@ add_custom_command(OUTPUT otb_depends_done.txt
   DEPENDS ${OTB_DEPENDENCIES}
   )
 
+add_custom_target( EMBED_COPYRIGHT
+
+  COMMAND ${CMAKE_COMMAND} -E copy
+  ${OTB_SB_SRC}/LICENSE ${CMAKE_INSTALL_PREFIX}/share/copyright/LICENSE
+
+  COMMAND ${CMAKE_COMMAND} -E copy
+  ${OTB_SB_SRC}/NOTICE ${CMAKE_INSTALL_PREFIX}/share/copyright/NOTICE
+
+  COMMAND ${CMAKE_COMMAND} -E copy_directory
+  ${CMAKE_SOURCE_DIR}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
+  )
+
 add_custom_target(OTB_DEPENDS
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/otb_depends_done.txt
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@@ -171,6 +183,9 @@ add_custom_target(OTB_DEPENDS
   VERBATIM
   )
 
+add_dependencies( OTB_DEPENDS
+  EMBED_COPYRIGHT
+  )
 
 ExternalProject_Add(OTB
   DEPENDS ${OTB_DEPENDENCIES}
@@ -219,14 +234,10 @@ ExternalProject_Add(OTB
 
 ExternalProject_Add_Step(
   OTB install_copyright
-  COMMAND ${CMAKE_COMMAND} -E copy
-  ${OTB_SB_SRC}/LICENSE ${CMAKE_INSTALL_PREFIX}/share/copyright/LICENSE
-
-  COMMAND ${CMAKE_COMMAND} -E copy
-  ${OTB_SB_SRC}/NOTICE ${CMAKE_INSTALL_PREFIX}/share/copyright/NOTICE
-
-  COMMAND ${CMAKE_COMMAND}
-  -E copy_directory
-  ${CMAKE_SOURCE_DIR}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
   DEPENDEES install
   )
+
+ExternalProject_Add_StepDependencies(
+  OTB install_copyright
+  EMBED_COPYRIGHT
+  )