Ticket #31034: patch-findgeos.diff

File patch-findgeos.diff, 2.7 KB (added by cmutel (Chris Mutel), 13 years ago)
  • cmake/FindGEOS.cmake

    old new  
    4343
    4444 IF(UNIX)
    4545
    46     # try to use framework on mac
    47     # want clean framework path, not unix compatibility path
    48     IF (APPLE)
    49       IF (CMAKE_FIND_FRAMEWORK MATCHES "FIRST"
    50           OR CMAKE_FRAMEWORK_PATH MATCHES "ONLY"
    51           OR NOT CMAKE_FIND_FRAMEWORK)
    52         SET (CMAKE_FIND_FRAMEWORK_save ${CMAKE_FIND_FRAMEWORK} CACHE STRING "" FORCE)
    53         SET (CMAKE_FIND_FRAMEWORK "ONLY" CACHE STRING "" FORCE)
    54         FIND_LIBRARY(GEOS_LIBRARY GEOS)
    55         IF (GEOS_LIBRARY)
    56           # they're all the same in a framework
    57           SET (GEOS_INCLUDE_DIR ${GEOS_LIBRARY}/Headers CACHE PATH "Path to a file.")
    58           # set GEOS_CONFIG to make later test happy, not used here, may not exist
    59           SET (GEOS_CONFIG ${GEOS_LIBRARY}/unix/bin/geos-config CACHE FILEPATH "Path to a program.")
    60           # version in info.plist
    61           GET_VERSION_PLIST (${GEOS_LIBRARY}/Resources/Info.plist GEOS_VERSION)
    62           IF (NOT GEOS_VERSION)
    63             MESSAGE (FATAL_ERROR "Could not determine GEOS version from framework.")
    64           ENDIF (NOT GEOS_VERSION)
    65           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" GEOS_VERSION_MAJOR "${GEOS_VERSION}")
    66           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" GEOS_VERSION_MINOR "${GEOS_VERSION}")
    67           IF (GEOS_VERSION_MAJOR LESS 3)
    68             MESSAGE (FATAL_ERROR "GEOS version is too old (${GEOS_VERSION}). Use 3.0.0 or higher.")
    69           ENDIF (GEOS_VERSION_MAJOR LESS 3)
    70         ENDIF (GEOS_LIBRARY)
    71         SET (CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_save} CACHE STRING "" FORCE)
    72       ENDIF ()
    73     ENDIF (APPLE)
    74 
    7546    IF (NOT GEOS_INCLUDE_DIR OR NOT GEOS_LIBRARY OR NOT GEOS_CONFIG)
    7647      # didn't find OS X framework, and was not set by user
    7748      SET(GEOS_CONFIG_PREFER_PATH "$ENV{GEOS_HOME}/bin" CACHE STRING "preferred path to GEOS (geos-config)")
     
    143114        ENDIF (GEOS_LIB_NAME_WITH_PREFIX)
    144115        #MESSAGE("DBG  GEOS_LIB_NAME=${GEOS_LIB_NAME}")
    145116
    146         IF (APPLE)
    147           IF (NOT GEOS_LIBRARY)
    148             # work around empty GEOS_LIBRARY left by framework check
    149             # while still preserving user setting if given
    150             # ***FIXME*** need to improve framework check so below not needed
    151             SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.dylib CACHE STRING INTERNAL FORCE)
    152           ENDIF (NOT GEOS_LIBRARY)
    153         ELSE (APPLE)
    154           SET(GEOS_LIBRARY ${GEOS_LINK_DIRECTORIES}/lib${GEOS_LIB_NAME}.so CACHE STRING INTERNAL)
    155         ENDIF (APPLE)
    156117        #MESSAGE("DBG  GEOS_LIBRARY=${GEOS_LIBRARY}")
    157118     
    158119      ELSE(GEOS_CONFIG)