Skip to content
Permalink
Browse files

[GRASS] try to get off_t from Make/platform.h

  • Loading branch information
blazek committed Oct 22, 2015
1 parent f7f8d7e commit ca704913631b17846c6beae4ff4c080d9c8f2869
Showing with 20 additions and 0 deletions.
  1. +20 −0 cmake/FindGRASS.cmake
@@ -84,6 +84,26 @@ MACRO (CHECK_GRASS G_PREFIX)
#MESSAGE(STATUS "GRASS_OFF_T_SIZE${GRASS_FIND_VERSION} = ${GRASS_OFF_T_SIZE${GRASS_FIND_VERSION}}")
ENDIF( (GRASS_MAJOR_VERSION${GRASS_FIND_VERSION} EQUAL 7) AND (GRASS_MINOR_VERSION${GRASS_FIND_VERSION} GREATER 0) )

IF ( "${GRASS_OFF_T_SIZE${GRASS_FIND_VERSION}}" STREQUAL "" )
IF(EXISTS ${GRASS_INCLUDE_DIR${GRASS_CACHE_VERSION}}/Make/Platform.make)
FILE(READ ${GRASS_INCLUDE_DIR${GRASS_CACHE_VERSION}}/Make/Platform.make PLATFORMFILE)
STRING(REGEX MATCH "LFS_CFLAGS *=[^\n]*" PLATFORM_LFS_CFLAGS ${PLATFORMFILE})
IF ( NOT "${PLATFORM_LFS_CFLAGS}" STREQUAL "" )
STRING(REGEX MATCH "_FILE_OFFSET_BITS=.." FILE_OFFSET_BITS ${PLATFORM_LFS_CFLAGS})
#MESSAGE(STATUS "FILE_OFFSET_BITS = ${FILE_OFFSET_BITS}")
IF ( NOT "${FILE_OFFSET_BITS}" STREQUAL "" )
STRING(REGEX MATCH "[0-9][0-9]" FILE_OFFSET_BITS ${FILE_OFFSET_BITS})
#MESSAGE(STATUS "FILE_OFFSET_BITS = ${FILE_OFFSET_BITS}")
IF ( "${FILE_OFFSET_BITS}" STREQUAL "32" )
SET( GRASS_OFF_T_SIZE${GRASS_FIND_VERSION} 4 )
ELSEIF( "${FILE_OFFSET_BITS}" STREQUAL "64" )
SET( GRASS_OFF_T_SIZE${GRASS_FIND_VERSION} 8 )
ENDIF()
ENDIF()
ENDIF()
ENDIF()
ENDIF()

IF(GRASS_LIBRARIES_FOUND${GRASS_FIND_VERSION})
SET(GRASS_FOUND${GRASS_FIND_VERSION} TRUE)
SET(GRASS_FOUND TRUE) # GRASS_FOUND is true if at least one version was found

0 comments on commit ca70491

Please sign in to comment.
You can’t perform that action at this time.