diff --git a/CMakeLists.txt b/CMakeLists.txt index 236d2b7088a6ee65dfc33f8d1eb2513e341e8b2f..1801d466167485e92804d40396cb21a59a30a78f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,90 +304,6 @@ IF(NOT BUILD_SHARED_LIBS) ADD_DEFINITIONS(-DOSSIM_STATIC) ENDIF(NOT BUILD_SHARED_LIBS) - -#----------------------------------------------------------------------------- -# Option for generate Visu tools !!! -OPTION(OTB_USE_VISU_GUI "Generate Gui/Visu tools directory. If ON, find OpenGL and FLTK packages." ON) -MARK_AS_ADVANCED(OTB_USE_VISU_GUI) - -SET(OTB_GLU_INCLUDE_PATH "") -IF(OTB_USE_VISU_GUI) - - #------------------------------- - # OpenGL Library - #------------------------------- - FIND_PACKAGE(OpenGL) - - IF( NOT OPENGL_FOUND ) - MESSAGE(FATAL_ERROR "Impossible to find OpenGL on your system.\nCannot build OTB Visu module without OpenGL library.\nInstall OpenGL on your system OR set OTB_USE_VISU_GUI to OFF to disable OTB Visu module generation !") - ENDIF( NOT OPENGL_FOUND ) - IF( NOT OPENGL_GLU_FOUND ) - MESSAGE(FATAL_ERROR "Impossible to find GLU library on your system.\nCannot build OTB Visu module without GLU library.\nInstall GLU library on your system OR set OTB_USE_VISU_GUI to OFF to disable OTB Visu module generation !") - ENDIF( NOT OPENGL_GLU_FOUND ) - - IF(OPENGL_INCLUDE_DIR) - INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) - ENDIF(OPENGL_INCLUDE_DIR) - - #------------------------------- - # Display images using textures using video card acceleration - #------------------------------- - OPTION(OTB_GL_USE_ACCEL "Use video card acceleration." OFF) - MARK_AS_ADVANCED(OTB_GL_USE_ACCEL) - - #------------------------------- - # FLTK Library - #------------------------------- - - #OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF) - - FIND_PACKAGE(FLTK) - - # If an external fltk is found, do not provide the internal fltk choice - IF(FLTK_FOUND) - OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ON) - ELSE(FLTK_FOUND) - OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF) - ENDIF(FLTK_FOUND) - -# IF(FLTK_FOUND) -# SET(OTB_USE_EXTERNAL_FLTK ON) -# ELSE(FLTK_FOUND) -# SET(OTB_USE_EXTERNAL_FLTK OFF) -# ENDIF(FLTK_FOUND) - - # Option for internal/external FLTK - MARK_AS_ADVANCED(OTB_USE_EXTERNAL_FLTK) - - IF(OTB_USE_EXTERNAL_FLTK) - - # Mingw Option doesn't exist in the FindFLTK.cmake default configuration file in CMake installationj directory. - # Copy FLTK_PLATFORM_DEPENDENT_LIBS from FLTK CmakeList.txt - IF(MINGW) - ADD_DEFINITIONS(-DWIN32) - SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid wsock32 gdi32 comdlg32) - ENDIF(MINGW) - - IF(FLTK_FOUND) - INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR}) - ELSE(FLTK_FOUND) - MESSAGE(FATAL_ERROR - "Cannot build OTB project without FLTK. Please set FLTK_DIR or set OTB_USE_VISU to OFF or set OTB_USE_EXTERNAL_FLTK OFF to use INTERNAL FLTK set on OTB/Utilities repository.") - ENDIF(FLTK_FOUND) - - ELSE(OTB_USE_EXTERNAL_FLTK) - SET(FLTK_INCLUDE_DIR "") - SET(FLTK_LIBRARIES "") - SET(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIRS}) - SET( FLTK_PLATFORM_DEPENDENT_LIBS "") - INCLUDE(${OTB_BINARY_DIR}/Utilities/FLTK/FLTKConfig.cmake) - - ENDIF(OTB_USE_EXTERNAL_FLTK) - - SET(OTB_VISU_GUI_LIBRARIES "${FLTK_LIBRARIES};${OPENGL_LIBRARIES} ") - SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND}) -ENDIF(OTB_USE_VISU_GUI) - #------------------------------- # CURL Library #------------------------------- @@ -509,16 +425,22 @@ ENDIF(OTB_USE_PQXX) # Boost Library #------------------------------- SET (Boost_MINOR_VERSION 0) -FIND_PACKAGE(Boost) -IF(Boost_FOUND) - IF(NOT ${Boost_MINOR_VERSION} EQUAL 40) - OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." ON) - ELSE(NOT ${Boost_MINOR_VERSION} EQUAL 40) - OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." OFF) - ENDIF(NOT ${Boost_MINOR_VERSION} EQUAL 40) -ELSE(Boost_FOUND) - OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." OFF) -ENDIF(Boost_FOUND) + +OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." OFF) + +IF(OTB_USE_EXTERNAL_BOOST) + FIND_PACKAGE(Boost) + IF(Boost_FOUND) + IF( ${Boost_MINOR_VERSION} EQUAL 40) + MESSAGE(WARNING "Boost 1.40 not supported. Disabling OTB_USE_EXTERNAL_BOOST") + SET(OTB_USE_EXTERNAL_BOOST OFF) + ENDIF(${Boost_MINOR_VERSION} EQUAL 40) + ELSE(Boost_FOUND) + MESSAGE(FATAL_ERROR + "Cannot build OTB project without boost library. Please set Boost directories or set OTB_USE_EXTERNAL_BOOST to OFF to use INTERNAL Boost set on OTB/Utilities repository.") + ENDIF(Boost_FOUND) +ENDIF(OTB_USE_EXTERNAL_BOOST) + # Option for internal/external BOOST MARK_AS_ADVANCED(OTB_USE_EXTERNAL_BOOST) @@ -529,7 +451,6 @@ IF (OTB_USE_MAPNIK) ENDIF(OTB_USE_MAPNIK) IF(OTB_USE_EXTERNAL_BOOST) - FIND_PACKAGE(Boost) TRY_COMPILE(BOOST_IS_COMPLETE ${CMAKE_CURRENT_BINARY_DIR}/CMake @@ -543,8 +464,6 @@ IF(OTB_USE_EXTERNAL_BOOST) MESSAGE(STATUS "Force the OTB_USE_EXTERNAL_BOOST value to OFF.") SET(OTB_USE_EXTERNAL_BOOST OFF CACHE BOOL "Use an outside build of Boost." FORCE ) ENDIF(BOOST_IS_COMPLETE) - - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) ENDIF(OTB_USE_EXTERNAL_BOOST) #------------------------------- @@ -698,6 +617,63 @@ IF(OTB_USE_EXTERNAL_GDAL) ELSE(OTB_USE_EXTERNAL_GDAL) ENDIF(OTB_USE_EXTERNAL_GDAL) +#----------------------------------------------------------------------------- +# Option for generate Visu tools !!! +OPTION(OTB_USE_VISU_GUI "Generate Gui/Visu tools directory. If ON, find OpenGL and FLTK packages." ON) +MARK_AS_ADVANCED(OTB_USE_VISU_GUI) + +SET(OTB_GLU_INCLUDE_PATH "") +IF(OTB_USE_VISU_GUI) + + #------------------------------- + # OpenGL Library + #------------------------------- + FIND_PACKAGE(OpenGL) + + IF( NOT OPENGL_FOUND ) + MESSAGE(FATAL_ERROR "Impossible to find OpenGL on your system.\nCannot build OTB Visu module without OpenGL library.\nInstall OpenGL on your system OR set OTB_USE_VISU_GUI to OFF to disable OTB Visu module generation !") + ENDIF( NOT OPENGL_FOUND ) + IF( NOT OPENGL_GLU_FOUND ) + MESSAGE(FATAL_ERROR "Impossible to find GLU library on your system.\nCannot build OTB Visu module without GLU library.\nInstall GLU library on your system OR set OTB_USE_VISU_GUI to OFF to disable OTB Visu module generation !") + ENDIF( NOT OPENGL_GLU_FOUND ) + + IF(OPENGL_INCLUDE_DIR) + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + ENDIF(OPENGL_INCLUDE_DIR) + + #------------------------------- + # Display images using textures using video card acceleration + #------------------------------- + OPTION(OTB_GL_USE_ACCEL "Use video card acceleration." OFF) + MARK_AS_ADVANCED(OTB_GL_USE_ACCEL) + + #------------------------------- + # FLTK Library + #------------------------------- + OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF) + + IF(OTB_USE_EXTERNAL_FLTK) + FIND_PACKAGE(FLTK) + IF(NOT FLTK_FOUND) + MESSAGE(FATAL_ERROR + "Cannot build OTB project without FLTK. Please set FLTK_DIR or set OTB_USE_EXTERNAL_FLTK OFF to use INTERNAL FLTK.") + ENDIF(NOT FLTK_FOUND) + ELSE(OTB_USE_EXTERNAL_FLTK) + # Same Set as ITK + SET(FLTK_SOURCE_DIR ${OTB_SOURCE_DIR}/Utilities/FLTK) + SET(FLTK_BINARY_DIR ${OTB_BINARY_DIR}/Utilities/FLTK) + # Additionnal variables needed by OTB_VISU_GUI_LIBRARIES and FLTK_FLUID_EXECUTABLE + SET(FLTK_LIBRARIES "fltk_images;fltk;fltk_gl;fltk_forms") + SET(FLUID_COMMAND fluid) + # FLTK CMake needs a variable called JPEG_INCLUDE_DIR + SET(JPEG_INCLUDE_DIR ${JPEG_INCLUDE_DIRS}) + ENDIF(OTB_USE_EXTERNAL_FLTK) + + SET(OTB_VISU_GUI_LIBRARIES "${FLTK_LIBRARIES};${OPENGL_LIBRARIES} ") + SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND}) +ENDIF(OTB_USE_VISU_GUI) + + #Experimental OPTION(OTB_USE_GETTEXT "Get Text Library." ON) diff --git a/Code/BasicFilters/otbBCOInterpolateImageFunction.h b/Code/BasicFilters/otbBCOInterpolateImageFunction.h index a9f4c934d8dbc4d6cc47785a8d263424b8895de9..1f47e6289a3da0ac9c91007edfab2263cb543e30 100644 --- a/Code/BasicFilters/otbBCOInterpolateImageFunction.h +++ b/Code/BasicFilters/otbBCOInterpolateImageFunction.h @@ -105,15 +105,14 @@ public: * calling the method. */ virtual OutputType EvaluateAtContinuousIndex( const ContinuousIndexType & index ) const = 0; + /** Compute the BCO coefficients. */ + virtual void EvaluateCoef( const ContinuousIndexType & index ) const; + protected: BCOInterpolateImageFunctionBase(); ~BCOInterpolateImageFunctionBase(); void PrintSelf(std::ostream& os, itk::Indent indent) const; - /** Compute the BCO coefficients. */ - virtual void EvaluateCoef( const ContinuousIndexType & index ); - virtual double GetBCOCoefX(unsigned int idx) const; - virtual double GetBCOCoefY(unsigned int idx) const; - + private: BCOInterpolateImageFunctionBase( const Self& ); //purposely not implemented void operator=( const Self& ); //purposely not implemented @@ -121,10 +120,7 @@ private: /** Used radius for the BCO */ double m_Radius; /** Optimisation Coefficient */ - double m_Alpha; - /** Used BCO coefficiet */ - CoefContainerType m_BCOCoefX; - CoefContainerType m_BCOCoefY; + double m_Alpha; }; diff --git a/Code/BasicFilters/otbBCOInterpolateImageFunction.txx b/Code/BasicFilters/otbBCOInterpolateImageFunction.txx index 29df5d91809c888adbe825648f86cc74e3b0e1ad..4fdf968281a8ffeeedb437e0a865567e96220b9c 100644 --- a/Code/BasicFilters/otbBCOInterpolateImageFunction.txx +++ b/Code/BasicFilters/otbBCOInterpolateImageFunction.txx @@ -30,7 +30,7 @@ template <class TInputImage, class TCoordRep> BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> ::BCOInterpolateImageFunctionBase() { - m_Radius = 1; + m_Radius = 2; m_Alpha = -0.5; } @@ -83,29 +83,15 @@ double BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> return m_Alpha; } -template <class TInputImage, class TCoordRep> -double BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> -::GetBCOCoefX(unsigned int idx) const -{ - return m_BCOCoefX[idx]; -} - -template <class TInputImage, class TCoordRep> -double BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> -::GetBCOCoefY(unsigned int idx) const -{ - return m_BCOCoefY[idx]; -} - template<class TInputImage, class TCoordRep> void BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> -::EvaluateCoef( const ContinuousIndexType & index ) +::EvaluateCoef( const ContinuousIndexType & index ) const { // Init BCO coefficient container unsigned int winSize = 2*m_Radius+1; - m_BCOCoefX = CoefContainerType(winSize, 0.); - m_BCOCoefY = CoefContainerType(winSize, 0.); + CoefContainerType BCOCoefX = CoefContainerType(winSize, 0.); + CoefContainerType BCOCoefY = CoefContainerType(winSize, 0.); double offsetX, offsetY, distX, distY, position, step; offsetX = index[0] - itk::Math::Floor<IndexValueType>(index[0]+0.5); @@ -125,50 +111,39 @@ BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> { if (distX <= 1.) { - m_BCOCoefX[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distX, 3)) + BCOCoefX[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distX, 3)) - (m_Alpha + 3.)*vcl_pow(distX, 2) + 1; } else { - m_BCOCoefX[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distX, 3)) - 5 + BCOCoefX[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distX, 3)) - 5 *m_Alpha*vcl_pow(distX, 2) + 8*m_Alpha*vcl_abs(distX) - 4*m_Alpha; } } else { - m_BCOCoefX[m_Radius+i] = 0; + BCOCoefX[m_Radius+i] = 0; } if( distY <= 2. ) { if (distY <= 1.) { - m_BCOCoefY[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distY, 3)) + BCOCoefY[m_Radius+i] = (m_Alpha + 2.)*vcl_abs(vcl_pow(distY, 3)) - (m_Alpha + 3.)*vcl_pow(distY, 2) + 1; } else { - m_BCOCoefY[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distY, 3)) - 5 + BCOCoefY[m_Radius+i] = m_Alpha*vcl_abs(vcl_pow(distY, 3)) - 5 *m_Alpha*vcl_pow(distY, 2) + 8*m_Alpha*vcl_abs(distY) - 4*m_Alpha; } } else { - m_BCOCoefY[m_Radius+i] = 0; + BCOCoefY[m_Radius+i] = 0; } - /* - std::cout << "distX : " << distX << std::endl; - std::cout << "distY : " << distY << std::endl; - std::cout << "position : " << position << std::endl; - */ position += step; } - /* - std::cout << "m_BCOCoefX : " << std::endl; - std::cout << m_BCOCoefX << std::endl; - std::cout << "m_BCOCoefY : " << std::endl; - std::cout << m_BCOCoefX << std::endl; - */ } @@ -210,7 +185,7 @@ BCOInterpolateImageFunction<TInputImage, TCoordRep> IndexType baseIndex; IndexType neighIndex; - vnl_vector<RealType> lineRes(winSize, 0.); + std::vector<RealType> lineRes(winSize, 0.); RealType value = itk::NumericTraits<RealType>::Zero; @@ -300,9 +275,9 @@ BCOInterpolateImageFunction<TInputImage, TCoordRep> #endif lineRes[i+radius] = lineRes[i+radius] - + static_cast<RealType>( this->GetInputImage()->GetPixel( neighIndex ) ) * BCOCoefY(j+radius) ; + + static_cast<RealType>( this->GetInputImage()->GetPixel( neighIndex ) ) * BCOCoefY[j+radius] ; } - value += lineRes[i+radius]*BCOCoefX(i+radius); + value += lineRes[i+radius]*BCOCoefX[i+radius]; } norma = (vcl_log(radius)/vcl_log(2.0)); @@ -375,7 +350,7 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel,VImageDimension> , TCoordRe OutputType output; - output.SetSize(1); + output.SetSize(componentNumber); offsetX = index[0] - itk::Math::Floor<IndexValueType>(index[0]+0.5); offsetY = index[1] - itk::Math::Floor<IndexValueType>(index[1]+0.5); @@ -464,12 +439,12 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel,VImageDimension> , TCoordRe for( unsigned int k = 0; k<componentNumber; k++) { lineRes[i+radius].at(k) = lineRes[i+radius].at(k) - + this->GetInputImage()->GetPixel( neighIndex ).GetElement(k) * BCOCoefY(j+radius) ; + + this->GetInputImage()->GetPixel( neighIndex ).GetElement(k) * BCOCoefY[j+radius] ; } } for( unsigned int k = 0; k<componentNumber; k++) { - value.at(k) += lineRes[i+radius].at(k)*BCOCoefX(i+radius); + value.at(k) += lineRes[i+radius].at(k)*BCOCoefX[i+radius]; } } diff --git a/OTBConfig.cmake.in b/OTBConfig.cmake.in index 4b597b9002925a76ea87c91e3d5616a1fe88dedd..1469d60cf90c2727b500dd89d12fc130ae29ef22 100644 --- a/OTBConfig.cmake.in +++ b/OTBConfig.cmake.in @@ -28,6 +28,9 @@ SET(OTB_INCLUDE_DIRS "@OTB_INCLUDE_DIRS_CONFIG@") # The OTB library directories. SET(OTB_LIBRARY_DIRS "@OTB_LIBRARY_DIRS_CONFIG@") +# The OTB binary directories +SET(OTB_BINARY_DIRS "@OTB_BINARY_DIRS_CONFIG@") + # The C and C++ flags added by OTB to the cmake-configured flags. SET(OTB_REQUIRED_C_FLAGS "@OTB_REQUIRED_C_FLAGS@") SET(OTB_REQUIRED_CXX_FLAGS "@OTB_REQUIRED_CXX_FLAGS@") @@ -79,22 +82,6 @@ SET(OTB_USE_SYSTEM_VXL "@OTB_USE_SYSTEM_VXL@") # The VXL_DIR setting used to build OTB. Set if OTB_USE_SYSTEM_VXL is true. SET(OTB_VXL_DIR "@OTB_VXL_DIR@") -SET(OTB_FLTK_FLUID_EXECUTABLE "@FLTK_FLUID_EXECUTABLE@") -SET(OTB_ITK_DIR "@ITK_DIR@") -SET(OTB_FLTK_DIR "@FLTK_DIR@") - -# FLTK informations -SET(FLTK_FLUID_EXECUTABLE "@OTB_FLTK_FLUID_EXECUTABLE@") -SET(FLTK_LIBRARY_DIRS "@OTB_FLTK_LIBRARY_DIRS@") -SET(FLTK_EXECUTABLE_DIRS "@OTB_FLTK_EXECUTABLE_DIRS@") -SET(FLUID_COMMAND "@OTB_FLUID_COMMAND@") -SET(FLTK_LIBRARIES "@FLTK_LIBRARIES@") -SET(FLTK_INCLUDE_DIRS "@FLTK_INCLUDE_DIRS@") -SET(OPENGL_LIBRARIES "@OPENGL_LIBRARIES@") -SET(FLTK_PLATFORM_DEPENDENT_LIBS "@FLTK_PLATFORM_DEPENDENT_LIBS@") - - - # The OTB Visu Gui informations SET(OTB_USE_VISU_GUI "@OTB_USE_VISU_GUI@") SET(OTB_VISU_GUI_LIBRARIES "@OTB_VISU_GUI_LIBRARIES@") @@ -117,25 +104,6 @@ SET(OTB_SHOW_ALL_MSG_DEBUG "@OTB_SHOW_ALL_MSG_DEBUG@") # The list of OTB/Utilities IO libraries SET(OTB_IO_UTILITIES_DEPENDENT_LIBRARIES "@OTB_IO_UTILITIES_DEPENDENT_LIBRARIES@") -# The FLTK version number -#SET(FLTK_VERSION_MAJOR "@FLTK_VERSION_MAJOR@") -#SET(FLTK_VERSION_MINOR "@FLTK_VERSION_MINOR@") -#SET(FLTK_VERSION_PATCH "@FLTK_VERSION_PATCH@") -#SET(FLTK_VERSION "@FLTK_VERSION@") -#SET(FLTK_VERSION_FULL "@FLTK_VERSION_FULL@") - -# The OPENJPEG version number -#SET(OPENJPEG_VERSION_MAJOR "@OPENJPEG_VERSION_MAJOR@") -#SET(OPENJPEG_VERSION_MINOR "@OPENJPEG_VERSION_MINOR@") -#SET(OPENJPEG_VERSION_BUILD "@OPENJPEG_VERSION_BUILD@") -#SET(OPENJPEG_VERSION "@OPENJPEG_VERSION@") - -# The GALIB version number -#SET(OTBGALIB_VERSION_MAJOR "@OTBGALIB_VERSION_MAJOR@") -#SET(OTBGALIB_VERSION_MINOR "@OTBGALIB_VERSION_MINOR@") -#SET(OTBGALIB_VERSION_PATCH "@OTBGALIB_VERSION_PATCH@") -#SET(OTBGALIB_VERSION_STRING "@OTBGALIB_VERSION_STRING@") - # Option use external BOOST. SET(OTB_USE_EXTERNAL_BOOST "@OTB_USE_EXTERNAL_BOOST@") diff --git a/UseOTB.cmake.in b/UseOTB.cmake.in index 1dba18d67c43ed5b676507c1de8357249beea034..0ae21268c55a94a49d4b5005559e28d9d7b4a0c6 100644 --- a/UseOTB.cmake.in +++ b/UseOTB.cmake.in @@ -67,16 +67,6 @@ IF(OTB_USE_SYSTEM_VXL) ENDIF(VXL_FOUND) ENDIF(OTB_USE_SYSTEM_VXL) -#WHERE TO FIND FLTK -IF(OTB_USE_VISU_GUI) - IF(OTB_USE_EXTERNAL_FLTK) - SET(FLTK_FLUID_EXECUTABLE ${OTB_FLTK_FLUID_EXECUTABLE}) - INCLUDE(${OTB_FLTK_DIR}/FLTKConfig.cmake) - LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS}) - ENDIF(OTB_USE_EXTERNAL_FLTK) -ENDIF(OTB_USE_VISU_GUI) - - #WHERE TO FIND ITK IF(OTB_USE_EXTERNAL_ITK) INCLUDE(${OTB_ITK_DIR}/ITKConfig.cmake) @@ -128,6 +118,14 @@ IF(OTB_USE_EXTERNAL_GDAL) INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIR}) ENDIF(OTB_USE_EXTERNAL_GDAL) +#WHERE TO FIND FLTK +if(OTB_USE_EXTERNAL_FLTK) + FIND_PACKAGE(FLTK) + LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS}) +else(OTB_USE_EXTERNAL_FLTK) + SET(FLTK_FLUID_EXECUTABLE ${OTB_BINARY_DIRS}/fluid) +endif(OTB_USE_EXTERNAL_FLTK) + # The use curl definition IF(OTB_USE_CURL) ADD_DEFINITIONS(-DOTB_USE_CURL) diff --git a/Utilities/FLTK/CMakeLists.txt b/Utilities/FLTK/CMakeLists.txt index 63a0aa7d5b3cfb1455a8f0a362032608faf11634..c1c378cb003f365defc3d216bc5a48af419b24ff 100644 --- a/Utilities/FLTK/CMakeLists.txt +++ b/Utilities/FLTK/CMakeLists.txt @@ -16,15 +16,6 @@ SET(FLTK_VERSION_FULL "${FLTK_VERSION}.${FLTK_VERSION_PATCH}") SET(FLTK_LIBRARIES "fltk_images;fltk;fltk_gl;fltk_forms" CACHE INTERNAL "Variable used by OTB to link against FLTK") -# Executables and libraries should just go to bin -#OTB Modifications -SET(EXECUTABLE_OUTPUT_PATH "${OTB_BINARY_DIR}/bin" CACHE INTERNAL - "Where to put the executables for FLTK" - ) -SET(LIBRARY_OUTPUT_PATH "${OTB_BINARY_DIR}/bin" CACHE INTERNAL - "Where to put the libraries for FLTK" - ) - # Allow building shared libraries OPTION(BUILD_SHARED_LIBS "Build FLTK as a shared library" OFF) diff --git a/otbGenerateOTBConfig.cmake b/otbGenerateOTBConfig.cmake index 7bd1796e3088d7f421bddc2ef66acdcc0b1e839e..ec099abc5e38ec55e60d6abb31c0a50f1655fd9a 100644 --- a/otbGenerateOTBConfig.cmake +++ b/otbGenerateOTBConfig.cmake @@ -17,6 +17,9 @@ SET(OTB_BUILD_SETTINGS_FILE ${OTB_BINARY_DIR}/OTBBuildSettings.cmake) # Library directory. SET(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_PATH}) +# Binary directory +SET(OTB_BINARY_DIRS_CONFIG ${EXECUTABLE_OUTPUT_PATH}) + # SET(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_DIRS_CONFIG} ${GDAL_LIBRARY_DIRS} ${ITK_LIBRARY_DIRS} ${FLTK_LIBRARY_DIRS}) @@ -32,17 +35,6 @@ SET(OTB_INCLUDE_DIRS_CONFIG ${OTB_INCLUDE_DIRS_SYSTEM} ) -# Built Configure FLTK commands and directories -IF(OTB_USE_EXTERNAL_FLTK) - SET(OTB_FLTK_FLUID_EXECUTABLE ${FLTK_FLUID_EXECUTABLE}) -ELSE(OTB_USE_EXTERNAL_FLTK) - SET(OTB_FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND}) -ENDIF(OTB_USE_EXTERNAL_FLTK) - -SET(OTB_FLUID_COMMAND ${FLUID_COMMAND}) -SET(OTB_FLTK_LIBRARY_DIRS ${FLTK_LIBRARY_DIRS}) -SET(OTB_FLTK_EXECUTABLE_DIRS ${FLTK_EXECUTABLE_DIRS}) - #----------------------------------------------------------------------------- # Configure OTBConfig.cmake for the BUILD tree. CONFIGURE_FILE(${OTB_SOURCE_DIR}/OTBConfig.cmake.in @@ -74,42 +66,11 @@ ENDIF(OTB_INCLUDE_DIRS_SYSTEM) SET(OTB_INCLUDE_DIRS_CONFIG ${OTB_INCLUDE_DIRS_CONFIG} ${OTB_INCLUDE_ABSOLUE_DIRS} ) -# Include directories. -# SET(OTB_INCLUDE_DIRS_CONFIG -# ${OTB_INCLUDE_DIRS_INSTALL_TREE} -# ${OTB_INCLUDE_DIRS_SYSTEM} -# ) - # Link directories. SET(OTB_LIBRARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}${OTB_INSTALL_LIB_DIR}") - -# SET(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_DIRS_CONFIG} ${GDAL_LIBRARY_DIRS} ${ITK_LIBRARY_DIRS} ${FLTK_LIBRARY_DIRS}) - - - -# Install Configure FLTK commands and directories -IF(OTB_USE_EXTERNAL_FLTK) - SET(OTB_FLTK_FLUID_EXECUTABLE ${FLTK_FLUID_EXECUTABLE}) - SET(OTB_FLUID_COMMAND ${FLUID_COMMAND}) - SET(OTB_FLTK_LIBRARY_DIRS ${FLTK_LIBRARY_DIRS}) - SET(OTB_FLTK_EXECUTABLE_DIRS ${FLTK_EXECUTABLE_DIRS}) -ELSE(OTB_USE_EXTERNAL_FLTK) - SET(OTB_BINARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}${OTB_INSTALL_BIN_DIR}") - GET_FILENAME_COMPONENT(FLUID_FILE_NAME "${FLUID_COMMAND}" NAME ) - - SET(OTB_FLUID_COMMAND ${OTB_BINARY_DIRS_CONFIG}/${FLUID_FILE_NAME}) - SET(OTB_FLTK_FLUID_EXECUTABLE ${OTB_FLUID_COMMAND}) - SET(OTB_FLTK_LIBRARY_DIRS ${OTB_LIBRARY_DIRS_CONFIG}) - SET(OTB_FLTK_EXECUTABLE_DIRS ${OTB_BINARY_DIRS_CONFIG}) - -# GET_FILENAME_COMPONENT(FLUID_FILE_NAME "${FLUID_COMMAND}" NAME ) -# SET(OTB_FLUID_COMMAND ${CMAKE_INSTALL_PREFIX}/bin/${FLUID_FILE_NAME}) -# SET(OTB_FLTK_FLUID_EXECUTABLE ${OTB_FLUID_COMMAND}) -# SET(OTB_FLTK_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/lib) -# SET(OTB_FLTK_EXECUTABLE_DIRS ${CMAKE_INSTALL_PREFIX}/bin) -ENDIF(OTB_USE_EXTERNAL_FLTK) - +# Binary directories +SET(OTB_BINARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}${OTB_INSTALL_BIN_DIR}") #----------------------------------------------------------------------------- # Configure OTBConfig.cmake for the INSTALL tree. @@ -129,3 +90,4 @@ ENDFOREACH(p) CONFIGURE_FILE(${OTB_SOURCE_DIR}/OTBConfig.cmake.in ${OTB_BINARY_DIR}/Utilities/OTBConfig.cmake @ONLY IMMEDIATE) + diff --git a/otbIncludeDirectories.cmake b/otbIncludeDirectories.cmake index b76f89416c9c76fa67ce1a2b9b327cf34788b354..25ad43a13b3ecf2671df13b930a1171dd6a7eae4 100644 --- a/otbIncludeDirectories.cmake +++ b/otbIncludeDirectories.cmake @@ -75,6 +75,9 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} IF(NOT OTB_USE_EXTERNAL_BOOST) SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} ${OTB_SOURCE_DIR}/Utilities/otbkml/third_party/boost_1_34_1) +ELSE(NOT OTB_USE_EXTERNAL_BOOST) + SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} + ${Boost_INCLUDE_DIR}) ENDIF(NOT OTB_USE_EXTERNAL_BOOST) IF(OTB_COMPILE_JPEG2000) @@ -181,15 +184,15 @@ ELSE(OTB_USE_EXTERNAL_ITK) ) ENDIF(OTB_USE_EXTERNAL_ITK) -#For FLTK header file +#For header file IF(OTB_USE_EXTERNAL_FLTK) SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} - ${FLTK_INCLUDE_DIRS} ) + ${FLTK_INCLUDE_DIRS} ) ELSE(OTB_USE_EXTERNAL_FLTK) SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE} - ${OTB_SOURCE_DIR}/Utilities/FLTK - ${OTB_SOURCE_DIR}/Utilities/FLTK/src - ${OTB_BINARY_DIR}/Utilities/FLTK ) + ${FLTK_SOURCE_DIR} + ${FLTK_SOURCE_DIR}/src + ${FLTK_BINARY_DIR} ) ENDIF(OTB_USE_EXTERNAL_FLTK) #-----------------------------------------------------------------------------