Commit 7bc0be76 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

MRG: Merged from origin/release-5.4.

parents d2fea898 c1004648
......@@ -247,7 +247,7 @@ otb_add_test(NAME nameOfTheTest COMMAND otbTheModuleNameTestDriver
Your remote module can be build inside the OTB source tree or outside as a
external CMake project with an existing build of OTB. Please note in that case
that you'll have to set OTB\textunderscoreDIR CMake option to the directory which contain
that you'll have to set OTB\textunderscore DIR CMake option to the directory which contain
existing OTB build (Note that this cannot be used for building against an OTB install
tree).
......
set(proj BOOST)
# Use boost 1.54. There was previously incompatibilities between boost and Qt which leads
# to compilation errors for OTB. We could increase boost version to last stable
# release in future version of superbuild as we've patchedOTB code to
# support both libraries. See the related changeset in OTB trunk:
# http://hg.orfeo-toolbox.org/OTB/r# ev/8da67e36c78d
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup Boost ...")
if(NOT __EXTERNAL_BOOST__)
set(__EXTERNAL_BOOST__ 1)
if(USE_SYSTEM_BOOST)
# Required
......@@ -21,18 +17,18 @@ if(USE_SYSTEM_BOOST)
1.35.0
COMPONENTS unit_test_framework
)
message(STATUS " Using Boost system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT BOOST)
option(SUPERBUILD_BOOST_HEADER_ONLY "Only use Boost headers" ON)
mark_as_advanced(SUPERBUILD_BOOST_HEADER_ONLY)
if(UNIX)
if(SUPERBUILD_BOOST_HEADER_ONLY)
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(BOOST
PREFIX BOOST
URL "http://sourceforge.net/projects/boost/files/boost/1.50.0/boost_1_50_0.tar.bz2/download"
URL_MD5 52dd00be775e689f55a987baebccc462
BINARY_DIR ${BOOST_SB_BUILD_DIR}
......@@ -42,13 +38,13 @@ else()
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/BOOST/CMakeLists.txt
${BOOST_SB_SRC}
)
else()
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(BOOST
PREFIX BOOST
URL "http://sourceforge.net/projects/boost/files/boost/1.50.0/boost_1_50_0.tar.bz2/download"
URL_MD5 52dd00be775e689f55a987baebccc462
BINARY_DIR ${BOOST_SB_BUILD_DIR}
......@@ -61,36 +57,36 @@ else()
BUILD_COMMAND ./b2
INSTALL_COMMAND ./b2 install
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/patches/${proj}/1.54.0
${CMAKE_SOURCE_DIR}/patches/BOOST/1.54.0
${BOOST_SB_SRC}
)
ExternalProject_Add_Step(${proj} copy_source
ExternalProject_Add_Step(BOOST copy_source
COMMAND ${CMAKE_COMMAND} -E copy_directory
${BOOST_SB_SRC} ${BOOST_SB_BUILD_DIR}
DEPENDEES patch update
DEPENDERS configure
)
endif()
message(STATUS " Using Boost SuperBuild version")
else(MSVC)
#TODO: find hash for archives properly
set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
set(BOOST_GRAPH_URL_HASH c246516ca84a3c79ae8a0b22fceb0344)
set(BOOST_REGEX_URL_HASH a3bfc2dc9a3ebe3c050518ecb29d6f8b)
set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)
if(MSVC10)
set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
set(BOOST_GRAPH_URL_HASH c246516ca84a3c79ae8a0b22fceb0344)
set(BOOST_REGEX_URL_HASH a3bfc2dc9a3ebe3c050518ecb29d6f8b)
set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)
else(MSVC80)
else(CMAKE_COMPILER_2005)
endif()
set(BOOST_HEADERS_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/boost_1_50_headers.zip/download")
......@@ -98,8 +94,8 @@ else()
set(BOOST_UTF_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/boost_unit_test_framework-vc100-mt-1_50.zip/download")
set(BOOST_REGEX_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/libboost_regex-vc100-mt-1_50.zip/download")
ExternalProject_Add(${proj}_HEADERS
PREFIX ${proj}/_HEADERS
ExternalProject_Add(BOOST_HEADERS
PREFIX BOOST/_HEADERS
URL ${BOOST_HEADERS_URL}
URL_MD5 ${BOOST_HEADERS_URL_HASH}
SOURCE_DIR ${BOOST_SB_SRC}/include/boost
......@@ -109,21 +105,21 @@ else()
)
set(BOOSTLIBS)
foreach(BOOSTLIB "REGEX" "GRAPH" "UTF")
ExternalProject_Add(${proj}_${BOOSTLIB}
PREFIX ${proj}/_${BOOSTLIB}
ExternalProject_Add(BOOST_${BOOSTLIB}
PREFIX BOOST/_${BOOSTLIB}
URL ${BOOST_${BOOSTLIB}_URL}
URL_MD5 ${BOOST_${BOOSTLIB}_URL_HASH}
URL_MD5 ${BOOST_${BOOSTLIB}_URL_HASH}
SOURCE_DIR ${BOOST_SB_SRC}/lib
DEPENDS ${proj}_HEADERS
DEPENDS BOOST_HEADERS
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${BOOST_SB_SRC}/lib ${SB_INSTALL_PREFIX}/lib
)
list(APPEND BOOSTLIBS ${proj}_${BOOSTLIB})
list(APPEND BOOSTLIBS BOOST_${BOOSTLIB})
endforeach()
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(BOOST
PREFIX BOOST
DOWNLOAD_COMMAND ""
SOURCE_DIR ${BOOST_SB_SRC}
DEPENDS ${BOOSTLIBS}
......@@ -133,12 +129,12 @@ else()
)
message(STATUS " Using Boost SuperBuild version (prebuilt binaries)")
endif() #end else MSVC
set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)
endif()
endif()
set(proj CURL)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup cURL ...")
if(NOT __EXTERNAL_CURL__)
set(__EXTERNAL_CURL__ 1)
if(USE_SYSTEM_CURL)
find_package ( CURL )
message(STATUS " Using cURL system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT CURL)
message(STATUS " Using cURL SuperBuild version")
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} ZLIB OPENSSL)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(CURL ZLIB)
if(NOT APPLE)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OPENSSL)
endif()
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj CURL)
if(USE_SYSTEM_GEOS) #why geos here?. discuss with GP.
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_ROOT)
endif()
#TODO: add openssl and other dependencies
if(MSVC)
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(CURL
PREFIX CURL
URL "http://curl.haxx.se/download/curl-7.40.0.tar.gz"
URL_MD5 58943642ea0ed050ab0431ea1caf3a6f
SOURCE_DIR ${CURL_SB_SRC}
BINARY_DIR ${CURL_SB_BUILD_DIR}/winbuild
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${CURL_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CURL_SB_SRC} ${CURL_SB_BUILD_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND nmake /f ${CURL_SB_BUILD_DIR}/winbuild/Makefile.vc mode=dll WITH_ZLIB=dll WITH_DEVEL=${SB_INSTALL_PREFIX}
INSTALL_COMMAND ${CMAKE_COMMAND} -E chdir ${CURL_SB_BUILD_DIR}/builds/ ${CMAKE_COMMAND} -E copy_directory libcurl-vc-x86-release-dll-zlib-dll-ipv6-sspi-winssl ${SB_INSTALL_PREFIX}
INSTALL_COMMAND ${CMAKE_COMMAND} -E chdir ${CURL_SB_BUILD_DIR}/builds/ ${CMAKE_COMMAND} -E copy_directory libcurl-vc-x86-release-dll-zlib-dll-ipv6-sspi-winssl ${SB_INSTALL_PREFIX}
)
else(UNIX)
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(CURL
PREFIX CURL
URL "http://curl.haxx.se/download/curl-7.40.0.tar.gz"
URL_MD5 58943642ea0ed050ab0431ea1caf3a6f
BINARY_DIR ${CURL_SB_BUILD_DIR}
......@@ -53,18 +49,23 @@ else()
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_CURL_EXE:BOOL=ON
-DBUILD_CURL_TESTS:BOOL=OFF
-DBUILD_CURL_EXE:BOOL=ON
-DCMAKE_USE_OPENSSL:BOOL=${SB_ENABLE_OPENSSL_CURL}
-DCMAKE_USE_LIBSSH2:BOOL=OFF
-DCURL_DISABLE_LDAP:BOOL=ON
-DCMAKE_USE_OPENLDAP:BOOL=OFF
${CURL_SB_CONFIG}
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${CURL_DEPENDENCIES}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
endif()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_CURL_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl.lib)
set(_SB_CURL_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_CURL_LIBRARY ${SB_INSTALL_PREFIX}/lib/libcurl${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
set(proj EXPAT)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup expat ...")
if(NOT __EXTERNAL_EXPAT__)
set(__EXTERNAL_EXPAT__ 1)
if(USE_SYSTEM_EXPAT)
find_package ( EXPAT )
message(STATUS " Using expat system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT EXPAT)
message(STATUS " Using Expat SuperBuild version")
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(EXPAT
PREFIX EXPAT
URL "http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download"
URL_MD5 dd7dab7a5fea97d2a6a43f511449b7cd
BINARY_DIR ${EXPAT_SB_BUILD_DIR}
......@@ -28,12 +24,12 @@ else()
-DBUILD_tools:BOOL=OFF
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_EXPAT_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/expat.lib)
set(_SB_EXPAT_LIBRARY ${SB_INSTALL_PREFIX}/lib/expat.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_EXPAT_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
set(proj FFTW)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup FFTW ...")
if(NOT __EXTERNAL_FFTW__)
set(__EXTERNAL_FFTW__ 1)
if(USE_SYSTEM_FFTW)
# TODO : use ITK's FindFFTW
#find_package ( FFTW )
message(STATUS " Using FFTW system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
set(projFloat ${proj}F)
set(projDouble ${proj}D)
set(FFTW_SB_BUILD_FLOAT_DIR ${CMAKE_BINARY_DIR}/${proj}/src/${projFloat})
set(FFTW_SB_BUILD_DOUBLE_DIR ${CMAKE_BINARY_DIR}/${proj}/src/${projDouble})
SETUP_SUPERBUILD(PROJECT FFTW)
set(projFloat FFTWF)
set(projDouble FFTWD)
set(FFTW_SB_BUILD_FLOAT_DIR ${CMAKE_BINARY_DIR}/FFTW/src/${projFloat})
set(FFTW_SB_BUILD_DOUBLE_DIR ${CMAKE_BINARY_DIR}/FFTW/src/${projDouble})
if(MSVC)
# TODO : get precompiled binaries as not all MSVC versions can compile FFTW
message(STATUS " FFTW SuperBuild is not available yet...")
add_custom_target(${proj})
add_custom_target(FFTW)
else()
message(STATUS " Using FFTW SuperBuild version")
# Compile the float version of FFTW
ExternalProject_Add(${projFloat}
PREFIX ${proj}
PREFIX FFTW
URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
SOURCE_DIR ${FFTW_SB_BUILD_FLOAT_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${SB_ENV_CONFIGURE_CMD}
${FFTW_SB_BUILD_FLOAT_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared
......@@ -39,25 +36,26 @@ else()
--enable-float
--enable-threads
--disable-fortran
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${FFTW_DEPENDENCIES}
)
#ExternalProject_Add_Step(${projFloat} copy_source
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# ${FFTW_SB_SRC} ${FFTW_SB_BUILD_FLOAT_DIR}
# DEPENDEES patch update
# DEPENDERS configure
# )
# Compile the double version of FFTW
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(FFTW
PREFIX FFTW
URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
SOURCE_DIR ${FFTW_SB_BUILD_DOUBLE_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${SB_ENV_CONFIGURE_CMD}
${FFTW_SB_BUILD_DOUBLE_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared
......@@ -65,22 +63,22 @@ else()
--disable-float
--enable-threads
--disable-fortran
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${FFTW_DEPENDENCIES}
)
#ExternalProject_Add_Step(${projDouble} copy_source
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# ${FFTW_SB_SRC} ${FFTW_SB_BUILD_DOUBLE_DIR}
# DEPENDEES patch update
# DEPENDERS configure
# )
add_dependencies(${proj} ${projFloat})
set(_SB_${proj}_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
add_dependencies(FFTW ${projFloat})
set(_SB_FFTW_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
endif()
endif()
......
set(proj FREETYPE)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup freetype ...")
if(NOT __EXTERNAL_FREETYPE__)
set(__EXTERNAL_FREETYPE__ 1)
if(USE_SYSTEM_FREETYPE)
find_package ( FreeType )
message(STATUS " Using FreeType system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT FREETYPE)
message(STATUS " Using FreeType SuperBuild version")
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(FREETYPE
PREFIX FREETYPE
URL "http://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz"
URL_MD5 1d733ea6c1b7b3df38169fbdbec47d2b
BINARY_DIR ${FREETYPE_SB_BUILD_DIR}
......@@ -25,12 +21,12 @@ else()
-DBUILD_SHARED_LIBS:BOOL=ON
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_FREETYPE_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/freetype.lib)
set(_SB_FREETYPE_LIBRARY ${SB_INSTALL_PREFIX}/lib/freetype.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libfreetype${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_FREETYPE_LIBRARY ${SB_INSTALL_PREFIX}/lib/libfreetype${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
set(proj GDAL)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup GDAL...")
if(NOT __EXTERNAL_GDAL__)
set(__EXTERNAL_GDAL__ 1)
if(USE_SYSTEM_GDAL)
find_package ( GDAL )
message(STATUS " Using GDAL system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT GDAL)
message(STATUS " Using GDAL SuperBuild version")
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} TIFF CURL GEOTIFF PNG JPEG OPENJPEG SQLITE GEOS ZLIB EXPAT)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj GDAL)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(GDAL TIFF CURL GEOTIFF PNG JPEG OPENJPEG SQLITE GEOS ZLIB EXPAT)
ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF_ROOT --with-geotiff)
......@@ -29,14 +21,6 @@ else()
ADD_SUPERBUILD_CONFIGURE_VAR(EXPAT_ROOT --with-expat)
ADD_SUPERBUILD_CONFIGURE_VAR(CURL_ROOT --with-curl "/bin/curl-config")
ADD_SUPERBUILD_CONFIGURE_VAR(GEOS_ROOT --with-geos "/bin/geos-config")
#if(USE_SYSTEM_TIFF)
# if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
# list(APPEND GDAL_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX})
# endif()
#else()
# list(APPEND GDAL_SB_CONFIG --with-libtiff=${SB_INSTALL_PREFIX})
#endif()
if(UNIX)
set(GDAL_SB_EXTRA_OPTIONS "" CACHE STRING "Extra options to be passed to GDAL configure script")
......@@ -45,19 +29,19 @@ else()
#Convert GDAL_SB_EXTRA_OPTIONS to a list to allow to add multiple instructions to the CONFIGURE_COMMAND
separate_arguments(GDAL_SB_EXTRA_OPTIONS)
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(GDAL
PREFIX GDAL
URL "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
URL_MD5 866a46f72b1feadd60310206439c1a76
BINARY_DIR ${GDAL_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${GDAL_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/GDAL/GNUmakefile ${GDAL_SB_SRC}/swig/python/GNUmakefile
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/patches/${proj}/S2_patch ${GDAL_SB_SRC}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/patches/GDAL/S2_patch ${GDAL_SB_SRC}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${GDAL_SB_SRC} ${GDAL_SB_BUILD_DIR}
CONFIGURE_COMMAND
CONFIGURE_COMMAND
# use 'env' because CTest launcher doesn't perform shell interpretation
${SB_ENV_CONFIGURE_CMD}
${GDAL_SB_BUILD_DIR}/configure
......@@ -66,6 +50,10 @@ else()
--without-ogdi
--without-jasper
--with-sentinel2
--without-netcdf #netcdf is not added by superbuild. better to deactivate it.
--without-hdf4
--without-hdf5
--without-xml2
${GDAL_SB_CONFIG}
${GDAL_SB_EXTRA_OPTIONS}
BUILD_COMMAND $(MAKE)
......@@ -76,25 +64,25 @@ else()
##add libkml
##https://trac.osgeo.org/gdal/ticket/5725
##is needed for SQLITE driver
list(REMOVE_ITEM ${proj}_DEPENDENCIES LIBKML)
list(REMOVE_ITEM GDAL_DEPENDENCIES LIBKML)
STRING(REGEX REPLACE "/$" "" CMAKE_WIN_INSTALL_PREFIX ${SB_INSTALL_PREFIX})
STRING(REGEX REPLACE "/" "\\\\" CMAKE_WIN_INSTALL_PREFIX ${CMAKE_WIN_INSTALL_PREFIX})
configure_file(${CMAKE_SOURCE_DIR}/patches/${proj}/nmake_gdal_extra.opt.in ${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt)
configure_file(${CMAKE_SOURCE_DIR}/patches/GDAL/nmake_gdal_extra.opt.in ${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt)
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(GDAL
PREFIX GDAL
URL "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
URL_MD5 866a46f72b1feadd60310206439c1a76
SOURCE_DIR ${GDAL_SB_SRC}
BINARY_DIR ${GDAL_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${GDAL_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/GDAL/GNUmakefile ${GDAL_SB_SRC}/swig/python/GNUmakefile
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/patches/${proj}/S2_patch ${GDAL_SB_SRC}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/patches/GDAL/S2_patch ${GDAL_SB_SRC}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${GDAL_SB_SRC} ${GDAL_SB_BUILD_DIR}
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/ogrsqlitevirtualogr.cpp
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/GDAL/ogrsqlitevirtualogr.cpp
${GDAL_SB_BUILD_DIR}/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp
BUILD_COMMAND nmake /f ${GDAL_SB_BUILD_DIR}/makefile.vc MSVC_VER=${MSVC_VERSION} EXT_NMAKE_OPT=${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt
INSTALL_COMMAND nmake /f ${GDAL_SB_BUILD_DIR}/makefile.vc devinstall MSVC_VER=${MSVC_VERSION} EXT_NMAKE_OPT=${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt
......@@ -102,11 +90,11 @@ else()
endif()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_GDAL_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/gdal_i.lib)
set(_SB_GDAL_LIBRARY ${SB_INSTALL_PREFIX}/lib/gdal_i.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgdal${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_GDAL_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgdal${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
......
set(proj GEOS)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
message(STATUS "Setup GEOS ...")
if(NOT __EXTERNAL_GEOS__)
set(__EXTERNAL_GEOS__ 1)
if(USE_SYSTEM_GEOS)
# TODO : FindGEOS.cmake
find_package ( GEOS )
message(STATUS " Using GEOS system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT GEOS)
message(STATUS " Using GEOS SuperBuild version")
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(GEOS
PREFIX GEOS