Commit 7d6a4af7 authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch 'netcdf_support' into develop

parents 80639983 10415af7
......@@ -78,6 +78,8 @@ function(install_rule src_file)
continue()
elseif("${sfile_ABS_LOWER}" MATCHES "\\.la$")
continue()
elseif("${sfile_ABS_LOWER}" MATCHES "\\.settings$")
continue()
else()
if(UNIX)
#the last else() loop where we run a 'file' command to find file type and directory
......
......@@ -23,7 +23,7 @@ INCLUDE_ONCE_MACRO(GDAL)
SETUP_SUPERBUILD(GDAL)
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(GDAL CURL OPENJPEG TIFF GEOTIFF PNG JPEG SQLITE GEOS ZLIB EXPAT)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(GDAL CURL OPENJPEG TIFF GEOTIFF PNG JPEG SQLITE GEOS ZLIB EXPAT HDF5 NETCDF HDF4)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL TIFF_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL GEOTIFF_ROOT --with-geotiff)
......@@ -35,6 +35,9 @@ ADD_SUPERBUILD_CONFIGURE_VAR(GDAL ZLIB_ROOT --with-libz)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL EXPAT_ROOT --with-expat)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL CURL_ROOT --with-curl "/bin/curl-config")
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL GEOS_ROOT --with-geos "/bin/geos-config")
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL HDF5_ROOT --with-hdf5)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL NETCDF_ROOT --with-netcdf)
ADD_SUPERBUILD_CONFIGURE_VAR(GDAL HDF4_ROOT --with-hdf4)
set(GDAL_CONFIGURE_COMMAND)
set(GDAL_BUILD_COMMAND)
......@@ -71,8 +74,6 @@ if(UNIX)
--with-gif=no
--with-grass=no
--with-gta=no
--with-hdf4=no
--with-hdf5=no
--with-idb=no
--with-ingres=no
--with-jp2mrsid=no
......@@ -82,7 +83,6 @@ if(UNIX)
--with-mrsid=no
--with-msg=no
--with-mysql=no
--with-netcdf=no
--with-oci=no
--with-odbc=no
--with-ogdi=no
......
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
INCLUDE_ONCE_MACRO(HDF4)
SETUP_SUPERBUILD(HDF4)
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(HDF4 ZLIB JPEG)
set(HDF4_SB_CONFIG)
set(HDF4_SB_DF_LIB dfalt)
set(HDF4_SB_MF_LIB mfhdfalt)
ExternalProject_Add(HDF4
PREFIX HDF4
URL "http://support.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.13.tar.gz"
URL_MD5 a6aa950b3fce5162b96496d8ea0b82bf
SOURCE_DIR ${HDF4_SB_SRC}
BINARY_DIR ${HDF4_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${HDF4_DEPENDENCIES}
CMAKE_CACHE_ARGS
${SB_CMAKE_CACHE_ARGS}
-DBUILD_TESTING:BOOL=OFF
-DHDF4_ALLOW_EXTERNAL_SUPPORT:BOOL=OFF
-DHDF4_BUILD_EXAMPLES:BOOL=OFF
-DHDF4_BUILD_JAVA:BOOL=OFF
-DHDF4_BUILD_TOOLS:BOOL=OFF
-DHDF4_BUILD_UTILS:BOOL=OFF
-DHDF4_PACK_EXAMPLES:BOOL=OFF
-DHDF4_BUILD_FORTRAN:BOOL=OFF
-DHDF4_BUILD_XDR_LIB:BOOL=OFF
-DHDF4_DISABLE_COMPILER_WARNINGS:BOOL=OFF
-DHDF4_ENABLE_COVERAGE:BOOL=OFF
-DHDF4_ENABLE_DEPRECATED_SYMBOLS:BOOL=ON
-DHDF4_ENABLE_JPEG_LIB_SUPPORT:BOOL=ON
-DHDF4_ENABLE_NETCDF:BOOL=OFF
-DHDF4_ENABLE_PARALLEL:BOOL=OFF
-DHDF4_ENABLE_SZIP_SUPPORT:BOOL=OFF
-DHDF4_ENABLE_Z_LIB_SUPPORT:BOOL=ON
-DHDF4_NO_PACKAGES:BOOL=ON
-DHDF4_PACKAGE_EXTLIBS:BOOL=OFF
-DHDF_ENABLE_LARGE_FILE:BOOL=ON
-DHDF4_SRC_LIB_CORENAME:STRING=${HDF4_SB_DF_LIB}
-DHDF4_MF_LIB_CORENAME:STRING=${HDF4_SB_MF_LIB}
${HDF4_SB_CONFIG}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
SUPERBUILD_PATCH_SOURCE(HDF4)
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
INCLUDE_ONCE_MACRO(HDF5)
SETUP_SUPERBUILD(HDF5)
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(HDF5 ZLIB)
set(HDF5_SB_CONFIG)
ExternalProject_Add(HDF5
PREFIX HDF5
URL "http://support.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.10.1.tar.gz"
URL_MD5 43a2f9466702fb1db31df98ae6677f15
SOURCE_DIR ${HDF5_SB_SRC}
BINARY_DIR ${HDF5_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${HDF5_DEPENDENCIES}
CMAKE_CACHE_ARGS
${SB_CMAKE_CACHE_ARGS}
-DBUILD_TESTING:BOOL=OFF
-DHDF5_BUILD_CPP_LIB:BOOL=OFF
-DHDF5_BUILD_EXAMPLES:BOOL=ON
-DHDF5_BUILD_FORTRAN:BOOL=OFF
-DHDF5_BUILD_HL_LIB:BOOL=ON
-DHDF5_BUILD_JAVA:BOOL=OFF
-DHDF5_BUILD_TOOLS:BOOL=OFF
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
${HDF5_SB_CONFIG}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
......@@ -61,3 +61,10 @@ ExternalProject_Add(JPEG
SUPERBUILD_PATCH_SOURCE(JPEG)
SUPERBUILD_UPDATE_CMAKE_VARIABLES(JPEG FALSE)
set(_SB_JPEGLIB_H_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_JPEG_LIB ${SB_INSTALL_PREFIX}/lib/jpeg_i.lib)
elseif(UNIX)
set(_SB_JPEG_LIB ${SB_INSTALL_PREFIX}/lib/libjpeg${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
INCLUDE_ONCE_MACRO(NETCDF)
SETUP_SUPERBUILD(NETCDF)
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(NETCDF HDF5 ZLIB CURL HDF4 JPEG)
set(NETCDF_SB_CONFIG)
ExternalProject_Add(NETCDF
PREFIX NETCDF
URL "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.1.tar.gz"
URL_MD5 503a2d6b6035d116ed53b1d80c811bda
SOURCE_DIR ${NETCDF_SB_SRC}
BINARY_DIR ${NETCDF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${NETCDF_DEPENDENCIES}
CMAKE_CACHE_ARGS
${SB_CMAKE_CACHE_ARGS}
-DBUILD_TESTING:BOOL=OFF
-DENABLE_CONVERSION_WARNINGS:BOOL=ON
-DENABLE_DAP:BOOL=ON
-DENABLE_DAP_GROUPS:BOOL=ON
-DENABLE_DISKLESS:BOOL=ON
-DENABLE_DOXYGEN:BOOL=OFF
-DENABLE_DYNAMIC_LOADING:BOOL=ON
-DENABLE_EXAMPLES:BOOL=ON
-DENABLE_EXTREME_NUMBERS:BOOL=ON
-DENABLE_FFIO:BOOL=OFF
-DENABLE_FSYNC:BOOL=OFF
-DENABLE_HDF4:BOOL=ON
-DENABLE_HDF4_FILE_TESTS:BOOL=OFF
-DENABLE_JNA:BOOL=OFF
-DENABLE_LARGE_FILE_SUPPORT:BOOL=ON
-DENABLE_LOGGING:BOOL=OFF
-DENABLE_MMAP:BOOL=OFF
-DENABLE_NETCDF4:BOOL=ON
-DENABLE_NETCDF_4:BOOL=ON
-DENABLE_PARALLEL4:BOOL=OFF
-DENABLE_PNETCDF:BOOL=OFF
-DENABLE_REMOTE_FORTRAN_BOOTSTRA:BOOL=OFF
-DENABLE_RPC:BOOL=OFF
-DENABLE_STDIO:BOOL=OFF
-DENABLE_TESTS:BOOL=OFF
-DENABLE_V2_API:BOOL=ON
-DUSE_HDF5:BOOL=ON
-DUSE_NETCDF4:BOOL=ON
${NETCDF_SB_CONFIG}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
SUPERBUILD_PATCH_SOURCE(NETCDF)
......@@ -38,8 +38,8 @@ ADD_SUPERBUILD_CMAKE_VAR(OPENJPEG PNG_LIBRARY)
ExternalProject_Add(OPENJPEG
PREFIX OPENJPEG
URL "https://github.com/uclouvain/openjpeg/archive/d0babeb6f6cdd1887308137df37bb2b4724a6592.zip"
URL_MD5 e84a8cca9892a5f80ce91c1174c3fd41
URL "https://github.com/uclouvain/openjpeg/archive/v2.2.0.tar.gz"
URL_MD5 269bb0b175476f3addcc0d03bd9a97b6
BINARY_DIR ${OPENJPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
......
......@@ -39,10 +39,27 @@ set(QT4_SB_ENABLE_GTK OFF CACHE INTERNAL "Enable GTK+ style with qt using -gtkst
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(QT4 ZLIB PNG JPEG FREETYPE)
#use system libs always for Qt4 as we build them from source or have already in system
set(QT4_SB_CONFIG)
if(SB_INSTALL_PREFIX)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX} QT4_INSTALL_PREFIX_NATIVE)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/include QT4_INCLUDE_PREFIX_NATIVE)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/lib QT4_LIB_PREFIX_NATIVE)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/include/freetype2 QT4_INCLUDE_FREETYPE_NATIVE)
endif()
#Common options for all cases
set(QT4_SB_CONFIG
"-prefix ${QT4_INSTALL_PREFIX_NATIVE} -L ${QT4_LIB_PREFIX_NATIVE} \
-I ${QT4_INCLUDE_PREFIX_NATIVE} -I ${QT4_INCLUDE_FREETYPE_NATIVE} \
-opensource -confirm-license -release -shared -nomake demos \
-nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script \
-no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative \
-no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl \
-no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib")
#RK: building faling on mac. png include is in a macframework
if(USE_SYSTEM_PNG)
set(QT4_SB_CONFIG "-I ${PNG_PNG_INCLUDE_DIR}")
set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -I ${PNG_PNG_INCLUDE_DIR}")
endif()
if(UNIX)
......@@ -57,17 +74,11 @@ if(UNIX)
endif()
endif()
#common for all unix
set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-nis -no-javascript-jit -v")
set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-dbus -no-nis -no-javascript-jit -no-icu -v")
elseif(MSVC)
set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -mp")
endif()
if(SB_INSTALL_PREFIX)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX} QT4_INSTALL_PREFIX_NATIVE)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/include QT4_INCLUDE_PREFIX_NATIVE)
file(TO_NATIVE_PATH ${SB_INSTALL_PREFIX}/lib QT4_LIB_PREFIX_NATIVE)
endif()
if(WIN32)
set(QT4_BIN_EXT ".exe")
file(TO_NATIVE_PATH ${QT4_SB_SRC}/configure.exe QT4_CONFIGURE_SCRIPT)
......
......@@ -298,7 +298,9 @@ option(USE_SYSTEM_GLFW "Use a system build of glfw" OFF)
option(USE_SYSTEM_GLUT "Use a system build of glut" OFF)
option(USE_SYSTEM_FREETYPE "Use a system build of freetype" OFF)
option(USE_SYSTEM_SHARK "Use a system build of Shark" OFF)
option(USE_SYSTEM_HDF4 "Use a system build of HDF4" OFF)
option(USE_SYSTEM_HDF5 "Use a system build of HDF5" OFF)
option(USE_SYSTEM_NETCDF "Use a system build of NetCDF" OFF)
# Call OTB
option(OTB_USE_6S "Enable module 6S in OTB" ON)
......
--- GDAL-orig/frmts/hdf5/makefile.vc 2017-08-30 18:45:33.632677939 +0200
+++ GDAL/frmts/hdf5/makefile.vc 2017-08-30 18:46:05.316972947 +0200
@@ -7,7 +7,7 @@
PLUGIN_DLL = gdal_HDF5.dll
-EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -D_HDF5USEDLL_
+EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -DH5_BUILT_AS_DYNAMIC_LIB
!IF "$(HDF5_PLUGIN)" == "YES"
EXTRAFLAGS = $(EXTRAFLAGS) -DHDF5_PLUGIN
Index: gdal/configure
===================================================================
--- gdal/configure (revision 39820)
+++ gdal/configure (revision 39821)
@@ -25116,10 +25116,10 @@
elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then
- for ac_header in openjpeg-2.0/openjpeg.h
+ for ac_header in openjpeg-2.2/openjpeg.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default"
-if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.2/openjpeg.h" "ac_cv_header_openjpeg_2_2_openjpeg_h" "$ac_includes_default"
+if test "x$ac_cv_header_openjpeg_2_2_openjpeg_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENJPEG_2_0_OPENJPEG_H 1
+#define HAVE_OPENJPEG_2_2_OPENJPEG_H 1
_ACEOF
@@ -25128,5 +25128,5 @@
done
- if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ if test "$ac_cv_header_openjpeg_2_2_openjpeg_h" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_stream_set_user_data_length in -lopenjp2" >&5
$as_echo_n "checking for opj_stream_set_user_data_length in -lopenjp2... " >&6; }
@@ -25172,4 +25172,5 @@
if test "$HAVE_OPENJPEG" = "yes"; then
+ OPENJPEG_VERSION=20200
LIBS="-lopenjp2 $LIBS"
fi
@@ -25234,4 +25235,64 @@
LIBS="-lopenjp2 $LIBS"
fi
+ else
+ for ac_header in openjpeg-2.0/openjpeg.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default"
+if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENJPEG_2_0_OPENJPEG_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_stream_set_user_data_length in -lopenjp2" >&5
+$as_echo_n "checking for opj_stream_set_user_data_length in -lopenjp2... " >&6; }
+if ${ac_cv_lib_openjp2_opj_stream_set_user_data_length+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lopenjp2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opj_stream_set_user_data_length ();
+int
+main ()
+{
+return opj_stream_set_user_data_length ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_openjp2_opj_stream_set_user_data_length=yes
+else
+ ac_cv_lib_openjp2_opj_stream_set_user_data_length=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openjp2_opj_stream_set_user_data_length" >&5
+$as_echo "$ac_cv_lib_openjp2_opj_stream_set_user_data_length" >&6; }
+if test "x$ac_cv_lib_openjp2_opj_stream_set_user_data_length" = xyes; then :
+ HAVE_OPENJPEG=yes
+else
+ HAVE_OPENJPEG=no
+fi
+
+ if test "$HAVE_OPENJPEG" = "yes"; then
+ LIBS="-lopenjp2 $LIBS"
+ fi
+ fi
fi
fi
@@ -25244,6 +25305,9 @@
OPENJPEG_VERSION=20100
EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
+ elif test -r $with_openjpeg/include/openjpeg-2.2/openjpeg.h ; then
+ OPENJPEG_VERSION=20200
+ EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
else
- as_fn_error $? "openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1" "$LINENO" 5
+ as_fn_error $? "openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1 or $with_openjpeg/include/openjpeg-2.2" "$LINENO" 5
fi
Index: gdal/configure.ac
===================================================================
--- gdal/configure.ac (revision 39820)
+++ gdal/configure.ac (revision 39821)
@@ -2540,8 +2540,9 @@
elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then
- AC_CHECK_HEADERS([openjpeg-2.0/openjpeg.h])
- if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ AC_CHECK_HEADERS([openjpeg-2.2/openjpeg.h])
+ if test "$ac_cv_header_openjpeg_2_2_openjpeg_h" = "yes"; then
AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,)
if test "$HAVE_OPENJPEG" = "yes"; then
+ OPENJPEG_VERSION=20200
LIBS="-lopenjp2 $LIBS"
fi
@@ -2554,4 +2555,12 @@
LIBS="-lopenjp2 $LIBS"
fi
+ else
+ AC_CHECK_HEADERS([openjpeg-2.0/openjpeg.h])
+ if test "$ac_cv_header_openjpeg_2_0_openjpeg_h" = "yes"; then
+ AC_CHECK_LIB(openjp2,opj_stream_set_user_data_length,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,)
+ if test "$HAVE_OPENJPEG" = "yes"; then
+ LIBS="-lopenjp2 $LIBS"
+ fi
+ fi
fi
fi
@@ -2564,6 +2573,9 @@
OPENJPEG_VERSION=20100
EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
- else
- AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1])
+ elif test -r $with_openjpeg/include/openjpeg-2.2/openjpeg.h ; then
+ OPENJPEG_VERSION=20200
+ EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
+ else
+ AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include/openjpeg-2.0 or $with_openjpeg/include/openjpeg-2.1 or $with_openjpeg/include/openjpeg-2.2])
fi
Index: gdal/frmts/openjpeg/openjpegdataset.cpp
===================================================================
--- gdal/frmts/openjpeg/openjpegdataset.cpp (revision 39820)
+++ gdal/frmts/openjpeg/openjpegdataset.cpp (revision 39821)
@@ -35,5 +35,7 @@
#endif
-#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100
+#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20200
+#include <openjpeg-2.2/openjpeg.h>
+#elif defined(OPENJPEG_VERSION) && OPENJPEG_VERSION >= 20100
#include <openjpeg-2.1/openjpeg.h>
#else
Index: gdal/nmake.opt
===================================================================
--- gdal/nmake.opt (revision 39820)
+++ gdal/nmake.opt (revision 39821)
@@ -608,6 +608,8 @@
#OPENJPEG_CFLAGS = -IC:\openjpeg\include
#OPENJPEG_LIB = C:\openjpeg\lib\openjp2.lib
-# For OpenJpeg >= 2.1, uncomment
+# For OpenJpeg 2.1.x, uncomment
#OPENJPEG_VERSION = 20100
+# For OpenJpeg 2.2.x, uncomment
+#OPENJPEG_VERSION = 20200
#if using an external zlib uncomment the following lines
diff -burN gdal-1.11.2.orig/configure gdal-1.11.2/configure
--- gdal-1.11.2.orig/configure 2016-04-19 12:27:26.000000000 +0200
+++ gdal-1.11.2/configure 2016-04-19 13:05:25.000000000 +0200
@@ -10595,9 +10595,9 @@
@@ -12510,9 +12510,9 @@
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=func_echo_all
......@@ -13,7 +13,7 @@ diff -burN gdal-1.11.2.orig/configure gdal-1.11.2/configure
module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
@@ -13542,13 +13542,13 @@
@@ -15457,13 +15457,13 @@
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=func_echo_all
......
......@@ -62,7 +62,7 @@ GEOS_LIB = $(GEOS_DIR)\lib\geos.lib $(GEOS_DIR)\lib\geos_c.lib
# Uncomment for OpenJpeg support
HAVE_OPENJPEG = YES
OPENJPEG_ENABLED = YES
OPENJPEG_VERSION = 20100
OPENJPEG_VERSION = 20200
OPENJPEG_CFLAGS = -I@SB_INSTALL_PREFIX_NATIVE@\include
OPENJPEG_LIB = @SB_INSTALL_PREFIX_NATIVE@\lib\openjp2.lib
......@@ -92,11 +92,21 @@ ZLIB_INC = -I@SB_INSTALL_PREFIX_NATIVE@\include
ZLIB_LIB = @SB_INSTALL_PREFIX_NATIVE@\lib\zlib.lib
# Uncomment the following and update to enable NCSA HDF Release 4 support.
#HDF4_PLUGIN = NO
#HDF4_DIR = D:\warmerda\HDF41r5
HDF4_PLUGIN = NO
HDF4_DIR = @SB_INSTALL_PREFIX_NATIVE@
#HDF4_LIB = /LIBPATH:$(HDF4_DIR)\lib Ws2_32.lib
HDF4_LIB = $(HDF4_DIR)\lib\@HDF4_SB_DF_LIB@.lib $(HDF4_DIR)\lib\@HDF4_SB_MF_LIB@.lib $(JPEG_LIB) $(ZLIB_LIB)
HDF4_INCLUDE = $(HDF4_DIR)\include
HDF4_HAS_MAXOPENFILES = YES
# Uncomment the following and update to enable NCSA HDF Release 5 support.
#HDF5_PLUGIN = NO
#HDF5_DIR = c:\warmerda\supportlibs\hdf5\5-164-win
#HDF5_LIB = $(HDF5_DIR)\dll\hdf5dll.lib
HDF5_PLUGIN = NO
HDF5_DIR = @SB_INSTALL_PREFIX_NATIVE@
HDF5_LIB = $(HDF5_DIR)\lib\hdf5.lib $(ZLIB_LIB)
NETCDF_PLUGIN = NO
NETCDF_SETTING = YES
NETCDF_LIB = @SB_INSTALL_PREFIX_NATIVE@\lib\netcdf.lib
NETCDF_INC_DIR = @SB_INSTALL_PREFIX_NATIVE@\include
NETCDF_HAS_NC4 = YES
NETCDF_HAS_HDF4 = YES
diff -burN hdf-4.2.13.orig/CMakeLists.txt hdf-4.2.13/CMakeLists.txt
--- hdf-4.2.13.orig/CMakeLists.txt 2017-08-28 11:51:04.115548046 +0200
+++ hdf-4.2.13/CMakeLists.txt 2017-08-28 16:57:09.495243479 +0200
@@ -119,10 +119,10 @@
#-----------------------------------------------------------------------------
# Set the core names of all the libraries
#-----------------------------------------------------------------------------
-set (HDF4_SRC_LIB_CORENAME "hdf")
+set (HDF4_SRC_LIB_CORENAME "hdf" CACHE STRING "Name of the HDF library")
set (HDF4_SRC_FCSTUB_LIB_CORENAME "hdf_fcstub")
set (HDF4_SRC_FORTRAN_LIB_CORENAME "hdf_fortran")
-set (HDF4_MF_LIB_CORENAME "mfhdf")
+set (HDF4_MF_LIB_CORENAME "mfhdf" CACHE STRING "Name of the MFHDF library")
set (HDF4_MF_XDR_LIB_CORENAME "xdr")
set (HDF4_HDF_TEST_LIB_CORENAME "hdf_test")
set (HDF4_HDF_TEST_FCSTUB_LIB_CORENAME "hdf_test_fcstub")
diff -burN hdf-4.2.13.orig/hdf/src/CMakeLists.txt hdf-4.2.13/hdf/src/CMakeLists.txt
--- hdf-4.2.13.orig/hdf/src/CMakeLists.txt 2017-08-28 11:51:04.123547659 +0200
+++ hdf-4.2.13/hdf/src/CMakeLists.txt 2017-08-29 11:54:50.984708306 +0200
@@ -145,6 +145,7 @@
COMPILE_DEFINITIONS "H4_BUILT_AS_DYNAMIC_LIB"
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
INTERFACE_COMPILE_DEFINITIONS H4_BUILT_AS_DYNAMIC_LIB=1
+ DEFINE_SYMBOL "hdf_shared_EXPORTS"
)
if (WIN32)
set_property (TARGET ${HDF4_SRC_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "DOS_FS")
diff -burN hdf-4.2.13.orig/mfhdf/libsrc/CMakeLists.txt hdf-4.2.13/mfhdf/libsrc/CMakeLists.txt
--- hdf-4.2.13.orig/mfhdf/libsrc/CMakeLists.txt 2017-08-28 11:51:04.131547427 +0200
+++ hdf-4.2.13/mfhdf/libsrc/CMakeLists.txt 2017-08-29 14:09:23.159803355 +0200
@@ -92,6 +92,7 @@
COMPILE_DEFINITIONS "HDF;H4_BUILT_AS_DYNAMIC_LIB"
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
INTERFACE_COMPILE_DEFINITIONS H4_BUILT_AS_DYNAMIC_LIB=1
+ DEFINE_SYMBOL "mfhdf_shared_EXPORTS"
)
if (WIN32)
set_property (TARGET ${HDF4_MF_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS "DOS_FS;SWAP")
diff -burN netcdf-4.4.1.1-orig/CMakeLists.txt netcdf-4.4.1.1/CMakeLists.txt
--- netcdf-4.4.1.1-orig/CMakeLists.txt 2017-09-18 19:22:31.832817084 +0200
+++ netcdf-4.4.1.1/CMakeLists.txt 2017-09-18 19:23:32.001343319 +0200
@@ -434,12 +434,12 @@
INCLUDE_DIRECTORIES(${MFHDF_H_INCLUDE_DIR})
ENDIF()
- FIND_LIBRARY(HDF4_DF_LIB NAMES df libdf hdf)
+ FIND_LIBRARY(HDF4_DF_LIB NAMES dfalt df libdf hdf)
IF(NOT HDF4_DF_LIB)
MESSAGE(FATAL_ERROR "Can't find or link to the hdf4 df library.")
ENDIF()
- FIND_LIBRARY(HDF4_MFHDF_LIB NAMES mfhdf libmfhdf)
+ FIND_LIBRARY(HDF4_MFHDF_LIB NAMES mfhdfalt mfhdf libmfhdf)
IF(NOT HDF4_MFHDF_LIB)
MESSAGE(FATAL_ERROR "Can't find or link to the hdf4 mfhdf library.")
ENDIF()
This diff is collapsed.
diff -burN openjpeg-d0babeb6f6cdd1887308137df37bb2b4724a6592.orig/CMakeLists.txt openjpeg-d0babeb6f6cdd1887308137df37bb2b4724a6592/CMakeLists.txt
--- openjpeg-d0babeb6f6cdd1887308137df37bb2b4724a6592.orig/CMakeLists.txt 2016-07-01 12:37:01.000000000 +0200
+++ openjpeg-d0babeb6f6cdd1887308137df37bb2b4724a6592/CMakeLists.txt 2016-07-01 12:37:20.000000000 +0200
@@ -151,7 +151,7 @@
@@ -153,7 +153,7 @@
endif()
if (APPLE)
......@@ -31,9 +31,12 @@ diff -burN openjpeg-d0babeb6f6cdd1887308137df37bb2b4724a6592.orig/thirdparty/CMa
find_package(LCMS2)
if(LCMS2_FOUND)
message(STATUS "Your system seems to have a LCMS2 lib available, we will use it")
@@ -115,4 +115,4 @@
@@ -115,7 +115,7 @@
message(STATUS "LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it")
endif(LCMS_FOUND)
endif(LCMS2_FOUND)
-endif(BUILD_THIRDPARTY)
+endif()
#------------
......@@ -4,7 +4,7 @@ set SB_SAVE_LIB=%LIB%
set INCLUDE=%INCLUDE%;@QT4_INCLUDE_PREFIX_NATIVE@;@QT4_INCLUDE_PREFIX_NATIVE@\freetype2
set LIB=%LIB%;@QT4_LIB_PREFIX_NATIVE@
@QT4_CONFIGURE_SCRIPT@ -prefix @QT4_INSTALL_PREFIX_NATIVE@ -L @QT4_LIB_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@\freetype2 -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib -no-icu @QT4_SB_CONFIG@
@QT4_CONFIGURE_SCRIPT@ @QT4_SB_CONFIG@
set INCLUDE=%SB_SAVE_INCLUDE%
set LIB=%SB_SAVE_LIB%
@QT4_CONFIGURE_SCRIPT@ -prefix @QT4_INSTALL_PREFIX_NATIVE@ -L @QT4_LIB_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@ -I @QT4_INCLUDE_PREFIX_NATIVE@/freetype2 -opensource -confirm-license -release -shared -nomake demos -nomake examples -nomake tools -no-phonon-backend -no-phonon -no-script -no-scripttools -no-multimedia -no-audio-backend -no-webkit -no-declarative -no-accessibility -no-qt3support -no-xmlpatterns -no-sql-sqlite -no-openssl -no-libtiff -no-libmng -system-libpng -system-libjpeg -system-zlib -no-dbus -no-icu @QT4_SB_CONFIG@
@QT4_CONFIGURE_SCRIPT@ @QT4_SB_CONFIG@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment