File: FindShapelib.cmake

package info (click to toggle)
plplot 5.10.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,280 kB
  • ctags: 13,512
  • sloc: ansic: 83,001; xml: 27,081; ada: 18,878; cpp: 15,966; tcl: 11,651; python: 7,075; f90: 7,058; ml: 6,974; java: 6,665; perl: 5,029; sh: 2,210; makefile: 199; lisp: 75; sed: 25; fortran: 7
file content (34 lines) | stat: -rw-r--r-- 1,234 bytes parent folder | download | duplicates (2)
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
34
# 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 /usr/local/include /usr/include)

if(SHAPELIB_INCLUDE_DIR)
  find_library(SHAPELIB_LIBRARY
  NAMES shp
  PATHS /usr/local/lib /usr/lib
  )
  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)