File: FindCD.cmake

package info (click to toggle)
plplot 5.9.0-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 26,256 kB
  • ctags: 9,353
  • sloc: ansic: 64,079; xml: 22,799; cpp: 8,562; tcl: 8,314; perl: 4,872; python: 4,462; f90: 4,310; java: 4,090; sh: 1,481; makefile: 261; php: 102; fortran: 59; sed: 5
file content (38 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download
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
35
36
37
38
# Find cd header and library.  This is the public domain library 
# (see http://prdownloads.sourceforge.net/plplot/cd1.3.tar.gz?download
# for a copy) for creating CGM (Computer Graphics Metafile, see
# http://www.agocg.ac.uk/train/cgm/cgm.htm) files.
#

# This module defines the following uncached variables:
#  CD_FOUND, if false, do not try to use CD.
#  CD_INCLUDE_DIRS, where to find cd.h.
#  CD_LIBRARIES, the libraries to link against to use libcd.a
#  CD_LIBRARY_DIRS, the directory where libcd.a is found.

find_path(CD_INCLUDE_DIR cd.h /usr/local/include /usr/include)

if(CD_INCLUDE_DIR)
  find_library(CD_LIBRARY
  NAMES cd
  PATHS /usr/local/lib /usr/lib
  )
  if(CD_LIBRARY)
    set(CD_LIBRARY_DIR "")
    get_filename_component(CD_LIBRARY_DIRS ${CD_LIBRARY} PATH)
    # Set uncached variables as per standard.
    set(CD_FOUND ON)
    set(CD_INCLUDE_DIRS ${CD_INCLUDE_DIR})
    set(CD_LIBRARIES ${CD_LIBRARY})
  endif(CD_LIBRARY)
endif(CD_INCLUDE_DIR)
	    
if(CD_FOUND)
  if(NOT CD_FIND_QUIETLY)
    message(STATUS "FindCD: Found both cd.h and libcd.a")
  endif(NOT CD_FIND_QUIETLY)
else(CD_FOUND)
  if(CD_FIND_REQUIRED)
    message(FATAL_ERROR "FindCD: Could not find cd.h and/or libcd.a")
  endif(CD_FIND_REQUIRED)
endif(CD_FOUND)