Commit 679695bb authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch 'develop'

Conflicts:
	SuperBuild/CMake/External_jpeg.cmake
	SuperBuild/CMake/External_package.cmake
	SuperBuild/CMake/External_pkgtools.cmake
	SuperBuild/CMake/Package_Macro.cmake
	SuperBuild/CMake/pkgsetup.in
	SuperBuild/CMakeLists.txt
parents 1fe086da 9808e5f6
syntax: glob
*~
.*.swp
*.orig
*.pyc
.\#*
\#*\#
tags
*vim*
*.template
language: cpp
sudo: false
compiler:
- clang
addons:
apt:
packages:
- libqt4-dev
- libqtcore4
- libqtgui4
before_script:
- export SOURCE_DIR=$PWD
- cd /tmp
- wget https://cmake.org/files/v3.4/cmake-3.4.0-rc3-Linux-x86_64.tar.gz --no-check-certificate
- tar -xzf cmake-3.4.0-rc3-Linux-x86_64.tar.gz
- wget https://github.com/martine/ninja/releases/download/v1.6.0/ninja-linux.zip --no-check-certificate
- unzip ninja-linux.zip
- wget https://www.orfeo-toolbox.org/packages/xdk/OTB-xdk-Linux64.run --no-check-certificate
- chmod +x /tmp/OTB-xdk-Linux64.run
- /tmp/OTB-xdk-Linux64.run
- cd $SOURCE_DIR/../
- mkdir build
- cd build
script: /tmp/cmake-3.4.0-rc3-Linux-x86_64/bin/cmake -DCMAKE_MAKE_PROGRAM=/tmp/ninja -DCMAKE_CXX_FLAGS="-Wno-gnu -Wno-unused-parameter -Wno-overloaded-virtual -Wno-\\#warnings" -DCMAKE_PREFIX_PATH=/tmp/OTB-xdk-Linux64 -DCMAKE_INSTALL_PREFIX=../install -G "Ninja" $SOURCE_DIR && /tmp/ninja
\ No newline at end of file
......@@ -45,7 +45,6 @@ set(CTEST_CUSTOM_COVERAGE_EXCLUDE
set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
"vcl_deprecated_header"
"backward_warning"
"warning LNK4221"
"ranlib:.*file:.*has no symbols"
......@@ -63,5 +62,27 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
# Ignore clang's summary warning, assuming prior text has matched some
# other warning expression:
"[0-9,]+ warnings? generated."
".*include.opencv2.*warning.*"
".*include.opencv2.*note.*"
".*include.kml.*warning.*"
".*include.ogr_feature.*warning.*"
".*include.ogr_feature.*note.*"
".*itksys.SharedForward.h.*warning.*"
".*vcl_deprecated_header.h.*"
".*otbCurlHelper.cxx:.*warning.*maxConnect.*"
".*include.ITK-4.*warning.*"
".*include.curl.curl.h.*warning.*"
".*include.ossim.*warning.*"
".*include.ossim.*note.*"
".*include.ogr_core.h.*warning.*"
".*include.ogr_srs_api.h.*warning.*"
".*include.ogrsf_frmts.h.*warning.*"
".*include.ogr_geometry.h.*warning.*"
".*include.ogr_spatialref.h.*warning.*"
".*include.cpl_error.h.*warning.*"
".*vnl.vnl_numeric_traits.h.*warning.*"
".*vcl_config_compiler.h.*warning.*"
".*boost.move.unique_ptr.hpp:.*"
".*include.mpValue.h.*[Ww]arning.*\\[-Wc\\+\\+11-extensions\\]"
".*itksys.SharedForward.h.*warning.*itksys_shared_forward_to_real.*"
)
# - Find Numpy
# Find the native numpy includes
#
# NUMPY_FOUND - True if Numpy headers are found.
# NUMPY_INCLUDE_DIR - where to find numpy/arrayobject.h, etc.
EXEC_PROGRAM ("${PYTHON_EXECUTABLE}"
ARGS "${CMAKE_SOURCE_DIR}/CMake/otbTestNumpy.py"
OUTPUT_VARIABLE NUMPY_INCLUDE_DIR
RETURN_VALUE NUMPY_NOT_FOUND)
if( NUMPY_INCLUDE_DIR MATCHES "Traceback" )
# Did not successfully include numpy
set( NUMPY_INCLUDE_DIR )
else()
set( NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_DIR} CACHE STRING "Numpy include path." )
endif()
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( Numpy DEFAULT_MSG NUMPY_INCLUDE_DIR )
mark_as_advanced( NUMPY_INCLUDE_DIR )
if(NUMPY_FOUND)
set(NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR})
else()
set(NUMPY_INCLUDE_DIRS)
endif()
......@@ -28,6 +28,23 @@ else()
endif()
endif()
# Parse a certain header to check if SVN revision is 23537
if(EXISTS "${OSSIM_INCLUDE_DIR}/ossim/imaging/ossimImageRenderer.h")
file(STRINGS "${OSSIM_INCLUDE_DIR}/ossim/imaging/ossimImageRenderer.h" _ossim_image_renderer_h_CONTENTS REGEX "^// \\$Id: ossimImageRenderer\\.h [0-9.]+ ")
string(REGEX REPLACE ".*ossimImageRenderer\\.h ([0-9.]+) .*" "\\1" _ossim_svn_revision_hint "${_ossim_image_renderer_h_CONTENTS}")
if(NOT "${_ossim_svn_revision_hint}" STREQUAL "23537")
message(WARNING "The OSSIM version found doesn't correspond to SVN revision 23537 (the recommended revision for OTB)."
"There are known issues with version 1.8.16 (bugs in Sentinel1 "
"calibration) and with official archive 1.8.20-1 (RpcModel returns "
"nans outside the image extent)")
endif()
#message(STATUS "OSSIM SVN rev. hint : ${_ossim_svn_revision_hint}")
else()
if(NOT Ossim_FIND_QUIETLY)
message(WARNING "ossimImageRenderer.h not found !")
endif()
endif()
find_library(OSSIM_LIBRARY
NAMES ossim)
......
macro(package_mingw)
cmake_parse_arguments(PACKAGE "" "PREFIX_DIR;ARCH;MXEROOT" "SEARCHDIRS;PEFILES" ${ARGN} )
cmake_parse_arguments(PACKAGE "" "PREFIX_DIR;ARCH;MXEROOT;WITH_OTBGUI" "SEARCHDIRS;PEFILES" ${ARGN} )
list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherCommandLine.exe)
list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbTestDriver.exe)
if(PACKAGE_WITH_OTBGUI)
list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherQt.exe)
endif()
### ${PACKAGE_EXENAME} #name of executable
#${PACKAGE_ARCH} #x86/x64
#${PACKAGE_SEARCHDIRS}
####set(PACKAGE_PREFIX_DIR "mingw")
if("${PACKAGE_ARCH}" STREQUAL "x86")
set(MXE_BIN_DIR "${PACKAGE_MXEROOT}/usr/i686-w64-mingw32.shared/bin")
set(MXE_OBJDUMP "${PACKAGE_MXEROOT}/usr/bin/i686-w64-mingw32.shared-objdump")
......@@ -20,11 +21,11 @@ macro(package_mingw)
list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/bin") #mvd
list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/lib/otb/applications") #otb apps
install_common()
install_common(${PACKAGE_WITH_OTBGUI})
file(GLOB otbapps_list ${CMAKE_INSTALL_PREFIX}/lib/otb/applications/otbapp_*dll) # /lib/otb
list(APPEND PACKAGE_PEFILES ${otbapps_list})
set(alldlls)
set(notfound_dlls)
foreach(infile ${PACKAGE_PEFILES})
......@@ -38,7 +39,7 @@ macro(package_mingw)
message(FATAL_ERROR "Following dlls were not found: ${notfound}
Please consider adding their paths to SEARCHDIRS when calling package_mingw macro.")
endif()
endmacro(package_mingw)
SET(SYSTEM_DLLS
......@@ -91,7 +92,7 @@ endmacro()
function(process_deps infile)
get_filename_component(bn ${infile} NAME)
list_contains(contains "${bn}" "${alldlls}")
if(NOT contains)
set(DLL_FOUND FALSE)
......@@ -99,7 +100,7 @@ function(process_deps infile)
if(NOT DLL_FOUND)
if(EXISTS ${SEARCHDIR}/${infile})
set(DLL_FOUND TRUE)
message(STATUS "Processing ${SEARCHDIR}/${infile}")
if(NOT "${infile}" MATCHES "otbapp")
install(
......@@ -113,7 +114,7 @@ function(process_deps infile)
endif()
execute_process(COMMAND ${MXE_OBJDUMP} "-p" "${SEARCHDIR}/${infile}" OUTPUT_VARIABLE dlldeps)
string(REGEX MATCHALL "DLL.Name..[A-Za-z(0-9\\.0-9)+_\\-]*" OUT "${dlldeps}")
string(REGEX REPLACE "DLL.Name.." "" OUT "${OUT}")
string(REGEX REPLACE "DLL.Name.." "" OUT "${OUT}")
foreach(o ${OUT})
process_deps(${o})
endforeach()
......@@ -127,15 +128,15 @@ function(process_deps infile)
set(notfound_dlls "${notfound_dlls};${infile}")
endif()
else(NOT DLL_FOUND)
set( alldlls "${alldlls};${bn}" PARENT_SCOPE )
set( alldlls "${alldlls};${bn}" PARENT_SCOPE )
endif(NOT DLL_FOUND)
set(notfound_dlls "${notfound_dlls}" PARENT_SCOPE )
set(notfound_dlls "${notfound_dlls}" PARENT_SCOPE )
endif()
endfunction()
function(install_common)
function(install_common with_otbgui)
set(APP_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")
set(APP_BIN_DIR "${APP_PREFIX_DIR}/bin")
set(APP_OTBLIBS_DIR "${APP_PREFIX_DIR}/lib/otb")
......@@ -158,7 +159,7 @@ function(install_common)
if(NOT OTB_APPS_LIST)
message(FATAL_ERROR "No OTB-applications detected")
endif()
## otb apps dir /lib/otb/applications
install(
DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/otb/applications"
......@@ -171,7 +172,7 @@ function(install_common)
DESTINATION ${APP_BIN_DIR})
endforeach()
if(OTB_USE_QT4)
if(with_otbgui)
file(GLOB GUI_SCRIPTS ${CMAKE_INSTALL_PREFIX}/bin/otbgui*)
foreach(GUI_SCRIPT ${GUI_SCRIPTS})
install(
......@@ -181,5 +182,4 @@ function(install_common)
endif()
endfunction()
endfunction()
......@@ -23,7 +23,7 @@ add_custom_target( OTBHeaderTests
SET(BANNED_HEADERS)
if(NOT OTB_USE_OPENCV)
SET(BANNED_HEADERS "${BANNED_HEADERS} otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h")
SET(BANNED_HEADERS "${BANNED_HEADERS} otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h otbOpenCVUtils.h otbCvRTreesWrapper.h")
endif()
if(NOT OTB_USE_LIBSVM)
......
......@@ -132,6 +132,23 @@ endfunction()
macro(check_compiler_platform_flags)
# Since CMake 2.8.11, the size of the stack is not modified by CMake on
# windows platform, it uses the default size: with visual compiler it is 1Mbyte
# which is to lower for us (thanks to 6S code).
if(MSVC)
if (${CMAKE_VERSION} VERSION_GREATER "2.8.10.2")
if("${CMAKE_EXE_LINKER_FLAGS}" MATCHES "/STACK:[0-9]+")
message(STATUS "The size of the stack is already defined, so we dont't modified it.")
else()
set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} /STACK:10000000")
message(STATUS "The stack size is set to 10 Mbytes (/STACK:10000000).")
endif()
endif() #if (${CMAKE_VERSION..
elseif(MINGW)
set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} -Wl,--stack,10000000")
message(STATUS "The stack size is set to 10 Mbytes (-Wl,--stack,10000000).")
endif() # if(MSVC)
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings
if(WIN32)
......
if(EXISTS "${PROJECT_SOURCE_DIR}/.hg")
find_package(Mercurial)
if(Mercurial_FOUND)
message(STATUS "Repository status :")
......@@ -16,11 +17,55 @@ if(Mercurial_FOUND)
string(REGEX REPLACE "\n" ";" OTB_WC_STATUS "${OTB_WC_STATUS}")
set(OTB_WC_STATUS ${OTB_WC_STATUS} CACHE STRING "Repository status" FORCE)
mark_as_advanced(OTB_WC_STATUS)
endif()
endif()
if(OTB_DATA_ROOT)
Mercurial_WC_IDENTIFY(${OTB_DATA_ROOT} OTB_DATA)
set(OTB_DATA_WC_REVISION ${OTB_DATA_WC_REVISION} CACHE STRING "Repository version" FORCE)
mark_as_advanced(OTB_DATA_WC_REVISION)
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE OTB_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} status -s
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE OTB_WC_STATUS
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
message(STATUS "Repository status :")
message(STATUS " Repository revision is ${OTB_WC_REVISION}")
if(OTB_WC_STATUS)
message(STATUS " Local file modifications:")
string(REPLACE "\n" "\n-- " OTB_WC_STATUS_PRETTYPRINT " ${OTB_WC_STATUS}")
message(STATUS "${OTB_WC_STATUS_PRETTYPRINT}")
else()
message(STATUS " No files modified locally")
endif()
endif()
endif()
if(OTB_DATA_ROOT)
if(EXISTS "${OTB_DATA_ROOT}/.hg")
if(NOT Mercurial_FOUND)
find_package(Mercurial)
endif()
if(Mercurial_FOUND)
Mercurial_WC_IDENTIFY(${OTB_DATA_ROOT} OTB_DATA)
set(OTB_DATA_WC_REVISION ${OTB_DATA_WC_REVISION} CACHE STRING "Repository version" FORCE)
mark_as_advanced(OTB_DATA_WC_REVISION)
endif()
endif()
if(EXISTS "${OTB_DATA_ROOT}/.git")
if(NOT GIT_FOUND)
find_package(Git)
endif()
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H
WORKING_DIRECTORY ${OTB_DATA_ROOT}
OUTPUT_VARIABLE OTB_DATA_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
set(OTB_DATA_WC_REVISION ${OTB_DATA_WC_REVISION} CACHE STRING "Repository version" FORCE)
mark_as_advanced(OTB_DATA_WC_REVISION)
endif()
endif()
endif()
import numpy
print numpy.get_include()
......@@ -6,7 +6,8 @@ endif()
foreach(p
CMP0025 # CMake 3.0
CMP0042 # CMake 3.0
CMP0042 # CMake 3.0
CMP0058
)
if(POLICY ${p})