Commit aae8cb2e authored by Thomas Feuvrier's avatar Thomas Feuvrier

Ajout option qui test la presence du fichier GL/glu.h. FATAL_ERROR si pas trouve !

parent af842200
......@@ -68,7 +68,7 @@ SET(OTB_VERSION_STRING "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_
#-----------------------------------------------------------------------------
# Option for generate Visu tools !!!
OPTION(OTB_USE_VISU_GUI "Generate Gui/Visu tools directory. If ON, find OpenGL and FLTK package." ON)
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)
IF(OTB_USE_VISU_GUI)
......@@ -80,11 +80,13 @@ IF(OTB_USE_VISU_GUI)
IF(OPENGL_INCLUDE_PATH)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_PATH})
ENDIF(OPENGL_INCLUDE_PATH)
# MESSAGE("OPENGL_INCLUDE_PATH -> ${OPENGL_INCLUDE_PATH}")
# MESSAGE("OPENGL_INCLUDE_DIR -> ${OPENGL_INCLUDE_DIR}")
# MESSAGE("OPENGL_LIBRARIES -> ${OPENGL_LIBRARIES}")
# MESSAGE("OPENGL_LIBRARY -> ${OPENGL_LIBRARY}")
FIND_PATH(OTB_GLU_INCLUDE_PATH "GL/glu.h" ${OPENGL_INCLUDE_PATH})
IF(NOT OTB_GLU_INCLUDE_PATH)
MESSAGE(FATAL_ERROR "Impossible to find GLU files (include lib), detected by FIND_PACKAGE(OpenGL) command.")
MESSAGE(FATAL_ERROR "Cannot build OTB Visu module without GLU library.")
MESSAGE(FATAL_ERROR " => You must install GLU (Mesa package, etc.) on your system OR set OTB_USE_VISU to OFF to desactivated OTB Visu module generation !")
ENDIF(NOT OTB_GLU_INCLUDE_PATH)
#-------------------------------
# FLTK Library
#-------------------------------
......@@ -93,10 +95,6 @@ IF(OTB_USE_VISU_GUI)
OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ON)
MARK_AS_ADVANCED(OTB_USE_EXTERNAL_FLTK)
# Add an option to use or not use FLTK (http://www.fltk.org)
# SET(CMAKE_MODULE_PATH "/usr/share/CMake")
# SET( FLTK_INCLUDE_DIR /usr/include )
IF(OTB_USE_EXTERNAL_FLTK)
FIND_PACKAGE(FLTK)
......@@ -106,22 +104,6 @@ IF(OTB_USE_VISU_GUI)
ENDIF(NOT FLTK_INCLUDE_DIR)
IF(FLTK_FOUND)
# IF(NOT EXISTS "${FLTK_BINARY_DIR}/FLTKConfig.cmake")
# MESSAGE(FATAL_ERROR "Impossible to find the file ${FLTK_BINARY_DIR}/FLTKConfig.cmake. You must generate FLTK with cmake process.")
# ELSE(NOT EXISTS "${FLTK_BINARY_DIR}/FLTKConfig.cmake")
# INCLUDE(${FLTK_BINARY_DIR}/FLTKConfig.cmake)
# ENDIF(NOT EXISTS "${FLTK_BINARY_DIR}/FLTKConfig.cmake")
# MESSAGE("FLUID_COMMAND -> ${FLUID_COMMAND}")
# MESSAGE("FLTK_BINARY_DIR -> ${FLTK_BINARY_DIR}")
# MESSAGE("FLTK_USE_FILE -> ${FLTK_USE_FILE}")
# MESSAGE("FLTK_INCLUDE_DIRS -> ${FLTK_INCLUDE_DIRS}")
# MESSAGE("FLTK_LIBRARY_DIRS -> ${FLTK_LIBRARY_DIRS}")
# MESSAGE("FLTK_LIBRARIES -> ${FLTK_LIBRARIES}")
# MESSAGE("FLTK_DIR -> ${FLTK_DIR}")
# MESSAGE("FLTK_FLUID_COMMAND -> ${FLTK_FLUID_COMMAND}")
# MESSAGE("FLTK_EXECUTABLE_DIRS -> ${FLTK_EXECUTABLE_DIRS}")
INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIRS})
LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS})
ELSE(FLTK_FOUND)
......@@ -185,37 +167,6 @@ IF(OTB_USE_VISU_GUI)
ENDIF(OTB_USE_VISU_GUI)
#MESSAGE("FLUID_COMMAND -> ${FLUID_COMMAND}")
#MESSAGE("FLTK_BINARY_DIR -> ${FLTK_BINARY_DIR}")
#MESSAGE("FLTK_USE_FILE -> ${FLTK_USE_FILE}")
#MESSAGE("FLTK_INCLUDE_DIRS -> ${FLTK_INCLUDE_DIRS}")
#MESSAGE("FLTK_LIBRARY_DIRS -> ${FLTK_LIBRARY_DIRS}")
#MESSAGE("FLTK_LIBRARIES -> ${FLTK_LIBRARIES}")
#MESSAGE("FLTK_DIR -> ${FLTK_DIR}")
#MESSAGE("FLTK_FLUID_COMMAND -> ${FLTK_FLUID_COMMAND}")
#MESSAGE("FLTK_EXECUTABLE_DIRS -> ${FLTK_EXECUTABLE_DIRS}")
#MESSAGE("OTB_VISU_GUI_LIBRARIES -> ${OTB_VISU_GUI_LIBRARIES}")
#-------------------------------
# Librairie ITK
#-------------------------------
OPTION(OTB_USE_EXTERNAL_ITK "Use an outside build of ITK." OFF)
IF(OTB_USE_EXTERNAL_ITK)
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR
"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)
ENDIF(OTB_USE_EXTERNAL_ITK)
#SET(CURL_INCLUDE_DIR )
#MARK_AS_ADVANCED(CURL_INCLUDE_DIRS)
#SET(CURL_LIBRARY )
#MARK_AS_ADVANCED(CURL_LIBRARY_DIRS)
#-------------------------------
# CURL Library
#-------------------------------
......@@ -273,12 +224,10 @@ MESSAGE(FATAL_ERROR
"Cannot find GDAL include directory. Please set GDAL_INCLUDE_DIRS.")
ENDIF (NOT GDAL_INCLUDE_DIRS)
INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIRS})
LINK_DIRECTORIES( ${GDAL_LIBRARY_DIRS} )
#-------------------------------
# ITK Library
#-------------------------------
......@@ -294,72 +243,6 @@ IF(OTB_USE_EXTERNAL_ITK)
ENDIF(ITK_FOUND)
ENDIF(OTB_USE_EXTERNAL_ITK)
#SET(CURL_INCLUDE_DIR )
#MARK_AS_ADVANCED(CURL_INCLUDE_DIRS)
#SET(CURL_LIBRARY )
#MARK_AS_ADVANCED(CURL_LIBRARY_DIRS)
#-------------------------------
# CURL Library
#-------------------------------
OPTION(OTB_USE_CURL "Use curl library." OFF)
MARK_AS_ADVANCED(OTB_USE_CURL)
IF(OTB_USE_CURL)
# INCLUDE(CheckIncludeFiles)
# INCLUDE(CheckLibraryExists)
# CHECK_INCLUDE_FILES("curl/curl.h" OTB_HAVE_CURL_HEADER)
# CHECK_LIBRARY_EXISTS("curl" "curl_easy_init" "" OTB_HAVE_CURL_LIBRARY)
# IF( NOT OTB_HAVE_CURL_HEADER )
# MESSAGE("Cannot find CURL include directory. Please set CURL_INCLUDE_DIRS or SET OTB_USE_CURL OFF.")
# ENDIF( NOT OTB_HAVE_CURL_HEADER)
# IF( NOT OTB_HAVE_CURL_LIBRARY )
# MESSAGE("Cannot find CURL include directory. Please set CURL_LIBRARY_DIRS or SET OTB_USE_CURL OFF.")
# ENDIF( NOT OTB_HAVE_CURL_LIBRARY)
FIND_PATH(CURL_INCLUDE_DIR curl/curl.h PATHS)
MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
IF (NOT CURL_INCLUDE_DIR)
MESSAGE(FATAL_ERROR
"Cannot find CURL include directory. Please set CURL_INCLUDE_DIR or SET OTB_USE_CURL OFF.")
ENDIF (NOT CURL_INCLUDE_DIR)
FIND_LIBRARY(CURL_LIBRARY curl )
MARK_AS_ADVANCED(CURL_LIBRARY)
IF (NOT CURL_LIBRARY)
MESSAGE(FATAL_ERROR
"Cannot find CURL library. Please set CURL_LIBRARY or SET OTB_USE_CURL OFF.")
ENDIF (NOT CURL_LIBRARY)
# Add compiler option
ADD_DEFINITIONS(-DOTB_USE_CURL)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
ENDIF(OTB_USE_CURL)
#-------------------------------
# GDAL Library
#-------------------------------
#FIND_LIBRARY(GDAL_LIBRARY_DIRS gdal PATHS $ENV{GDAL_LIBRARY_DIRS} )
FIND_PATH(GDAL_LIBRARY_DIRS gdal PATHS $ENV{GDAL_LIBRARY_DIRS} )
FIND_PATH(GDAL_INCLUDE_DIRS gdal.h $ENV{GDAL_INCLUDE_DIRS} /usr/include/gdal)
IF (NOT GDAL_LIBRARY_DIRS)
MESSAGE(FATAL_ERROR
"Cannot find GDAL library directory. Please set GDAL_LIBRARY_DIRS.")
ENDIF (NOT GDAL_LIBRARY_DIRS)
IF (NOT GDAL_INCLUDE_DIRS)
MESSAGE(FATAL_ERROR
"Cannot find GDAL include directory. Please set GDAL_INCLUDE_DIRS.")
ENDIF (NOT GDAL_INCLUDE_DIRS)
INCLUDE_DIRECTORIES(${GDAL_INCLUDE_DIRS})
LINK_DIRECTORIES( ${GDAL_LIBRARY_DIRS} )
#-------------------------------
# End connections whith external libraries
......
......@@ -28,6 +28,13 @@ SET(OTB_REQUIRED_LINK_FLAGS "@OTB_REQUIRED_LINK_FLAGS@")
SET(OTB_VERSION_MAJOR "@OTB_VERSION_MAJOR@")
SET(OTB_VERSION_MINOR "@OTB_VERSION_MINOR@")
SET(OTB_VERSION_PATCH "@OTB_VERSION_PATCH@")
SET(OTB_VERSION_STRING "@OTB_VERSION_STRING@")
# The ITK version number
SET(ITK_VERSION_MAJOR "@ITK_VERSION_MAJOR@")
SET(ITK_VERSION_MINOR "@ITK_VERSION_MINOR@")
SET(ITK_VERSION_PATCH "@ITK_VERSION_PATCH@")
SET(ITK_VERSION_STRING "@ITK_VERSION_STRING@")
# The location of the UseOTB.cmake file.
SET(OTB_USE_FILE "@OTB_USE_FILE@")
......@@ -80,3 +87,22 @@ SET(FLTK_PLATFORM_DEPENDENT_LIBS "@FLTK_PLATFORM_DEPENDENT_LIBS@")
SET(OTB_USE_VISU_GUI "@OTB_USE_VISU_GUI@")
SET(OTB_VISU_GUI_LIBRARIES "@OTB_VISU_GUI_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@")
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