File: FindPROJ.cmake

package info (click to toggle)
garmindev 0.3.4%2Bsvn3432-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 704 kB
  • ctags: 985
  • sloc: cpp: 8,631; makefile: 4
file content (87 lines) | stat: -rw-r--r-- 2,047 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# - Try to find PROJ
# Once done this will define
#
#  PROJ_FOUND - system has PROJ
#  PROJ_INCLUDE_DIRS - the PROJ include directory
#  PROJ_LIBRARIES - Link these to use PROJ
#  PROJ_DEFINITIONS - Compiler switches required for using PROJ
#
#  Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#


if (PROJ_LIBRARIES AND PROJ_INCLUDE_DIRS)
  # in cache already
  set(PROJ_FOUND TRUE)
else (PROJ_LIBRARIES AND PROJ_INCLUDE_DIRS)

  find_path(PROJ_INCLUDE_DIR
    NAMES
      projects.h
    PATHS
        /usr/include
        /usr/local/include
        /opt/local/include
        /sw/include
        C:/Progra~1/FWTools2.2.8/include
        C:/Progra~1/FWTools2.1.0/include
    PATH_SUFFIXES
        proj4

  )
  mark_as_advanced(PROJ_INCLUDE_DIR)

  find_library(LIBPROJ_LIBRARY
    NAMES
        proj
        proj
        proj_i
    PATHS
        /usr/lib
        /usr/local/lib
        /opt/local/lib
        /sw/lib
        C:/Progra~1/FWTools2.2.8/lib
        C:/Progra~1/FWTools2.1.0/lib
     
  )
  mark_as_advanced(LIBPROJ_LIBRARY)

  if (LIBPROJ_LIBRARY)
    set(LIBPROJ_FOUND TRUE)
  endif (LIBPROJ_LIBRARY)

  set(PROJ_INCLUDE_DIRS
    ${PROJ_INCLUDE_DIR}
  )

  if (LIBPROJ_FOUND)
    set(PROJ_LIBRARIES
      ${PROJ_LIBRARIES}
      ${LIBPROJ_LIBRARY}
    )
  endif (LIBPROJ_FOUND)

  if (PROJ_INCLUDE_DIRS AND PROJ_LIBRARIES)
     set(PROJ_FOUND TRUE)
  endif (PROJ_INCLUDE_DIRS AND PROJ_LIBRARIES)

  if (PROJ_FOUND)
    if (NOT PROJ_FIND_QUIETLY)
      message(STATUS "Found PROJ: ${PROJ_LIBRARIES}")
    endif (NOT PROJ_FIND_QUIETLY)
  else (PROJ_FOUND)
    if (PROJ_FIND_REQUIRED)
      message(FATAL_ERROR "Could not find PROJ")
    endif (PROJ_FIND_REQUIRED)
  endif (PROJ_FOUND)

  # show the PROJ_INCLUDE_DIRS and PROJ_LIBRARIES variables only in the advanced view
  mark_as_advanced(PROJ_INCLUDE_DIRS PROJ_LIBRARIES)

endif (PROJ_LIBRARIES AND PROJ_INCLUDE_DIRS)