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 | | |