Commit c5a72a42 authored by Stéphane Albert's avatar Stéphane Albert

MRG: Merged from origin/develop.

parents 017a6d06 a3a00277
find_path(
cv_INCLUDE_DIR
opencv/cv.h
DOC "The directory where opencv/cv.h is installed")
find_path(
opencv2_INCLUDE_DIR
opencv2/opencv.hpp
DOC "The directory where opencv2/opencv.hpp is installed")
set(opencv_core_NAMES opencv_core)
set(opencv_ml_NAMES opencv_ml)
if ( cv_INCLUDE_DIR AND opencv2_INCLUDE_DIR )
set(OPENCV_INCLUDE_DIRS "${cv_INCLUDE_DIR};${opencv2_INCLUDE_DIR}")
list(REMOVE_DUPLICATES OPENCV_INCLUDE_DIRS)
if(NOT OpenCV_VERSION)
file(READ "${opencv2_INCLUDE_DIR}/opencv2/core/version.hpp" _header_content)
string(REGEX REPLACE ".*# *define +CV_VERSION_EPOCH +([0-9]+).*" "\\1"
OpenCV_VERSION_MAJOR ${_header_content})
string(REGEX REPLACE ".*# *define +CV_VERSION_MAJOR +([0-9]+).*" "\\1"
OpenCV_VERSION_MINOR ${_header_content})
string(REGEX REPLACE ".*# *define +CV_VERSION_MINOR +([0-9]+).*" "\\1"
OpenCV_VERSION_PATCH ${_header_content})
string(REGEX REPLACE ".*# *define +CV_VERSION_REVISION +([0-9]+).*" "\\1"
OpenCV_VERSION_TWEAK ${_header_content})
set(OpenCV_VERSION
"${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}")
endif()
if(WIN32)
list(APPEND opencv_core_NAMES
"opencv_core${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
list(APPEND opencv_ml_NAMES
"opencv_ml${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
endif()
endif()
# Prefer the static library.
find_library(
OPENCV_core_LIBRARY
NAMES ${opencv_core_NAMES}
DOC "Path to opencv_core library")
find_library(
OPENCV_ml_LIBRARY
NAMES ${opencv_ml_NAMES}
DOC "Path to opencv_ml library")
set(OpenCV_FOUND FALSE)
if ( OPENCV_core_LIBRARY AND OPENCV_ml_LIBRARY )
set(OPENCV_LIBRARIES "${OPENCV_core_LIBRARY};${OPENCV_ml_LIBRARY}")
endif ()
if( OPENCV_INCLUDE_DIRS AND OPENCV_LIBRARIES )
set(OpenCV_FOUND TRUE)
set(OPENCV_VERSION ${OpenCV_VERSION}) #for compatility
endif()
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENCV
REQUIRED_VARS OPENCV_core_LIBRARY OPENCV_INCLUDE_DIRS
VERSION_VAR OpenCV_VERSION)
......@@ -11,7 +11,12 @@ include(${_OTBModuleMacros_DIR}/OTBApplicationMacros.cmake)
# don't work. Set the option to off and hide it.
if(APPLE AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.3")
set( USE_COMPILER_HIDDEN_VISIBILITY OFF CACHE INTERNAL "" )
elseif(APPLE)
#RK: compiler visibility nor woking on osx with appleclang xcode.
#gcc is a symlink to clang
set( USE_COMPILER_HIDDEN_VISIBILITY OFF CACHE INTERNAL "" )
endif()
include(GenerateExportHeader)
if(OTB_CPPCHECK_TEST)
......@@ -108,7 +113,7 @@ macro(otb_module_impl)
add_custom_target(${otb-module}-all ALL SOURCES ${_srcs})
otb_module_use(${OTB_MODULE_${otb-module}_DEPENDS})
foreach(dep IN LISTS OTB_MODULE_${otb-module}_OPTIONAL_DEPENDS)
if (${dep}_ENABLED)
otb_module_use(${dep})
......@@ -117,11 +122,11 @@ macro(otb_module_impl)
if(NOT DEFINED ${otb-module}_LIBRARIES)
set(${otb-module}_LIBRARIES "")
foreach(dep IN LISTS OTB_MODULE_${otb-module}_DEPENDS)
list(APPEND ${otb-module}_LIBRARIES "${${dep}_LIBRARIES}")
endforeach()
foreach(dep IN LISTS OTB_MODULE_${otb-module}_OPTIONAL_DEPENDS)
if (${dep}_ENABLED)
list(APPEND ${otb-module}_LIBRARIES "${${dep}_LIBRARIES}")
......@@ -137,7 +142,7 @@ macro(otb_module_impl)
list(APPEND ${otb-module}_INCLUDE_DIRS ${${otb-module}_SOURCE_DIR}/include)
install(DIRECTORY include/ DESTINATION ${${otb-module}_INSTALL_INCLUDE_DIR} COMPONENT Development)
endif()
if(NOT OTB_SOURCE_DIR)
# When building a module outside the OTB source tree, find the export
# header.
......
......@@ -195,12 +195,18 @@ macro(check_compiler_platform_flags)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
endif()
else()
if(BUILD_SHARED_LIBS)
set(OTB_LIBRARY_BUILD_TYPE "SHARED")
else()
set(OTB_LIBRARY_BUILD_TYPE "STATIC")
# if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then
# BUILD_SHARED_LIBS works as it would on other systems
if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
if(BUILD_SHARED_LIBS)
set(OTB_LIBRARY_BUILD_TYPE "SHARED")
else()
set(OTB_LIBRARY_BUILD_TYPE "STATIC")
endif()
# turn off BUILD_SHARED_LIBS as OTB_LIBRARY_BUILD_TYPE
# is used on the libraries that have markup.
set(BUILD_SHARED_LIBS OFF)
endif()
set(BUILD_SHARED_LIBS OFF)
endif()
endif()
#-----------------------------------------------------------------------------
......
......@@ -57,7 +57,7 @@ function(repository_status root_repo_dir result_var1)
if(OTB_WC_STATUS)
message(STATUS " Local file modifications (${dir_name}) :")
string(REPLACE "\n" "\n-- " OTB_WC_STATUS_PRETTYPRINT " ${OTB_WC_STATUS}")
message(STATUS "${OTB_WC_STATUS_PRETTYPRINT}")
message(WARNING "${OTB_WC_STATUS_PRETTYPRINT}")
else()
message(STATUS " No files modified locally (${dir_name})")
endif()
......
import numpy
print numpy.get_include()
print(numpy.get_include())
......@@ -109,6 +109,42 @@ Notes:
- Multiple installation of OTB can exists in same system without one conflicting the other!
FAQ for Packaging
-----------------
Q: I am getting an error message...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
Cannot mix incompatible Qt library (version 0x40806) with this library (version 0x40807)
Aborted
A: This is due to a conflict with system Qt4 (usually seen on KDE) and Qt4 + gtk libs in OTB package. The fix you need is to remove those libs from package.
.. parsed-literal::
cd /path/to/OTB-|release|-Linux64
rm -f lib/libQt* && rm -fr lib/gtk
Q: Monteverdi and Mapla applications look different from my other applications.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A: By default, Monteverdi, Mapla and otbapplication (otbgui\_\*) uses a default gtk theme (plastic)
which is distributed with the OTB package!. We do this to be on safe side, like when a user does
not have gtk libraries installed when using our package.
gtk libraries in the package is the reason why you are getting a default "plastic" look & feel that
makes it look different from other GUI applications.
To get same look and feel, you can "force" Monteverdi and Mapla to use system GTK.
::
export OTB_USE_SYSTEM_GTK=1
And now start ``monteverdi.sh`` or ``mapla.sh`` from OTB-|release|-Linux64
To get back default behaviour, unset OTB_USE_SYSTEM_GTK=1 or set OTB_USE_SYSTEM_GTK=0
MacOS X
-------
......
......@@ -33,7 +33,7 @@ namespace otb
*
* \ingroup OTBCurlAdapters
*/
class ITK_EXPORT CurlHelper : public CurlHelperInterface
class OTBCurlAdapters_EXPORT CurlHelper : public CurlHelperInterface
{
public:
/** Standard class typedefs. */
......@@ -46,11 +46,11 @@ public:
itkNewMacro(Self);
bool TestUrlAvailability(const std::string& url) const ITK_OVERRIDE;
bool IsCurlReturnHttpError(const std::string& url) const;
int RetrieveFile(const std::ostringstream& urlStream, std::string filename) const ITK_OVERRIDE;
int RetrieveFile(const std::string& urlString, std::string filename) const ITK_OVERRIDE;
int RetrieveUrlInMemory(const std::string& urlString, std::string& output) const ITK_OVERRIDE;
......@@ -60,7 +60,7 @@ public:
int maxConnect) const ITK_OVERRIDE;
itkGetMacro(Timeout,long int);
itkSetMacro(Timeout,long int);
protected:
......
......@@ -21,6 +21,7 @@
#include <iosfwd>
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "OTBCurlAdaptersExport.h"
namespace otb
{
......@@ -34,7 +35,7 @@ namespace otb
*
* \ingroup OTBCurlAdapters
*/
class ITK_EXPORT CurlHelperInterface : public itk::Object
class OTBCurlAdapters_EXPORT CurlHelperInterface : public itk::Object
{
public:
/** Standard class typedefs. */
......
set(DOCUMENTATION "Adapters for the Curl library.")
otb_module(OTBCurlAdapters
ENABLE_SHARED
DEPENDS
OTBCommon
OTBITK
......
......@@ -32,7 +32,7 @@ namespace otb
*
* \ingroup OTBGdalAdapters
*/
class ITK_EXPORT GeometriesSet : public itk::DataObject
class OTBGdalAdapters_EXPORT GeometriesSet : public itk::DataObject
{
public:
/**\name Standard ITK typedefs */
......
......@@ -22,6 +22,8 @@
#include "itkProcessObject.h"
#include "itkMacro.h"
#include "OTBGdalAdaptersExport.h"
// Forward declarations
namespace otb {
namespace ogr {
......@@ -62,7 +64,7 @@ namespace otb
*
* \ingroup OTBGdalAdapters
*/
class ITK_EXPORT GeometriesSource : public itk::ProcessObject, boost::noncopyable
class OTBGdalAdapters_EXPORT GeometriesSource : public itk::ProcessObject, boost::noncopyable
{
public:
/**\name Standard ITK typedefs */
......
......@@ -46,7 +46,7 @@ namespace otb
*
* \ingroup OTBGdalAdapters
*/
class ITK_EXPORT GeometriesToGeometriesFilter : public GeometriesSource
class OTBGdalAdapters_EXPORT GeometriesToGeometriesFilter : public GeometriesSource
{
public:
/**\name Standard ITK typedefs */
......@@ -172,7 +172,7 @@ private:
* Helper class to operate an exact copy of the fields from a source layer.
* \since OTB v 3.14.0
*/
struct FieldCopyTransformation
struct OTBGdalAdapters_EXPORT FieldCopyTransformation
{
OGRFeatureDefn & getDefinition(ogr::Layer & outLayer) const
{
......
......@@ -72,7 +72,9 @@ namespace otb { namespace ogr {
*
* \ingroup OTBGdalAdapters
*/
class DataSource : public itk::DataObject , public boost::noncopyable
#include "OTBGdalAdaptersExport.h"
class OTBGdalAdapters_EXPORT DataSource : public itk::DataObject , public boost::noncopyable
{
public:
/**\name Standard ITK typedefs */
......
......@@ -20,6 +20,8 @@
#include <boost/noncopyable.hpp>
#include "OTBGdalAdaptersExport.h"
namespace otb { namespace ogr {
/**\ingroup Geometry
* Singleton-like class to provide lazy-registering of all \c OGRDriver's.
......@@ -37,7 +39,7 @@ namespace otb { namespace ogr {
* VC++)
* - Non-copyable
*/
class Drivers : private boost::noncopyable
class OTBGdalAdapters_EXPORT Drivers : private boost::noncopyable
{
/** \name Singleton related functions */
//@{
......
......@@ -37,6 +37,8 @@ class OGRFeatureDefn;
namespace otb {
namespace ogr {
class Feature;
OTBGdalAdapters_EXPORT
bool operator==(Feature const& lhs, Feature const& rhs);
/**\ingroup gGeometry
......@@ -61,7 +63,7 @@ bool operator==(Feature const& lhs, Feature const& rhs);
*
* \ingroup OTBGdalAdapters
*/
class Feature
class OTBGdalAdapters_EXPORT Feature
{
public:
/**\name Construction, copy and destruction */
......
......@@ -22,9 +22,18 @@
#include <boost/shared_ptr.hpp>
class OGRFieldDefn;
class OGRFeature;
#if defined(_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable: 4251 )
#include "ogr_core.h" // OGR enums
#pragma warning ( pop )
#else
#include "ogr_core.h" // OGR enums
#endif
#include "itkIndent.h"
#include "OTBGdalAdaptersExport.h"
namespace otb { namespace ogr {
/*===========================================================================*/
......@@ -41,7 +50,7 @@ namespace otb { namespace ogr {
*
* \ingroup OTBGdalAdapters
*/
class FieldDefn
class OTBGdalAdapters_EXPORT FieldDefn
{
public:
FieldDefn(OGRFieldDefn& definition) : m_Definition(&definition){ }
......@@ -65,6 +74,7 @@ bool operator==(FieldDefn const& lhs, FieldDefn const& rhs)
&& lhs.GetType() == rhs.GetType();
}
OTBGdalAdapters_EXPORT
std::ostream & operator<<(std::ostream & os, FieldDefn const& defn);
/*===========================================================================*/
......@@ -91,7 +101,7 @@ class Feature;
*
* \ingroup OTBGdalAdapters
*/
class Field
class OTBGdalAdapters_EXPORT Field
{
public:
/**
......@@ -166,7 +176,7 @@ public:
/** \copydoc Field::ogr() const */
OGRField & ogr();
private:
/**\name Unchecked definitions
* All the definitions that follow do the real work. However, they are not the
......@@ -201,11 +211,11 @@ private:
* All the fields decoding is at the wrong place (\c OGRFeature instead of
* \c OGRField) => need for an index.
*/
int m_index;
};
}
}
} // end namespace otb::ogr
#ifndef OTB_MANUAL_INSTANTIATION
......
......@@ -52,6 +52,7 @@
#include "otbOGRHelpers.h"
/*===========================================================================*/
/*================[ Associations C++ types -> OGR functions ]================*/
/*===========================================================================*/
......
......@@ -27,6 +27,8 @@
#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
#endif
#include "OTBGdalAdaptersExport.h"
class OGRGeometry;
namespace otb { namespace ogr {
......@@ -41,7 +43,7 @@ namespace internal {
* consequence, it is not in an anonymous namespace , but in \c
* otb::ogr::internal.
*/
struct GeometryDeleter
struct OTBGdalAdapters_EXPORT GeometryDeleter
{
void operator()(OGRGeometry* p);
};
......@@ -99,34 +101,34 @@ struct GeometryDeleter
*/
typedef boost::interprocess::unique_ptr<OGRGeometry, internal::GeometryDeleter> UniqueGeometryPtr;
///Do these features intersect?
bool Intersects (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Intersects (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Returns wheither if two geometries are equivalent.
bool Equals (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Equals (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for disjointness.
bool Disjoint (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Disjoint (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for touching.
bool Touches (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Touches (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for crossing.
bool Crosses (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Crosses (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for containment.
bool Within (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Within (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for containment.
bool Contains (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Contains (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Tests for overlap.
bool Overlaps (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT bool Overlaps (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes distance between two geometries.
double Distance (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT double Distance (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes intersection.
UniqueGeometryPtr Intersection (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Intersection (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes union.
UniqueGeometryPtr Union (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Union (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes union using cascading.
UniqueGeometryPtr UnionCascaded (OGRGeometry const& this_);
OTBGdalAdapters_EXPORT UniqueGeometryPtr UnionCascaded (OGRGeometry const& this_);
/// Computes difference.
UniqueGeometryPtr Difference (OGRGeometry const& lhs, OGRGeometry const& rhs);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Difference (OGRGeometry const& lhs, OGRGeometry const& rhs);
/// Computes symmetric difference.
UniqueGeometryPtr SymDifference (OGRGeometry const& lhs, OGRGeometry const& rhs); // -1.8
OTBGdalAdapters_EXPORT UniqueGeometryPtr SymDifference (OGRGeometry const& lhs, OGRGeometry const& rhs); // -1.8
/** Simplifies Geometry.
* This function tries to uses the best simplication algorithm available in the
......@@ -137,19 +139,19 @@ UniqueGeometryPtr SymDifference (OGRGeometry const& lhs, OGRGeometry const& rhs)
* \sa \c OGRGeometry::Simplify()
* \sa \c OGRGeometry::SimplifyPreserveTopology()
*/
UniqueGeometryPtr Simplify(OGRGeometry const& g, double tolerance);
OTBGdalAdapters_EXPORT UniqueGeometryPtr Simplify(OGRGeometry const& g, double tolerance);
/** Simplifies Geometry with no guarantee of preserving the geometry.
* \pre Requires GDAL 1.8.0
* \sa \c OGRGeometry::Simplify()
*/
UniqueGeometryPtr SimplifyDontPreserveTopology(OGRGeometry const& g, double tolerance);
OTBGdalAdapters_EXPORT UniqueGeometryPtr SimplifyDontPreserveTopology(OGRGeometry const& g, double tolerance);
/** Simplifies Geometry while preserving topology.
* \pre Requires GDAL 1.9.0
* \sa \c OGRGeometry::SimplifyPreserveTopology()
*/
UniqueGeometryPtr SimplifyPreserveTopology(OGRGeometry const& g, double tolerance);
OTBGdalAdapters_EXPORT UniqueGeometryPtr SimplifyPreserveTopology(OGRGeometry const& g, double tolerance);
/** @} */
......
......@@ -31,6 +31,8 @@
#include "cpl_string.h" // CSLCount
#endif
#include "OTBGdalAdaptersExport.h"
namespace otb
{
namespace ogr
......@@ -55,7 +57,7 @@ namespace ogr
*
* \ingroup OTBGdalAdapters
*/
struct StringListConverter
struct OTBGdalAdapters_EXPORT StringListConverter
{
template <class ContainerType>
......
......@@ -49,6 +49,7 @@ class Layer;
* Compares layers identities.
* \return whether the two layers are in fact the same.
*/
OTBGdalAdapters_EXPORT
bool operator==(Layer const& lhs, Layer const& rhs);
/**\ingroup gGeometry
......@@ -72,7 +73,7 @@ bool operator==(Layer const& lhs, Layer const& rhs);
*
* \ingroup OTBGdalAdapters
*/
class Layer
class OTBGdalAdapters_EXPORT Layer
{
public:
/**\name ITK standard definitions */
......
......@@ -31,6 +31,8 @@ class OGRDataSource;
class OGRSFDriver;
#endif
#include "OTBGdalAdaptersExport.h"
namespace otb