Commit 59139271 authored by Rashad Kanavath's avatar Rashad Kanavath

SuperBuild: try use cmake build

parent bbd9bcd1
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 300)
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
".*SuperBuild.LIBKML.*warning.*"
".*SuperBuild.GEOS.*warning.*"
".*SuperBuild.JPEG.*"
".*SuperBuild.TIFF.*warning.*"
".*SuperBuild.GEOTIFF.*warning.*"
".*SuperBuild.GDAL.config.status.*WARNING.*"
".*SuperBuild.OSSIM.*warning.*"
)
......@@ -11,14 +11,14 @@ if(USE_SYSTEM_GEOTIFF)
else()
SETUP_SUPERBUILD(PROJECT ${proj})
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)
if(MSVC)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
......@@ -34,77 +34,30 @@ else()
ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_ROOT --with-zlib)
ADD_SUPERBUILD_CONFIGURE_VAR(JPEG_ROOT --with-jpeg)
endif()
#if(MSVC)
# set(GEOTIFF_SB_ZLIB_CONFIG
# -DZLIB_INCLUDE_DIR:STRING=${SB_INSTALL_PREFIX}/include
# -DZLIB_LIBRARY:STRING=${SB_INSTALL_PREFIX}/lib/zlib.lib
# )
if(MSVC)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
${GEOTIFF_SB_SRC}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DWITH_TIFF:BOOL=ON
-DWITH_PROJ4:BOOL=ON
-DWITH_JPEG:BOOL=OFF
-DWITH_ZLIB:BOOL=ON
-DWITH_UTILITIES:BOOL=ON
-DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
${GEOTIFF_SB_CONFIG}
CMAKE_COMMAND
)
else()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
# use 'env' because CTest launcher doesn't perform shell interpretation
${SB_ENV_CONFIGURE_CMD}
${GEOTIFF_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-static=no
${GEOTIFF_SB_CONFIG}
BUILD_COMMAND $(MAKE) bin_PROGRAMS=
INSTALL_COMMAND $(MAKE) install bin_PROGRAMS=
DEPENDS ${${proj}_DEPENDENCIES}
#PATCH_COMMAND ${CMAKE_COMMAND} -E copy
# ${CMAKE_SOURCE_DIR}/patches/${proj}/configure
# ${GEOTIFF_SB_SRC}
)
ExternalProject_Add_Step(${proj} copy_source
COMMAND ${CMAKE_COMMAND} -E copy_directory
${GEOTIFF_SB_SRC} ${GEOTIFF_SB_BUILD_DIR}
DEPENDEES patch update
DEPENDERS configure
)
endif()
ExternalProject_Add(${proj}
PREFIX ${proj}
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}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/geotiff_i.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeotiff${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -12,55 +12,32 @@ else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using libjpeg SuperBuild version")
if(WIN32)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
SOURCE_DIR ${JPEG_SB_SRC}
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DWITH_SIMD:BOOL=OFF
-DWITH_TURBOJPEG:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/jconfigint.h.in ${JPEG_SB_SRC}/win/ )
else()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${JPEG_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared=yes
--with-jpeg8
--without-simd
--without-java
BUILD_COMMAND $(MAKE) bin_PROGRAMS=
INSTALL_COMMAND $(MAKE) install bin_PROGRAMS=
DEPENDS ${${proj}_DEPENDENCIES} )
ExternalProject_Add_Step(${proj} copy_source
COMMAND ${CMAKE_COMMAND} -E copy_directory
${JPEG_SB_SRC} ${JPEG_SB_BUILD_DIR}
DEPENDEES patch update
DEPENDERS configure )
ExternalProject_Add_Step(${proj} remove_static
COMMAND ${CMAKE_COMMAND} -E remove -f ${SB_INSTALL_PREFIX}/lib/libturbojpeg.a
DEPENDEES install )
endif()
include(CheckTypeSize)
check_type_size("size_t" JPEG_SIZEOF_SIZE_T)
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://sourceforge.net/projects/libjpeg-turbo/files/1.4.1/libjpeg-turbo-1.4.1.tar.gz"
URL_MD5 b1f6b84859a16b8ebdcda951fa07c3f2
SOURCE_DIR ${JPEG_SB_SRC}
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_FLAGS=-DSIZEOF_SIZE_T=${JPEG_SIZEOF_SIZE_T}
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DENABLE_SHARED=TRUE
-DENABLE_STATIC=FALSE
-DWITH_SIMD=FALSE
-DWITH_TURBOJPEG=FALSE
CMAKE_COMMAND ${SB_CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${SB_INSTALL_PREFIX}
)
ExternalProject_Add_Step(${proj} patch_cmake
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/patches/${proj}/patch.cmake
WORKING_DIRECTORY ${JPEG_SB_SRC}
DEPENDEES configure )
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
......
......@@ -11,7 +11,7 @@ if(USE_SYSTEM_TIFF)
else()
SETUP_SUPERBUILD(PROJECT ${proj})
message(STATUS " Using libtiff SuperBuild version")
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} ZLIB JPEG)
......@@ -29,78 +29,29 @@ else()
list(APPEND TIFF_SB_CONFIG "--with-jpeg-lib-dir=${SB_INSTALL_PREFIX}/lib")
endif()
if(MSVC)
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.opt ${CMAKE_BINARY_DIR}/nmake_libtiff_extra.opt)
ExternalProject_Add(${proj}_build
PREFIX ${proj}
URL "http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz"
URL_MD5 d1d2e940dea0b5ad435f21f03d96dd72
SOURCE_DIR ${TIFF_SB_SRC}
BINARY_DIR ${TIFF_SB_SRC}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/nmake_libtiff_extra.opt ${TIFF_SB_SRC}/nmake.opt
CONFIGURE_COMMAND ""
BUILD_COMMAND nmake /f ${TIFF_SB_SRC}/Makefile.vc
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
${CMAKE_BINARY_DIR}/${proj}/_install
)
ExternalProject_Add(${proj}
PREFIX ${proj}/_install
DOWNLOAD_COMMAND ""
SOURCE_DIR ${proj}/_install
BINARY_DIR ${TIFF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz"
URL_MD5 d1d2e940dea0b5ad435f21f03d96dd72
SOURCE_DIR ${TIFF_SB_SRC}
BINARY_DIR ${TIFF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
DEPENDS ${${proj}_DEPENDENCIES}
CMAKE_CACHE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DTIFF_BUILD_DIR:STRING=${TIFF_SB_SRC}/libtiff
DEPENDS ${proj}_build
CMAKE_COMMAND
-DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
)
else()
ExternalProject_Add(${proj}
PREFIX ${proj}
URL "http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz"
URL_MD5 d1d2e940dea0b5ad435f21f03d96dd72
BINARY_DIR ${TIFF_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
# use 'env' because CTest launcher doesn't perform shell interpretation
${SB_ENV_CONFIGURE_CMD}
${TIFF_SB_BUILD_DIR}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-static=no
${TIFF_SB_CONFIG}
BUILD_COMMAND $(MAKE) bin_PROGRAMS=
INSTALL_COMMAND $(MAKE) install bin_PROGRAMS=
DEPENDS ${${proj}_DEPENDENCIES}
)
ExternalProject_Add_Step(${proj} copy_source
COMMAND ${CMAKE_COMMAND} -E copy_directory
${TIFF_SB_SRC} ${TIFF_SB_BUILD_DIR}
DEPENDEES patch update
DEPENDERS configure
)
endif()
set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
if(WIN32)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff_i.lib)
elseif(UNIX)
set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif()
endif()
......@@ -153,6 +153,9 @@ option(OTB_WRAP_JAVA "Enable java wrappers for OTB applications (requires SWIG)"
option(GENERATE_XDK "Generate an .run with all dependencies. supported only on Linux" OFF)
configure_file(${CMAKE_SOURCE_DIR}/CMake/CTestCustom.cmake.in
${CMAKE_BINARY_DIR}/CTestCustom.cmake @ONLY)
# do a system checkup
if (NOT EXISTS "${CMAKE_BINARY_DIR}/CMake/SystemCheckup")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/CMake/SystemCheckup")
......
FILE(READ ${CMAKE_SOURCE_DIR}/sharedlib/CMakeLists.txt cmake_lists_orig)
string( REPLACE "-DUSE_SETMODE" "" cmake_lists_patch ${cmake_lists_orig})
file(WRITE ${CMAKE_SOURCE_DIR}/sharedlib/CMakeLists.txt "${cmake_lists_patch}")
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