Commit 76b762ac authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fixing bug #87 (still not working fine)

parent 40497e0e
......@@ -344,43 +344,44 @@ ENDIF (NOT TIFF_INCLUDE_DIRS)
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIRS})
# Check if gdal has tiff library
SET(GDAL_HAS_TIFF 0)
IF(NOT DEFINED GDAL_HAS_TIFF)
TRY_COMPILE(GDAL_HAS_TIFF
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasTiff.cxx
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIRS}" "-DLINK_DIRECTORIES:PATH=${GDAL_LIBRARY_DIRS}" "-DLINK_LIBRARIES:STRING=gdal"
OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_TIFF)
MESSAGE("-- Testing if GDAL has tiff -- yes.")
MESSAGE(STATUS "Testing if GDAL has tiff -- yes.")
SET(TIFF_LIBRARY gdal)
ELSE(GDAL_HAS_TIFF)
MESSAGE("-- Testing if GDAL has tiff -- no.")
MESSAGE(STATUS "Testing if GDAL has tiff -- no.")
FIND_LIBRARY(TIFF_LIBRARY tiff PATHS)
IF (NOT TIFF_LIBRARY)
MESSAGE(FATAL_ERROR
"Cannot find tiff library. Please set TIFF_LIBRARY.")
ENDIF (NOT TIFF_LIBRARY)
ENDIF(GDAL_HAS_TIFF)
ENDIF(NOT DEFINED GDAL_HAS_TIFF)
# Check if gdal has geotiff library
SET(GDAL_HAS_GEOTIFF 0)
IF(NOT DEFINED GDAL_HAS_GEOTIFF)
TRY_COMPILE(GDAL_HAS_GEOTIFF
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasGeoTiff.cxx
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIRS}" "-DLINK_DIRECTORIES:PATH=${GDAL_LIBRARY_DIRS}" "-DLINK_LIBRARIES:STRING=gdal"
OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_GEOTIFF)
MESSAGE("-- Testing if GDAL has geotiff -- yes.")
MESSAGE(STATUS "Testing if GDAL has geotiff -- yes.")
SET(GEOTIFF_LIBRARY gdal)
ELSE(GDAL_HAS_GEOTIFF)
MESSAGE("-- Testing if GDAL has geotiff -- no.")
MESSAGE(STATUS "Testing if GDAL has geotiff -- no.")
FIND_LIBRARY(GEOTIFF_LIBRARY geotiff PATHS)
IF (NOT GEOTIFF_LIBRARY)
MESSAGE(FATAL_ERROR
"Cannot find geotiff library. Please set LIBGEOTIFF_LIBRARY_DIR.")
ENDIF (NOT GEOTIFF_LIBRARY)
ENDIF(GDAL_HAS_GEOTIFF)
ENDIF(NOT DEFINED GDAL_HAS_GEOTIFF)
#-------------------------------
......
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