Commit 8c920aa2 authored by Romain Garrigues's avatar Romain Garrigues
Browse files

Modifications pour make install OTB avec les options d'ITK

parent a12d30f5
......@@ -10,26 +10,25 @@
int
main(int argc, char *argv[])
{
char *me;
float qnan, zero;
int i;
const char * const me=argv[0];
const float zero=0.0F;
union {
float flt32bit;
int int32bit;
} qnan;
#if defined(__BORLANDC__)
// Disable floating point exceptions in Borland
_control87(MCW_EM, MCW_EM);
// Disable floating point exceptions in Borland
_control87(MCW_EM, MCW_EM);
#endif // defined(__BORLANDC__)
me = argv[0];
if (sizeof(float) != sizeof(int))
{
fprintf(stderr, "%s: MADNESS: sizeof(float)=%d != sizeof(int)=%d\n",
me, (int)sizeof(float), (int)sizeof(int));
return -1;
}
zero = 0;
qnan=zero/zero;
i=*(int*)(&qnan);
printf("-DTEEM_QNANHIBIT=%d\n", (i >> 22) & 1);
return (int)((i >> 22) & 1);
if (sizeof(float) != sizeof(int))
{
fprintf(stderr, "%s: MADNESS: sizeof(float)=%d != sizeof(int)=%d\n",
me, (int)sizeof(float), (int)sizeof(int));
return -1;
}
qnan.flt32bit=zero/zero;
printf("-DTEEM_QNANHIBIT=%d\n", (qnan.int32bit >> 22) & 1);
return (int)((qnan.int32bit >> 22) & 1);
}
......@@ -92,6 +92,7 @@ IF(OTB_USE_EXTERNAL_ITK)
"Cannot build OTB project without ITK. Please set ITK_DIR or set OTB_USE_EXTERNAL_ITK OFF to use INTERNAL ITK set on OTB/Utilities repository.")
ENDIF(ITK_FOUND)
ELSE(OTB_USE_EXTERNAL_ITK)
#THOMAS
# SET(ITK_SOURCE_DIR ${OTB_SOURCE_DIR}/Utilities/ITK)
# SET(ITK_BINARY_DIR ${OTB_BINARY_DIR})
ENDIF(OTB_USE_EXTERNAL_ITK)
......@@ -104,15 +105,19 @@ ENDIF(OTB_USE_EXTERNAL_ITK)
# MARK_AS_ADVANCED(OTB_USE_EXTERNAL_GDAL)
# IF(OTB_USE_EXTERNAL_GDAL)
FIND_LIBRARY(GDAL_LIBRARY NAMES gdal PATHS $ENV{GDAL_DIR_LIB} )
FIND_PATH(GDAL_INCLUDES gdal.h $ENV{GDAL_DIR_INCLUDES} )
IF (NOT GDAL_LIBRARY)
#THOMAS !!!
# FIND_LIBRARY(GDAL_LIBRARY NAMES gdal PATHS $ENV{GDAL_DIR_LIB} )
FIND_PATH(GDAL_LIBRARY_DIRS gdal PATHS $ENV{GDAL_DIR_LIB} )
FIND_PATH(GDAL_INCLUDE_DIRS gdal.h $ENV{GDAL_DIR_INCLUDES} )
IF (NOT GDAL_LIBRARY_DIRS)
MESSAGE(FATAL_ERROR
"Cannot find GDAL library. Please set GDAL_DIR_LIB and GDAL_DIR_INCLUDES or set OTB_USE_EXTERNAL_GDAL OFF to use INTERNAL GDAL set on OTB/Utilities repository.")
ENDIF (NOT GDAL_LIBRARY)
"Cannot find GDAL library. Please set GDAL_LIBRARY_DIRS and GDAL_INCLUDE_DIRS.")
ENDIF (NOT GDAL_LIBRARY_DIRS)
INCLUDE_DIRECTORIES(${GDAL_INCLUDES})
LINK_DIRECTORIES( $ENV{GDAL_DIR_LIB} )
INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIRS})
#THOMAS
# LINK_DIRECTORIES( $ENV{GDAL_DIR_LIB} )
LINK_DIRECTORIES( ${GDAL_LIBRARY_DIRS} )
# ENDIF(OTB_USE_EXTERNAL_GDAL)
......@@ -193,10 +198,13 @@ ENDIF(APPLE AND NOT FLTK_USE_X)
#INCLUDE_DIRECTORIES(${FLTK_INCLUDES})
#LINK_DIRECTORIES( $ENV{FLTK_DIR_LIB} )
#ROMAIN
INCLUDE_DIRECTORIES (
${OTB_BINARY_DIR}
${OTB_SOURCE_DIR}
#THOMAS
# $ENV{GDAL_DIR_LIB}
# $ENV{GDAL_DIR_INCLUDES}
)
INCLUDE_DIRECTORIES( ${OTB_INCLUDE_DIRS} )
......@@ -261,7 +269,9 @@ ENDIF(NOT OTB_NO_LIBRARY_VERSION)
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
#THOMAS
SET(OTB_LIBRARY_PATH "${LIBRARY_OUTPUT_PATH}")
# SET(OTB_LIBRARY_PATH "${LIBRARY_OUTPUT_PATH}" $ENV{GDAL_DIR_LIB} ${ITK_LIBRARY_DIRS})
SET(OTB_EXECUTABLE_PATH "${EXECUTABLE_OUTPUT_PATH}")
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
......
......@@ -5,6 +5,11 @@
# This file is configured by OTB and used by the UseOTB.cmake module
# to load OTB's settings for an external project.
# Option use external ITK.
SET(OTB_USE_EXTERNAL_ITK "@OTB_USE_EXTERNAL_ITK@")
# The OTB source tree.
SET(OTB_SOURCE_DIR "@OTB_SOURCE_DIR@")
......@@ -46,9 +51,11 @@ SET(OTB_CableSwig_DIR "@OTB_CableSwig_DIR_CONFIG@")
# SET(OTB_LIBRARIES OTBAlgorithms OTBStatistics OTBFEM)
# The OTB library dependencies.
IF(NOT OTB_NO_LIBRARY_DEPENDS)
IF(NOT OTB_NO_LIBRARY_DEPENDS AND
EXISTS "@OTB_LIBRARY_DEPENDS_FILE@")
INCLUDE("@OTB_LIBRARY_DEPENDS_FILE@")
ENDIF(NOT OTB_NO_LIBRARY_DEPENDS)
ENDIF(NOT OTB_NO_LIBRARY_DEPENDS AND
EXISTS "@OTB_LIBRARY_DEPENDS_FILE@")
# Whether OTB was built using a system VXL.
SET(OTB_USE_SYSTEM_VXL "@OTB_USE_SYSTEM_VXL@")
......
......@@ -8,3 +8,7 @@ ENDIF(NOT OTB_USE_EXTERNAL_ITK)
# SUBDIRS( GDAL )
#ENDIF(NOT OTB_USE_EXTERNAL_GDAL)
#THOMAS - 4 juillet 2006
#-----------------------------------------------------------------------------
# Install the UseOTB.cmake file configured from the top-level.
INSTALL_FILES(/lib/otb ".cmake" "OTBConfig")
......@@ -23,6 +23,11 @@ CONFIGURE_FILE(${ITK_SOURCE_DIR}/itkConfigure.h.in
${ITK_BINARY_DIR}/itkConfigure.h)
# Install some files.
#INSTALL_FILES(/lib/otb .cmake UseITK ITKConfig )
#-----------------------------------------------------------------------------
# Configure Dart testing support. This should be done before any
# MESSAGE(FATAL_ERROR ...) commands are invoked.
......@@ -183,7 +188,19 @@ IF(ITK_NEED_CableSwig)
ENDIF(ITK_NEED_CableSwig)
#-----------------------------------------------------------------------------
# Copy the UseITK.cmake file to the binary tree for backward compatability.
CONFIGURE_FILE(${ITK_SOURCE_DIR}/UseITK.cmake.in
${ITK_BINARY_DIR}/UseITK.cmake COPYONLY IMMEDIATE)
# Create the ITKConfig.cmake file containing the ITK configuration.
INCLUDE (${ITK_SOURCE_DIR}/itkGenerateITKConfig.cmake)
# Install some files.
#THOMAS
INSTALL_FILES(/include/otb/Utilities/ITK .h itkConfigure)
#THOMAS
#INSTALL_FILES(/lib/InsightToolkit .cmake UseITK ITKLibraryDepends)
#-----------------------------------------------------------------------------
# Find wrapping language API libraries.
......
......@@ -15,7 +15,7 @@ ENDIF(ITK_USE_SYSTEM_GDCM)
#-----------------------------------------------------------------------------
# Include directories from the build tree.
SET(ITK_INCLUDE_DIRS_BUILD_TREE ${ITK_BINARY_DIR})
SET(ITK_INCLUDE_DIRS_BUILD_TREE ${ITK_INCLUDE_DIRS})
# These directories are always needed.
SET(ITK_INCLUDE_DIRS_BUILD_TREE ${ITK_INCLUDE_DIRS_BUILD_TREE}
......@@ -108,7 +108,9 @@ ENDIF(ITK_USE_SYSTEM_VXL)
#-----------------------------------------------------------------------------
# Include directories from the install tree.
SET(ITK_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/InsightToolkit")
#THOMAS
SET(ITK_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/otb/Utilities/ITK")
#SET(ITK_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/InsightToolkit")
SET(ITK_INCLUDE_DIRS_INSTALL_TREE ${ITK_INCLUDE_DIRS_INSTALL_TREE}
${ITK_INSTALL_INCLUDE_DIR}
${ITK_INSTALL_INCLUDE_DIR}/Algorithms
......
......@@ -17,11 +17,16 @@ SET(OTB_BUILD_SETTINGS_FILE ${OTB_BINARY_DIR}/OTBBuildSettings.cmake)
# Library directory.
SET(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_PATH})
# THOMAS
SET(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_DIRS_CONFIG} ${GDAL_LIBRARY_DIRS} ${ITK_LIBRARY_DIRS} )
# Determine the include directories needed.
SET(OTB_INCLUDE_DIRS_CONFIG
${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_INCLUDE_DIRS_SOURCE_TREE}
${OTB_INCLUDE_DIRS_SYSTEM}
#THOMAS
${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
${OTB_INCLUDE_DIRS_SYSTEM}
)
#-----------------------------------------------------------------------------
......@@ -44,7 +49,7 @@ SET(OTB_BUILD_SETTINGS_FILE
${CMAKE_INSTALL_PREFIX}/lib/otb/OTBBuildSettings.cmake)
# Include directories.
SET(OTB_INCLUDE_DIRS_CONFIG
SET(OTB_INCLUDE_DIRS_CONFIG
${OTB_INCLUDE_DIRS_INSTALL_TREE}
${OTB_INCLUDE_DIRS_SYSTEM}
)
......@@ -52,7 +57,11 @@ SET(OTB_INCLUDE_DIRS_CONFIG
# Link directories.
SET(OTB_LIBRARY_DIRS_CONFIG ${CMAKE_INSTALL_PREFIX}/lib/otb)
#THOMAS
SET(OTB_LIBRARY_DIRS_CONFIG ${OTB_LIBRARY_DIRS_CONFIG} ${GDAL_LIBRARY_DIRS} ${ITK_LIBRARY_DIRS} )
#-----------------------------------------------------------------------------
# Configure OTBConfig.cmake for the install tree.
#CONFIGURE_FILE(${OTB_SOURCE_DIR}/CMake/OTBConfig.cmake.in
# ${OTB_BINARY_DIR}/Utilities/OTBConfig.cmake @ONLY IMMEDIATE)
#THOMAS
CONFIGURE_FILE(${OTB_SOURCE_DIR}/OTBConfig.cmake.in
${OTB_BINARY_DIR}/Utilities/OTBConfig.cmake @ONLY IMMEDIATE)
......@@ -26,15 +26,24 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
# ${GDAL_INCLUDE_DIRS_BUILD_TREE}
# )
# ENDIF(NOT OTB_USE_EXTERNAL_GDAL)
# $ENV{GDAL_DIR_LIB}
#THOMAS
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${GDAL_INCLUDE_DIRS} )
#-----------------------------------------------------------------------------
# Include directories from the ITK build tree.e
IF(NOT OTB_USE_EXTERNAL_ITK)
#THOMAS
IF(OTB_USE_EXTERNAL_ITK)
INCLUDE(${ITK_SOURCE_DIR}/Utilities/itkThirdParty.cmake)
INCLUDE(${ITK_SOURCE_DIR}/itkIncludeDirectories.cmake)
ELSE(OTB_USE_EXTERNAL_ITK)
INCLUDE(${OTB_SOURCE_DIR}/Utilities/ITK/itkIncludeDirectories.cmake)
SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
${ITK_INCLUDE_DIRS_BUILD_TREE}
)
ENDIF(NOT OTB_USE_EXTERNAL_ITK)
ENDIF(OTB_USE_EXTERNAL_ITK)
#-----------------------------------------------------------------------------
......@@ -44,6 +53,21 @@ SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX)
SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX} )
#THOMAS
SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
${GDAL_INCLUDE_DIRS} )
#THOMAS
IF(OTB_USE_EXTERNAL_ITK)
SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
${ITK_INCLUDE_DIRS} )
# ${ITK_INCLUDE_DIRS_INSTALL_TREE} )
ELSE(OTB_USE_EXTERNAL_ITK)
SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
${ITK_INCLUDE_DIRS_BUILD_TREE}
${ITK_INCLUDE_DIRS_BUILD_TREE_CXX} )
ENDIF(OTB_USE_EXTERNAL_ITK)
#-----------------------------------------------------------------------------
# Include directories from the install tree.
SET(OTB_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/otb")
......@@ -57,11 +81,33 @@ SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
${OTB_INSTALL_INCLUDE_DIR}/Learning
${OTB_INSTALL_INCLUDE_DIR}/Visu
${OTB_INSTALL_INCLUDE_DIR}/Utilities
${OTB_INSTALL_INCLUDE_DIR}/Utilities/CAI
${OTB_INSTALL_INCLUDE_DIR}/Utilities/GDAL
${OTB_INSTALL_INCLUDE_DIR}/Utilities/ITK
#THOMAS
# ${ITK_INSTALL_INCLUDE_DIR}
# ${ITK_INCLUDE_DIRS}
)
#THOMAS
SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
${GDAL_INCLUDE_DIRS} )
#THOMAS
#THOMAS
IF(OTB_USE_EXTERNAL_ITK)
SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
${ITK_INCLUDE_DIRS} )
# ${ITK_INCLUDE_DIRS_INSTALL_TREE} )
ELSE(OTB_USE_EXTERNAL_ITK)
SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
${ITK_INCLUDE_DIRS_BUILD_TREE}
${ITK_INCLUDE_DIRS_BUILD_TREE_CXX} )
ENDIF(OTB_USE_EXTERNAL_ITK)
#SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
# ${ITK_INCLUDE_DIRS_INSTALL_TREE} )
# ${ITK_INCLUDE_DIRS} )
#IF(NOT OTB_USE_SYSTEM_VXL)
# SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
......@@ -70,7 +116,6 @@ SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
# )
#ENDIF(NOT OTB_USE_SYSTEM_VXL)
#-----------------------------------------------------------------------------
# Include directories for 3rd-party utilities provided by OTB.
#OTB_THIRD_PARTY_INCLUDE(ZLIB zlib)
......
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