Commit 4d345a03 authored by Rashad Kanavath's avatar Rashad Kanavath

SuperBuild: use curl from superbuild config

parent 0392887f
......@@ -12,13 +12,13 @@ if(USE_SYSTEM_GDAL)
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using GDAL SuperBuild version")
# declare dependencies
set(${proj}_DEPENDENCIES TIFF GEOTIFF PNG JPEG OPENJPEG SQLITE GEOS ZLIB EXPAT LIBKML CURL)
INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
# set proj back to its original value
set(proj GDAL)
ADD_SUPERBUILD_CONFIGURE_VAR(TIFF_ROOT --with-libtiff)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF_ROOT --with-geotiff)
ADD_SUPERBUILD_CONFIGURE_VAR(PNG_ROOT --with-png)
......@@ -28,13 +28,13 @@ else()
ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_ROOT --with-libz)
ADD_SUPERBUILD_CONFIGURE_VAR(EXPAT_ROOT --with-expat)
ADD_SUPERBUILD_CONFIGURE_VAR(LIBKML_ROOT --with-libkml)
ADD_SUPERBUILD_CONFIGURE_VAR(CURL_ROOT --with-curl)
if(MSVC)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOS_ROOT --with-geos)
else()
if(NOT USE_SYSTEM_CURL)
ADD_SUPERBUILD_CONFIGURE_VAR(CURL_ROOT --with-curl "/bin/curl-config")
endif()
if(NOT USE_SYSTEM_GEOS)
ADD_SUPERBUILD_CONFIGURE_VAR(GEOS_ROOT --with-geos "/bin/geos-config")
endif()
#if(USE_SYSTEM_TIFF)
# if(NOT SYSTEM_TIFF_PREFIX STREQUAL "")
# list(APPEND GDAL_SB_CONFIG --with-libtiff=${SYSTEM_TIFF_PREFIX})
......@@ -42,11 +42,11 @@ else()
#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")
mark_as_advanced(GDAL_SB_EXTRA_OPTIONS)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
......@@ -55,12 +55,12 @@ else()
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
UPDATE_COMMAND ${CMAKE_COMMAND} -E copy_directory ${GDAL_SB_SRC} ${GDAL_SB_BUILD_DIR}
PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
CONFIGURE_COMMAND
UPDATE_COMMAND ${CMAKE_COMMAND} -E copy_directory ${GDAL_SB_SRC} ${GDAL_SB_BUILD_DIR}
PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
CONFIGURE_COMMAND
# use 'env' because CTest launcher doesn't perform shell interpretation
${SB_ENV_CONFIGURE_CMD}
${GDAL_SB_BUILD_DIR}/configure
${GDAL_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-static=no
--without-ogdi
......@@ -73,14 +73,14 @@ else()
else(MSVC)
##add libkml
##https://trac.osgeo.org/gdal/ticket/5725
##is needed for SQLITE driver
##https://trac.osgeo.org/gdal/ticket/5725
##is needed for SQLITE driver
list(REMOVE_ITEM ${proj}_DEPENDENCIES LIBKML)
STRING(REGEX REPLACE "/$" "" CMAKE_WIN_INSTALL_PREFIX ${SB_INSTALL_PREFIX})
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)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
......@@ -96,15 +96,15 @@ else()
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
)
endif()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/gdal_i.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgdal${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
endif()
......@@ -8,12 +8,12 @@ macro(superbuild_package)
list(APPEND PACKAGE_SEARCHDIRS "${PACKAGE_INSTALLDIR}/lib") #so
list(APPEND PACKAGE_SEARCHDIRS "${PACKAGE_INSTALLDIR}/lib/otb/applications") #otb apps
install_common()
# install_common()
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${PACKAGE_INSTALLDIR}/${PACKAGE_OUTDIR}")
file(GLOB otbapps_list ${PACKAGE_INSTALLDIR}/lib/otb/applications/otbapp_*so) # /lib/otb
list(APPEND PACKAGE_PEFILES ${otbapps_list})
# list(APPEND PACKAGE_PEFILES ${otbapps_list})
set(alldlls)
set(notfound_dlls)
......@@ -74,16 +74,27 @@ function(process_deps infile)
if(EXISTS ${SEARCHDIR}/${infile})
set(DLL_FOUND TRUE)
message(STATUS "Processing ${SEARCHDIR}/${infile}")
add_custom_target(RPATH_${bn}
INSTALL
POST_BUILD
COMMAND ${PATCHELF_PROGRAM} "--set-rpath" "../lib" "${PACKAGE_OUTDIR}/lib/${infile}")
#get_filename_component(file_ext ${infile} EXT)
# if("${file_ext}" STREQUAL "${CMAKE_SHARED_LIBRARY_SUFFIX}")
# install(FILES "${SEARCHDIR}/${infile}"
# DESTINATION ${PACKAGE_OUTDIR}/lib)
file(GLOB sofiles "${SEARCHDIR}/${bn}*")
add_custom_target(RPATH_${bn}
INSTALL
POST_BUILD
COMMAND ${PATCHELF_PROGRAM} "--set-rpath" "../lib" "${PACKAGE_OUTDIR}/lib/${infile}")
#else() #we assume it is executable
# install(FILES "${SEARCHDIR}/${infile}"
# DESTINATION ${PACKAGE_OUTDIR}/bin)
file(GLOB sofiles "${SEARCHDIR}/${bn}*")
foreach(sofile ${sofiles})
install(FILES "${sofile}"
DESTINATION ${PACKAGE_OUTDIR}/bin)
endforeach()
#endif()
if(NOT EXISTS ${OBJDUMP_PROGRAM})
message(FATAL_ERROR "objdump executable not found. please check OBJDUMP_PROGRAM is set to correct cross compiled executable")
......@@ -91,6 +102,7 @@ function(process_deps infile)
execute_process(COMMAND ${OBJDUMP_PROGRAM} "-p" "${SEARCHDIR}/${infile}" OUTPUT_VARIABLE dump_out)
string(REGEX MATCHALL "NEEDED\\ *[A-Za-z(0-9\\.0-9)+_\\-]*" needed_dlls "${dump_out}")
string(REGEX REPLACE "NEEDED" "" needed_dlls "${needed_dlls}")
foreach(needed_dll ${needed_dlls})
string(STRIP ${needed_dll} needed_dll)
process_deps(${needed_dll})
......
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