Commit cd324f9d authored by Julien Michel's avatar Julien Michel

COMP: Fixing INCLUDE_DIRECTORIES at first cmake run when using internal ITK

parent c679138b
...@@ -143,6 +143,10 @@ IF(OTB_USE_EXTERNAL_ITK) ...@@ -143,6 +143,10 @@ IF(OTB_USE_EXTERNAL_ITK)
MESSAGE(FATAL_ERROR 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.") "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(ITK_FOUND)
ELSE(OTB_USE_EXTERNAL_ITK)
# Required to have proper itk headers at first run
SET(ITK_SOURCE_DIR ${OTB_SOURCE_DIR}/Utilities/ITK)
SET(ITK_BINARY_DIR ${OTB_BINARY_DIR}/Utilities/ITK)
ENDIF(OTB_USE_EXTERNAL_ITK) ENDIF(OTB_USE_EXTERNAL_ITK)
...@@ -344,6 +348,7 @@ ENDIF (NOT TIFF_INCLUDE_DIRS) ...@@ -344,6 +348,7 @@ ENDIF (NOT TIFF_INCLUDE_DIRS)
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIRS})
# Check if gdal has tiff library # Check if gdal has tiff library
SET(TIFF_LIBRARY gdal)
IF(NOT DEFINED GDAL_HAS_TIFF) IF(NOT DEFINED GDAL_HAS_TIFF)
TRY_COMPILE(GDAL_HAS_TIFF TRY_COMPILE(GDAL_HAS_TIFF
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -352,7 +357,6 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIRS ...@@ -352,7 +357,6 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIRS
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_TIFF) IF(GDAL_HAS_TIFF)
MESSAGE(STATUS "Testing if GDAL has tiff -- yes.") MESSAGE(STATUS "Testing if GDAL has tiff -- yes.")
SET(TIFF_LIBRARY gdal)
ELSE(GDAL_HAS_TIFF) ELSE(GDAL_HAS_TIFF)
MESSAGE(STATUS "Testing if GDAL has tiff -- no.") MESSAGE(STATUS "Testing if GDAL has tiff -- no.")
FIND_LIBRARY(TIFF_LIBRARY tiff PATHS) FIND_LIBRARY(TIFF_LIBRARY tiff PATHS)
...@@ -364,6 +368,7 @@ ENDIF(GDAL_HAS_TIFF) ...@@ -364,6 +368,7 @@ ENDIF(GDAL_HAS_TIFF)
ENDIF(NOT DEFINED GDAL_HAS_TIFF) ENDIF(NOT DEFINED GDAL_HAS_TIFF)
# Check if gdal has geotiff library # Check if gdal has geotiff library
SET(GEOTIFF_LIBRARY gdal)
IF(NOT DEFINED GDAL_HAS_GEOTIFF) IF(NOT DEFINED GDAL_HAS_GEOTIFF)
TRY_COMPILE(GDAL_HAS_GEOTIFF TRY_COMPILE(GDAL_HAS_GEOTIFF
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -372,7 +377,6 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_D ...@@ -372,7 +377,6 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_D
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_GEOTIFF) IF(GDAL_HAS_GEOTIFF)
MESSAGE(STATUS "Testing if GDAL has geotiff -- yes.") MESSAGE(STATUS "Testing if GDAL has geotiff -- yes.")
SET(GEOTIFF_LIBRARY gdal)
ELSE(GDAL_HAS_GEOTIFF) ELSE(GDAL_HAS_GEOTIFF)
MESSAGE(STATUS "Testing if GDAL has geotiff -- no.") MESSAGE(STATUS "Testing if GDAL has geotiff -- no.")
FIND_LIBRARY(GEOTIFF_LIBRARY geotiff PATHS) FIND_LIBRARY(GEOTIFF_LIBRARY geotiff PATHS)
......
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