Commit ebbb426c authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

BUG: fix JIRA OTB-1005

parent 8be792c2
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)
if(NOT __EXTERNAL_BOOST__)
set(__EXTERNAL_BOOST__ 1)
message(STATUS "Setup Boost ...")
......@@ -21,18 +19,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 +40,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 +59,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 +96,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 +107,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 +131,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)
if(NOT __EXTERNAL_CURL__)
set(__EXTERNAL_CURL__ 1)
message(STATUS "Setup cURL ...")
......@@ -9,14 +7,11 @@ 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)
# set proj back to its original value
set(proj CURL)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(CURL ZLIB OPENSSL)
if(USE_SYSTEM_GEOS) #why geos here?. discuss with GP.
ADD_SUPERBUILD_CMAKE_VAR(ZLIB_ROOT)
......@@ -24,15 +19,15 @@ else()
#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}
......@@ -40,8 +35,8 @@ else()
)
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}
......@@ -59,16 +54,16 @@ else()
-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)
if(NOT __EXTERNAL_EXPAT__)
set(__EXTERNAL_EXPAT__ 1)
message(STATUS "Setup expat ...")
......@@ -9,11 +7,11 @@ 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 +26,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)
if(NOT __EXTERNAL_FFTW__)
set(__EXTERNAL_FFTW__ 1)
message(STATUS "Setup FFTW ...")
......@@ -10,22 +8,22 @@ if(USE_SYSTEM_FFTW)
#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}
......@@ -40,19 +38,19 @@ 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}
......@@ -67,22 +65,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)
if(NOT __EXTERNAL_FREETYPE__)
set(__EXTERNAL_FREETYPE__ 1)
message(STATUS "Setup freetype ...")
......@@ -9,11 +7,11 @@ 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 +23,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)
if(NOT __EXTERNAL_GDAL__)
set(__EXTERNAL_GDAL__ 1)
message(STATUS "Setup GDAL...")
......@@ -9,15 +7,11 @@ 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)
......@@ -37,17 +31,17 @@ 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
# use 'env' because CTest launcher doesn't perform shell interpretation
......@@ -72,25 +66,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
......@@ -98,11 +92,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)
if(NOT __EXTERNAL_GEOS__)
set(__EXTERNAL_GEOS__ 1)
message(STATUS "Setup GEOS ...")
......@@ -10,11 +8,11 @@ if(USE_SYSTEM_GEOS)
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
URL "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
URL_MD5 fc5df2d926eb7e67f988a43a92683bae
SOURCE_DIR ${GEOS_SB_SRC}
......@@ -29,17 +27,17 @@ else()
-DGEOS_ENABLE_TESTS:BOOL=OFF
CMAKE_COMMAND ${SB_CMAKE_COMMAND} )
ExternalProject_Add_Step(${proj} remove_static
ExternalProject_Add_Step(GEOS remove_static
COMMAND ${CMAKE_COMMAND} -E remove
${SB_INSTALL_PREFIX}/lib/libgeos.a
DEPENDEES install)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
set(_SB_GEOS_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/geos.lib)
set(_SB_GEOS_LIBRARY ${SB_INSTALL_PREFIX}/lib/geos.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
set(_SB_GEOS_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
set(proj GEOTIFF)
if(NOT __EXTERNAL_${proj}__)
set(__EXTERNAL_${proj}__ 1)
if(NOT __EXTERNAL_GEOTIFF__)
set(__EXTERNAL_GEOTIFF__ 1)
message(STATUS "Setup libgeotiff...")
......@@ -9,15 +7,11 @@ if(USE_SYSTEM_GEOTIFF)
find_package ( GeoTIFF )
message(STATUS " Using libgeotiff system version")
else()
SETUP_SUPERBUILD(PROJECT ${proj})
SETUP_SUPERBUILD(PROJECT GEOTIFF)
message(STATUS " Using GeoTIFF SuperBuild version")
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} TIFF PROJ JPEG ZLIB)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj GEOTIFF)
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(GEOTIFF TIFF PROJ JPEG ZLIB)
set(GEOTIFF_SB_CONFIG)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
......@@ -29,15 +23,15 @@ else()
ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
ExternalProject_Add(${proj}
PREFIX ${proj}
ExternalProject_Add(GEOTIFF
PREFIX GEOTIFF
URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
SOURCE_DIR ${GEOTIFF_SB_SRC}
BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
DEPENDS ${GEOTIFF_DEPENDENCIES}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
......@@ -47,13 +41,13 @@ else()
CMAKE_COMMAND ${SB_CMAKE_COMMAND}