Commit e3ddcb66 authored by Julien Michel's avatar Julien Michel
Browse files

COMP: Small bug with if defined logics

parent 313eb090
......@@ -365,7 +365,6 @@ ENDIF (NOT OGR_INCLUDE_DIRS)
INCLUDE_DIRECTORIES(${OGR_INCLUDE_DIRS})
# Check if ${GDAL_LIBRARY} has tiff library
SET(TIFF_LIBRARY ${GDAL_LIBRARY})
TRY_COMPILE(GDAL_HAS_TIFF
${CMAKE_CURRENT_BINARY_DIR}CMake
${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasTiff.cxx
......@@ -373,9 +372,9 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIRS
OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_TIFF)
MESSAGE(STATUS "Testing if GDAL has tiff -- yes")
SET(TIFF_LIBRARY ${GDAL_LIBRARY})
ELSE(GDAL_HAS_TIFF)
MESSAGE(STATUS "Testing if GDAL has tiff -- no")
MESSAGE(${OUTPUT})
FIND_LIBRARY(TIFF_LIBRARY tiff PATHS)
IF (NOT TIFF_LIBRARY)
MESSAGE(FATAL_ERROR
......@@ -384,7 +383,6 @@ ENDIF (NOT TIFF_LIBRARY)
ENDIF(GDAL_HAS_TIFF)
# Check if ${GDAL_LIBRARY} has geotiff library
SET(GEOTIFF_LIBRARY ${GDAL_LIBRARY})
TRY_COMPILE(GDAL_HAS_GEOTIFF
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasGeoTiff.cxx
......@@ -392,9 +390,9 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_D
OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_GEOTIFF)
MESSAGE(STATUS "Testing if GDAL has geotiff -- yes")
SET(GEOTIFF_LIBRARY ${GDAL_LIBRARY})
ELSE(GDAL_HAS_GEOTIFF)
MESSAGE(STATUS "Testing if GDAL has geotiff -- no")
MESSAGE(${OUTPUT})
FIND_LIBRARY(GEOTIFF_LIBRARY geotiff PATHS)
IF (NOT GEOTIFF_LIBRARY)
MESSAGE(FATAL_ERROR
......@@ -403,7 +401,6 @@ ENDIF (NOT GEOTIFF_LIBRARY)
ENDIF(GDAL_HAS_GEOTIFF)
# Check if ${GDAL_LIBRARY} has jpeg library
SET(JPEG_LIBRARY ${GDAL_LIBRARY})
TRY_COMPILE(GDAL_HAS_JPEG
${CMAKE_CURRENT_BINARY_DIR}/CMake
${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasJpeg.cxx
......@@ -411,9 +408,9 @@ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${JPEG_INCLUDE_DIRS};${GDAL_INCLUDE_DIRS
OUTPUT_VARIABLE OUTPUT)
IF(GDAL_HAS_JPEG)
MESSAGE(STATUS "Testing if GDAL has jpeg -- yes")
SET(JPEG_LIBRARY ${GDAL_LIBRARY})
ELSE(GDAL_HAS_JPEG)
MESSAGE(STATUS "Testing if GDAL has jpeg -- no")
MESSAGE(${OUTPUT})
FIND_LIBRARY(JPEG_LIBRARY jpeg PATHS)
IF (NOT JPEG_LIBRARY)
MESSAGE(FATAL_ERROR
......
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