File: FindShapelib.cmake

package info (click to toggle)
plplot 5.15.0%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,312 kB
  • sloc: ansic: 79,707; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 50; sed: 34; fortran: 5
file content (33 lines) | stat: -rw-r--r-- 1,174 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Find shapelib header and library.
#

# This module defines the following uncached variables:
#  SHAPELIB_FOUND, if false, do not try to use shapelib.
#  SHAPELIB_INCLUDE_DIR, where to find shapefil.h.
#  SHAPELIB_LIBRARIES, the libraries to link against to use the shapelib
#  library.
#  SHAPELIB_LIBRARY_DIRS, the directory where the shapelib library is found.

find_path(SHAPELIB_INCLUDE_DIR shapefil.h)

if(SHAPELIB_INCLUDE_DIR)
  find_library(SHAPELIB_LIBRARY
  NAMES shp shapelib
  )
  if(SHAPELIB_LIBRARY)
    # Set uncached variables as per standard.
    set(SHAPELIB_FOUND ON)
    set(SHAPELIB_LIBRARIES ${SHAPELIB_LIBRARY})
    get_filename_component(SHAPELIB_LIBRARY_DIRS ${SHAPELIB_LIBRARY} PATH)
  endif(SHAPELIB_LIBRARY)
endif(SHAPELIB_INCLUDE_DIR)

if(SHAPELIB_FOUND)
  if(NOT SHAPELIB_FIND_QUIETLY)
    message(STATUS "FindShapelib: Found shapelib header directory, ${SHAPELIB_INCLUDE_DIR}, and library, ${SHAPELIB_LIBRARIES}.")
  endif(NOT SHAPELIB_FIND_QUIETLY)
else(SHAPELIB_FOUND)
  if(SHAPELIB_FIND_REQUIRED)
    message(FATAL_ERROR "FindShapelib: Could not find shapelib header and/or library.")
  endif(SHAPELIB_FIND_REQUIRED)
endif(SHAPELIB_FOUND)