Commit bb852187 authored by Rashad Kanavath's avatar Rashad Kanavath

Merge remote-tracking branch 'origin/develop' into rfc-35-superbuild-gdal

parent 697470f7
language: cpp
sudo: false
dist: trusty
compiler:
- clang
addons:
apt:
packages:
- libqt4-dev
- libqtcore4
- libqtgui4
cache: false
before_script:
- export MAKE_CMD=/tmp/ninja
- export CMAKE_GEN='Ninja'
- cd /tmp
- wget https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz --no-check-certificate
- tar -xzf cmake-3.4.1-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-5.2/OTB-5.2.0-xdk-Linux64.run --no-check-certificate
- chmod +x /tmp/OTB-5.2.0-xdk-Linux64.run
- /tmp/OTB-5.2.0-xdk-Linux64.run
script: /tmp/cmake-3.4.1-Linux-x86_64/bin/ctest -VV -S /home/travis/build/orfeotoolbox/OTB/Utilities/Maintenance/TravisBuild.cmake
script: Utilities/Maintenance/TravisBuild.sh
......@@ -606,10 +606,10 @@ otb_test_application(NAME apTvClKMeansImageClassification
-maxit 10000
-ct 0.0000001
-rand 121212
-out ${TEMP}/apTvClKMeansImageClassificationFilterOuptut.tif
-out ${TEMP}/apTvClKMeansImageClassificationFilterOutput.tif
VALID --compare-image ${NOTOL}
${OTBAPP_BASELINE}/apTvClKMeansImageClassificationFilterOuptut.tif
${TEMP}/apTvClKMeansImageClassificationFilterOuptut.tif )
${OTBAPP_BASELINE}/apTvClKMeansImageClassificationFilterOutput.tif
${TEMP}/apTvClKMeansImageClassificationFilterOutput.tif )
#----------- TrainImagesClassifier TESTS ----------------
......
......@@ -201,6 +201,8 @@ private:
}
catch(itk::ExceptionObject& err)
{
//trick to prevent unreferenced local variable warning on MSVC
(void)err;
// silent catch
useContext = false;
}
......
......@@ -73,7 +73,7 @@ private:
AddParameter(ParameterType_InputVectorData, "in", "Input vector dataset");
SetParameterDescription( "in", "The input vector dataset to be rasterized" );
AddParameter(ParameterType_OutputImage, "out", "Ouptut image");
AddParameter(ParameterType_OutputImage, "out", "Output image");
SetParameterDescription( "out", "An output image containing the rasterized vector dataset" );
AddParameter(ParameterType_InputImage, "im", "Input reference image");
......
......@@ -154,7 +154,7 @@ NeighborhoodScalarProductFilter<TInputImage, TOutputModulus, TOutputDirection>
angle -= CONST_PI;
}
// Set the ouptut values
// Set the output values
outputIt.Set(scalarMaxValue);
outputDirIt.Set(angle);
++neighInputIt;
......
......@@ -265,7 +265,7 @@ OverlapSaveConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
norm = 1.0;
}
// Fill the ouptut image
// Fill the output image
outputIt.GoToBegin();
while (!outputIt.IsAtEnd())
{
......
......@@ -198,7 +198,7 @@ public:
void SetOutputParametersFromImage(const ImageBaseType * image);
/** Useful to set output parmaters form an existing image with type
* different from input or ouptut image
* different from input or output image
*/
template <class TImageType> void SetOutputParametersFromImage(const TImageType * image);
......
......@@ -34,7 +34,7 @@ int otbGenericRSTransformGenericTest(int argc, char * argv[])
{
if(argc<14)
{
std::cerr<<"Usage: "<<argv[0]<<"input_point_x input_point_y output_point_x output_point_y input_projection_type[IMAGE, WKT, EPSG] input_projection_source output_projection_type[IMAGE, WKT, EPSG] output_projection_source input_distance[PHYSICAL, GEO] input_threshold output_distance[PHYSICAL, GEO] ouptut_threshold elevation_flag[NOELEV, AVERAGE, DEM] elevation_source";
std::cerr<<"Usage: "<<argv[0]<<"input_point_x input_point_y output_point_x output_point_y input_projection_type[IMAGE, WKT, EPSG] input_projection_source output_projection_type[IMAGE, WKT, EPSG] output_projection_source input_distance[PHYSICAL, GEO] input_threshold output_distance[PHYSICAL, GEO] output_threshold elevation_flag[NOELEV, AVERAGE, DEM] elevation_source";
return EXIT_FAILURE;
}
......
......@@ -54,7 +54,14 @@ int otbGDALOverviewsBuilder(int itkNotUsed(argc), char* argv[])
otb::GDALImageIO::Pointer io = otb::GDALImageIO::New();
io->SetFileName(inputFilename);
io->CanReadFile(inputFilename);
bool canRead = io->CanReadFile(inputFilename);
if(!canRead)
{
std::cerr<<"Failed to read file "<< inputFilename <<" with GdalImageIO."<<std::endl;
return EXIT_FAILURE;
}
io->ReadImageInformation();
//std::cout << io->GetOverviewsCount() << std::endl;
......
......@@ -28,11 +28,11 @@ otb_add_test(NAME leTvDecisionTreeWithRealValues COMMAND otbLearningBaseTestDriv
otb_add_test(NAME leTvKMeansImageClassificationFilter COMMAND otbLearningBaseTestDriver
--compare-image ${NOTOL}
${BASELINE}/leKMeansImageClassificationFilterOuptut.hdr
${TEMP}/leKMeansImageClassificationFilterOuptut.hdr
${BASELINE}/leKMeansImageClassificationFilterOutput.hdr
${TEMP}/leKMeansImageClassificationFilterOutput.hdr
otbKMeansImageClassificationFilter
${INPUTDATA}/poupees_sub.png
${TEMP}/leKMeansImageClassificationFilterOuptut.hdr
${TEMP}/leKMeansImageClassificationFilterOutput.hdr
2
0 0 0 0
255 255 255 255
......
......@@ -41,11 +41,11 @@ otb_add_test(NAME leTvSOM COMMAND otbSOMTestDriver
otb_add_test(NAME leTvSOMImageClassificationFilter COMMAND otbSOMTestDriver
--compare-image ${NOTOL}
${BASELINE}/leSOMPoupeesClassified.hdr
${TEMP}/leSOMImageClassificationFilterOuptut.hdr
${TEMP}/leSOMImageClassificationFilterOutput.hdr
otbSOMImageClassificationFilter
${INPUTDATA}/poupees_sub.png
${BASELINE}/leSOMPoupeesSubOutputMap1.hdr
${TEMP}/leSOMImageClassificationFilterOuptut.hdr
${TEMP}/leSOMImageClassificationFilterOutput.hdr
)
otb_add_test(NAME leTvSOMActivationBuilder COMMAND otbSOMTestDriver
......@@ -112,11 +112,11 @@ otb_add_test(NAME leTvSOMClassifier COMMAND otbSOMTestDriver
otb_add_test(NAME leTvSOMbasedImageFilter COMMAND otbSOMTestDriver
--compare-image ${NOTOL}
${BASELINE}/leSOMbasedImageFilterOuptut.hdr
${TEMP}/leSOMbasedImageFilterOuptut.hdr
${BASELINE}/leSOMbasedImageFilterOutput.hdr
${TEMP}/leSOMbasedImageFilterOutput.hdr
otbSOMbasedImageFilterTest
${INPUTDATA}/poupees_sub.png
${BASELINE}/leSOMPoupeesSubOutputMap1.hdr
${TEMP}/leSOMbasedImageFilterOuptut.hdr
${TEMP}/leSOMbasedImageFilterOutput.hdr
)
......@@ -62,9 +62,10 @@ public:
protected:
/** Constructor */
PolygonClassStatisticsAccumulator() {}
PolygonClassStatisticsAccumulator();
/** Destructor */
virtual ~PolygonClassStatisticsAccumulator() {}
virtual ~PolygonClassStatisticsAccumulator();
private:
//Number of pixels in all the polygons
......
......@@ -21,6 +21,15 @@
namespace otb
{
PolygonClassStatisticsAccumulator::PolygonClassStatisticsAccumulator() :
m_NbPixelsGlobal(0UL),
m_ElmtsInClass(),
m_Polygon()
{}
PolygonClassStatisticsAccumulator::~PolygonClassStatisticsAccumulator()
{}
void
PolygonClassStatisticsAccumulator
::Reset()
......
......@@ -133,7 +133,7 @@ ImageMultiSegmentationToRCC8GraphFilter<TInputImage, TOutputGraph>
// Input image list pointer
InputImageListPointerType segList = this->GetInput();
// Ouptut graph pointer
// Output graph pointer
OutputGraphPointerType graph = this->GetOutput();
// invert value vector
......
......@@ -179,7 +179,7 @@ void
PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph>
::BeforeThreadedGenerateData()
{
// Ouptut graph pointer
// Output graph pointer
OutputGraphPointerType graph = this->GetOutput();
PolygonListConstPointerType inputPtr = this->GetInput();
......@@ -227,7 +227,7 @@ PolygonListToRCC8GraphFilter<TPolygonList, TOutputGraph>
{
//std::cout<<"Starting thread "<<threadId <<" to work on range ["<<startIndex<<", "<<stopIndex<<"]"<<std::endl;
// Ouptut graph pointer
// Output graph pointer
OutputGraphPointerType graph = this->GetOutput();
PolygonListConstPointerType inputPtr = this->GetInput();
......
......@@ -53,10 +53,10 @@ otb_add_test(NAME srTvRCC8GraphIOEndToEnd COMMAND otbRCC8TestDriver
otb_add_test(NAME srTvPolygonListToRCC8GraphFilter COMMAND otbRCC8TestDriver
--compare-ascii ${NOTOL}
${BASELINE_FILES}/srTvPolygonListToRCC8GraphFilterOuptut.dot
${TEMP}/srTvPolygonListToRCC8GraphFilterOuptut.dot
${BASELINE_FILES}/srTvPolygonListToRCC8GraphFilterOutput.dot
${TEMP}/srTvPolygonListToRCC8GraphFilterOutput.dot
otbPolygonListToRCC8GraphFilter
${TEMP}/srTvPolygonListToRCC8GraphFilterOuptut.dot)
${TEMP}/srTvPolygonListToRCC8GraphFilterOutput.dot)
otb_add_test(NAME srTvRCC8VertexBase COMMAND otbRCC8TestDriver
otbRCC8VertexBase
......
......@@ -33,7 +33,7 @@ namespace otb
*
* It uses the ITK registration framework locally for each point and thus
* provides the flexibility of this framework. The parameters of each transform
* are stored in the ouptut point set associated data. Optimizer, metric,
* are stored in the output point set associated data. Optimizer, metric,
* interpolator and transform fixed parameters have to be set by the user.
*
* This filters returns the pointset enriched with a set of value as PointData, in order of apparition :
......@@ -77,7 +77,7 @@ public:
typedef typename MovingImageType::Pointer MovingImagePointerType;
typedef typename MovingImageType::PixelType MovingPixelType;
/** Typedef for the input and ouptut point set */
/** Typedef for the input and output point set */
typedef TPointSet PointSetType;
typedef typename PointSetType::Pointer PointSetPointerType;
......
......@@ -284,7 +284,7 @@ StereoSensorModelToElevationFilter<TInputImage, TOutputHeight>
rsTransform->SetInputKeywordList(outputPtr->GetImageKeywordlist());
rsTransform->InstanciateTransform();
// Fill ouptut
// Fill output
itk::ImageRegionIteratorWithIndex<OutputImageType> outputIt(outputPtr, outputPtr->GetBufferedRegion());
for(outputIt.GoToBegin(); !outputIt.IsAtEnd(); ++outputIt)
......
......@@ -4877,7 +4877,7 @@ L34:
*/
/* c
*/
/* irapp that input parameter allows to activate atmospheric c
/* irapp that input parameter allows activating atmospheric c
*/
/* correction mode c
*/
......
......@@ -2163,7 +2163,7 @@ c**********************************************************************c
c**********************************************************************c
c c
c irapp that input parameter allows to activate atmospheric c
c irapp that input parameter allows activating atmospheric c
c correction mode c
c c
c -1: No atmospheric Correction is performed c
......
......@@ -3617,7 +3617,7 @@ rguments*/
*/
/* c
*/
/* irapp that input parameter allows to activate atmospheric c
/* irapp that input parameter allows activating atmospheric c
*/
/* correction mode c
*/
......
......@@ -2282,7 +2282,7 @@ C_otb_adaptation End: inhomo=0 idirec=0 igroun=0 ro=0
c**********************************************************************c
c c
c irapp that input parameter allows to activate atmospheric c
c irapp that input parameter allows activating atmospheric c
c correction mode c
c c
c -1: No atmospheric Correction is performed c
......
......@@ -698,11 +698,13 @@ GlView
// as 1:1 reference).
//
// MANTIS-1202
//
// MANTIS-1203: restore sign of axis when applying isotrop spacing.
// {
if( vcl_abs( spacing[ 0 ] ) < vcl_abs( spacing[ 1 ] ) )
spacing[ 1 ] = spacing[ 0 ];
spacing[ 1 ] = ( spacing[ 1 ]<0.0 ? -1 : +1 ) * vcl_abs( spacing[ 0 ] );
else
spacing[ 0 ] = spacing[ 1 ];
spacing[ 0 ] = ( spacing[ 0 ]<0.0 ? -1 : +1 ) * vcl_abs( spacing[ 1 ] );
// }
// MANTIS-1202
......
......@@ -71,6 +71,8 @@ void FragmentShaderRegistry::RegisterShader(const std::string& name, const std::
char * logs = new char[length];
glGetShaderInfoLog(shader,1000,&length,logs);
std::string slogs = logs;
delete [] logs;
// For safety!
logs = NULL;
......@@ -83,7 +85,7 @@ void FragmentShaderRegistry::RegisterShader(const std::string& name, const std::
glDeleteProgram( program );
program = 0;
itkExceptionMacro(<<"Shader "<<name<<" with sources "<<source<<" failed to compile: "<<logs);
itkExceptionMacro(<<"Shader "<<name<<" with sources "<<source<<" failed to compile: "<<slogs);
}
glAttachShader(program,shader);
......
......@@ -348,7 +348,6 @@ void GlImageActor::Render()
mins.Fill(0);
maxs.Fill(255);
bool useNoData(false);
double noData(0.);
assert( !m_ImageSettings.IsNull() );
......@@ -367,12 +366,14 @@ void GlImageActor::Render()
gamma =
gamma == 0.0
? std::numeric_limits< double >::max()
: 1.0 / gamma;
? std::numeric_limits< double >::max()
: 1.0 / gamma;
// }
if( m_ImageSettings->GetUseNoData() )
noData = m_ImageSettings->GetNoData();
noData = m_ImageSettings->GetNoData();
omins.Fill( 0 );
omaxs.Fill( 255 );
......@@ -405,7 +406,7 @@ void GlImageActor::Render()
++idx;
buffer[idx] = 255;
if(useNoData && (inIt.Get()[0] == noData ||inIt.Get()[1] == noData ||inIt.Get()[2] == noData))
if(m_ImageSettings->GetUseNoData() && (inIt.Get()[0] == noData ||inIt.Get()[1] == noData ||inIt.Get()[2] == noData))
{
buffer[idx] = 0;
}
......
......@@ -83,6 +83,11 @@ int main(int argc, char * argv[])
std::cerr << "Could not open file " << argv[i] << " as an image or a vector, skipping." << std::endl;
}
}
catch(std::runtime_error & err)
{
std::cerr<<"Runtime error: "<< err.what() <<std::endl;
return EXIT_FAILURE;
}
}
std::cout<<"Press F1 for help"<<std::endl;
......
......@@ -1642,7 +1642,7 @@ void IceViewer::CopyActorStyle(otb::GlActor::Pointer srcActor, otb::GlActor::Poi
otb::GlImageActor::Pointer srcImgActor = dynamic_cast<otb::GlImageActor*>(srcActor.GetPointer());
otb::GlImageActor::Pointer dstImgActor = dynamic_cast<otb::GlImageActor*>(dstActor.GetPointer());
if(srcActor.IsNotNull() && srcActor->GetVisible() && dstImgActor.IsNotNull() && dstActor->GetVisible())
if(srcImgActor.IsNotNull() && srcActor->GetVisible() && dstImgActor.IsNotNull() && dstActor->GetVisible())
{
ImageSettings::Pointer srcImageSettings( srcImgActor->GetImageSettings() );
assert( !srcImageSettings.IsNull() );
......
OTB-v.5.4.0 - Changes since version 5.2.1 (2016/03/30)
OTB-v.5.4.0 - Changes since version 5.2.1 (2016/05/04)
------------------------------------------
* Bugs fixed:
* 0001137: GDALImageIO does not support SENTINEL2 sub-datasets
* 0001142: Fails to build with ITK 4.9.0 (itksys/FundamentalType.h: No such file or directory)
* 0001151: GDAL_SB_EXTRA_OPTIONS can not take multiple options
* 0001150: Can't "easily" deactivate LIBKML from OTB Superbuild
* BUG: Report the correct number of components per pixel in ImportGeoInformationImageFilter
* 0001153: Superimpose app in PHR mode reports wrong origin/spacing/keywordlist
* BUG: Enabling KMeans with more than 255 clusters
* 0001154: Exception raised when opening LUM or LUM+HDR
* 0001157: monteverdi crashes when trying to move the view without any images
* 0001143: Patch for various spelling errors
* RFC:
* Request for Changes-20: Take screenshot
* Request for Changes-21: Support CDS import
* Request for Changes-22: Add Masked Iterator Decorator
* Request for Changes-23: Ice as an Orfeo ToolBox module
* Request for Changes-25: Disable Ice shaders if OpenGL version is lower than 2.0
* Request for Changes-27: Merge Software Guide into OTB
* Request for Changes-28: Remove random contributor list functionality
* Request for Changes-29: Sampling Framework - Polygon analysis
* Request for Changes-30: Faster resampling filter
* Request for Changes-31: Modified behavior of reading/writing of TIFF RPC tags
* Request for Changes-32: Allow a module to be built outside the OTB source tree
* Request for Changes-33: Green dashboard cleaning part 1
* Request for Changes-34: Enhancement of SARDecompositions : Barnes, Huynen, Pauli decompositions
* Request for Changes-24: MVD/OTB GDAL overviews multi-resolution pyramid configuration
* Core
* Ice is now a regular OTB module (RFC 23)
* Masked iterator decorator (RFC 22)
* Filter to analyse polygons for available samples (part of new sampling framework, RFC 29)
* Faster resampling filter for rigid scaling and translation operations (RFC 30)
* Modified behavior of reading/writing of TIFF RPC tags (RFC 31)
* Allow a module to be built outside the OTB source tree (RFC 32)
* Dashboard cleaning, part 1 (RFC 33)
* Enhancement of SARDecompositions : Barnes, Huynen, Pauli decompositions (RFC 34)
* Monteverdi
* Take screenshot of current display (RFC 20)
* Allow subdatasets import (RFC 21)
* Disable GLSL shader if OpenGL version is lower than 2.0 (RFC 25)
* Allow generation of gdal overviews when importing images (RFC 24)
* Documentation:
* Merge software guide into main OTB repository (RFC 17)
* Remove random contributor list generation (RFC 28)
* SuperBuild:
* Add Monteverdi and its dependencies (glfw, GLEW, glut)
* Bug fixed
* Monteverdi2
* 0001179: Using the Upper Bound mode for resolution lookup in preferences result in wrong resolution used
* 0001197: Clicking on minimap to navigate result in monteverdi crashing
* 0001178: Zoom to full resolution does not zoom to 1 image pixel = 1 screen pixel for georeferenced data
* 0001203: Clicking on 1:1 button several time result in strange cycling behaviour
* 0001205: Gamma slider effect inverted between full and quicklook view
* 0001202: Wrong aspect ratio at loading
* 0001148: OTB-applications not loaded
* 0001196: OTB-application Quit button closes widget but not window when using Mapla
* 0001147: With Monteverdi develop branch of today : opening large images with overview file leads to eating all available memory
* 0001138: Numeric value editing hell
* 0001136: Unable to open sensor products (with RPC) in Monteverdi
* 0001159: TrainImageClassifier sample.vtr parameter is sometime ignored
* 0001173: KDE grabs drag event before monteverdi, making image navigation impossible
* 0001144: Unable to keep unconstrained dynamic mode
* 0001156: Linux standalone package doesn't work on Fedora 22
* 0001157: monteverdi crashes when trying to move the view without any images
* 0001153: Superimpose app in PHR mode reports wrong origin/spacing/keywordlist
* 0001154: Exception raised when opening LUM or LUM+HDR
* 0001152: maximum number of class in KMean application limited to 255
* 0001140: Lost pixel position informations in layer stack
* OTB-Packaging
* 0001141: muparser 2.2.4 is missing in superbuild archive 5.2.1
* 0001171: Crash in OGR : libproj-0.dll not found
* 0001150: Can't "easily" deactivate LIBKML from OTB Superbuild
* Orfeo Toolbox (OTB)
* 0001206: Cannot maximize monteverdi window in standalone package
* 0001177: SuperBuild fails at MVD configure step (release-5.4 branch)
* 0001194: freeglut required x11 extension on osx
* 0001188: deactivate openldap, openssl, libssh2 when building superbuild curl.
* 0001190: use same compiler for all builds in the superbuild
* 0001184: superbuild libtiff is using libjbig from system without warning
* 0001185: minimal build of GDAL in superbuild
* 0001187: superbuild cannot find Qt4 during OTB configure on osx
* 0001193: deactivate finding osx framework for library
* 0001163: Windows MinGW packages do not contain the libsvm classifier
* 0001164: Monteverdi crashes when opening a tif without projection information
* 0001167: GUI applications visual response after clicking the "Execute" button is slow and confusing
* 0001158: Missing field in RefineSensorModel statistics file
* 0001166: otbgui_MeanShiftSmoothing problem with Mode Search parameter
* 0001169: add libsvm package to mxe and enable OTB_USE_LIBSVM
* 0001143: Patch for various spelling errors
* 0001151: GDAL_SB_EXTRA_OPTIONS can not take multiple options
* 0001142: Fails to build with ITK 4.9.0 (itksys/FundamentalType.h: No such file or directory)
* OTB-lib
* 0001145: Ice doesn't clamp rendered values to the specified minimum of the range
* 0001139: OGRLayerStreamStitchingFilter CommitTransaction fail is some cases
* 0001137: GDALImageIO does not support SENTINEL2 sub-datasets
* OTB-applications
* 0001149: ReadImageInfo application crash with Sentinel1 (SLC SM product)
* 0001162: Unable to perform Sentinel-1 SAR calibration on extract
* 0001183: Unable to edit image path in Qt GUI wrapper with complex image
* 0001182: Crash when editing InputImageParameter Qt widget
* 0001161: Inconsistency of SAR calibration applications denomination
OTB-v.5.2.1 - Changes since version 5.2.0 (2016/01/19)
------------------------------------------
* Bugs fixed:
......
if(NOT __EXTERNAL_PACKAGE_TOOLS__)
set(__EXTERNAL_PACKAGE_TOOLS__ 1)
set(PKGTOOLS_SB_PREFIX_DIR "${CMAKE_BINARY_DIR}/PACKAGE-TOOLS")
include(ExternalProject)
if( __EXTERNAL_PACKAGE_TOOLS__)
return()
else()
set(__EXTERNAL_PACKAGE_TOOLS__ 1)
endif()
if(WIN32)
add_custom_target(PACKAGE-TOOLS)
......@@ -11,9 +10,16 @@ if(WIN32)
endif()
if(UNIX AND NOT WIN32)
include(ExternalProject)
set(PKGTOOLS_SB_PREFIX_DIR "${CMAKE_BINARY_DIR}/PACKAGE-TOOLS")
if(APPLE)
add_custom_target(PATCHELF)
else()
set(PATCHELF_INSTALL_DIR ${PKGTOOLS_SB_PREFIX_DIR}/install-patchelf)
set(PATCHELF_PROGRAM ${PATCHELF_INSTALL_DIR}/patchelf)
ExternalProject_Add(PATCHELF
PREFIX "${PKGTOOLS_SB_PREFIX_DIR}"
URL "http://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2"
......@@ -23,14 +29,18 @@ if(UNIX AND NOT WIN32)
BINARY_DIR "${PKGTOOLS_SB_PREFIX_DIR}/build-patchelf"
TMP_DIR "${PKGTOOLS_SB_PREFIX_DIR}/tmp-patchelf"
STAMP_DIR "${PKGTOOLS_SB_PREFIX_DIR}/stamp-patchelf"
PATCH_COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/tools
PATCH_COMMAND ${CMAKE_COMMAND} -E make_directory ${PKGTOOLS_SB_PREFIX_DIR}/install
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E chdir ${PKGTOOLS_SB_PREFIX_DIR}/src-patchelf
./configure --prefix ${CMAKE_INSTALL_PREFIX}/tools
./configure --prefix ${PATCHELF_INSTALL_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${PKGTOOLS_SB_PREFIX_DIR}/src-patchelf ${CMAKE_MAKE_PROGRAM}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${PKGTOOLS_SB_PREFIX_DIR}/src-patchelf/src/patchelf ${CMAKE_INSTALL_PREFIX}/tools
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${PKGTOOLS_SB_PREFIX_DIR}/src-patchelf/src/patchelf ${PATCHELF_PROGRAM}
)
endif(APPLE)
set(MAKESELF_INSTALL_DIR ${PKGTOOLS_SB_PREFIX_DIR}/install-makeself)
set(MAKESELF_SCRIPT ${MAKESELF_INSTALL_DIR}/makeself.sh)
set(MAKESELF_HEADER_SCRIPT ${MAKESELF_INSTALL_DIR}/makeself-header.sh)
ExternalProject_Add(MAKESELF
PREFIX "${PKGTOOLS_SB_PREFIX_DIR}"
URL "https://www.orfeo-toolbox.org/packages/makeself-2.2.0.tar.gz"
......@@ -41,21 +51,15 @@ if(UNIX AND NOT WIN32)
TMP_DIR "${PKGTOOLS_SB_PREFIX_DIR}/tmp-makeself"
STAMP_DIR "${PKGTOOLS_SB_PREFIX_DIR}/stamp-makeself"
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_COMMAND}
-E copy
BUILD_COMMAND ${CMAKE_COMMAND} -E copy
${PKGTOOLS_SB_PREFIX_DIR}/src-makeself/makeself-header.sh
${PKGTOOLS_SB_PREFIX_DIR}/makeself-header.sh
INSTALL_COMMAND ${CMAKE_COMMAND}
-E copy
${MAKESELF_HEADER_SCRIPT}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy
${PKGTOOLS_SB_PREFIX_DIR}/src-makeself/makeself.sh
${PKGTOOLS_SB_PREFIX_DIR}/makeself.sh
${MAKESELF_SCRIPT}
DEPENDS PATCHELF
)
set(MAKESELF_SCRIPT ${PKGTOOLS_SB_PREFIX_DIR}/makeself.sh)
add_custom_target(PACKAGE-TOOLS DEPENDS MAKESELF)
endif(UNIX AND NOT WIN32)
endif() #idef guard
......@@ -101,6 +101,7 @@ else() #Unix like
endforeach(req)
endif()
set(EXTRA_CACHE_CONFIG)
if(WIN32)
set(CMAKE_INSTALL_PREFIX "${MONTEVERDI_INSTALL_DIR}")
......@@ -110,7 +111,17 @@ endif()
set(PACKAGE_NAME OTB)
set(PACKAGE_LONG_NAME OrfeoToolBox)
if(WIN32)
set(EXTRA_CACHE_CONFIG
"set(CMAKE_CROSSCOMPILING TRUE)
set(WIN32 TRUE)
set(MXE_ARCH \"${MXE_ARCH}\")
set(MXE_MXEROOT \"${MXE_MXEROOT}\")"
)
set(ITK_VERSION_STRING)
set(PACKAGE_PLATFORM_NAME "win")
if(MXE_TARGET_DIR MATCHES "i686")
set(MXE_ARCH "i686")
......@@ -122,6 +133,7 @@ if(WIN32)
get_filename_component(MXE_MXEROOT ${MXE_TARGET_DIR} PATH)
get_filename_component(MXE_MXEROOT ${MXE_MXEROOT} PATH)
set(PACKAGE_VERSION_STRING ${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH})
else() #(WIN32)
if(UNIX)
set(PACKAGE_ARCH 32)
......@@ -134,20 +146,13 @@ else() #(WIN32)
set(PACKAGE_PLATFORM_NAME "Linux")
endif()
get_version("${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake" "ITK_SB_VERSION" ITK_SB_VERSION)
set(ITK_VERSION_STRING "${get_version_ITK_SB_VERSION}")
endif(UNIX)
endif() #(WIN32)
get_version("${OTB_SOURCE_DIR}/CMakeLists.txt" "OTB_VERSION_" OTB_VERSION_STRING)
set(PACKAGE_VERSION_STRING ${get_version_OTB_VERSION_STRING})
set(EXTRA_CACHE_CONFIG
"set(CMAKE_CROSSCOMPILING TRUE)
set(WIN32 TRUE)
set(MXE_ARCH \"${MXE_ARCH}\")
set(MXE_MXEROOT \"${MXE_MXEROOT}\")")
#guess install directory from OTB_MODULES_DIR
#copy of cmake variables not needed.
if(WIN32)
set(Monteverdi_SOURCE_DIR "${Monteverdi_SOURCE_DIR}")
set(Monteverdi_BINARY_DIR "${Monteverdi_BINARY_DIR}")
......@@ -156,17 +161,14 @@ if(WIN32)
set(DEPENDENCIES_INSTALL_DIR "${MXE_MXEROOT}/usr/${MXE_ARCH}-w64-mingw32.shared")
set(QT_PLUGINS_DIR "${DEPENDENCIES_INSTALL_DIR}/qt/plugins")
set(QT_TRANSLATIONS_DIR "${DEPENDENCIES_INSTALL_DIR}/qt/translations")
set(ITK_VERSION_STRING)
else() #unixes
set(Monteverdi_SOURCE_DIR "${SUPERBUILD_BINARY_DIR}/MVD/src/MVD")
set(Monteverdi_BINARY_DIR "${SUPERBUILD_BINARY_DIR}/MVD/build")
set(MONTEVERDI_INSTALL_DIR "${SUPERBUILD_INSTALL_DIR}")
set(QT_PLUGINS_DIR "${SUPERBUILD_INSTALL_DIR}/plugins")
set(QT_TRANSLATIONS_DIR "${SUPERBUILD_INSTALL_DIR}/translations")
set(OTB_INSTALL_DIR "${SUPERBUILD_BINARY_DIR}/OTB/build")
set(DEPENDENCIES_INSTALL_DIR "${SUPERBUILD_INSTALL_DIR}")
set(ITK_VERSION_STRING "${get_version_ITK_SB_VERSION}")
set(EXTRA_CACHE_CONFIG)
set(QT_PLUGINS_DIR "${SUPERBUILD_INSTALL_DIR}/plugins")
set(QT_TRANSLATIONS_DIR "${SUPERBUILD_INSTALL_DIR}/translations")
endif()
macro_setup_cmake_project(OTB)
......
#!/bin/sh
#!/usr/bin/env bash
cd `dirname $0`
......@@ -6,6 +6,11 @@ cd `dirname $0`
# Avoid any pre-mature optimization on variable names here.
OUT_DIR=`pwd`
CAT=`which cat`
RM=`which rm`
CHMOD=`which chmod`
SED=`which sed`
WHICH_ENV=`which env`
PATCH_ELF_EXE=$OUT_DIR/tools/patchelf
......@@ -22,18 +27,26 @@ for bin_file in $BINARY_FILES; do
fi
done
cat > $OUT_DIR/monteverdi.sh << EOF
#!/bin/sh
I_AM_XDK=@IS_XDK@
if [ "$I_AM_XDK" = true ] ; then
$SED -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/Modules/ITKZLIB.cmake
$SED -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/ITKConfig.cmake
$SED -i "s,@DEPENDENCIES_INSTALL_DIR@,$OUT_DIR,g" lib/cmake/ITK-@ITK_VERSION_STRING@/ITKTargets-release.cmake
else
$CAT > $OUT_DIR/monteverdi.sh << EOF
#!$WHICH_ENV bash
export LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal
export GEOTIFF_CSV=$OUT_DIR/share/epsg_csv
$OUT_DIR/bin/monteverdi "\$@"
EOF
chmod +x $OUT_DIR/monteverdi.sh
cat > $OUT_DIR/mapla.sh << EOF
#!/bin/sh
$CHMOD +x $OUT_DIR/monteverdi.sh