~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to CMakeScripts/Modules/FindBoehmGC.cmake

  • Committer: JazzyNico
  • Date: 2011-08-29 20:25:30 UTC
  • Revision ID: nicoduf@yahoo.fr-20110829202530-6deuoz11q90usldv
Code refactoring and merging with trunk (revision 10599).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# - Try to find BoehmGC
 
2
# Once done this will define
 
3
#
 
4
#  BOEHMGC_FOUND - system has BoehmGC
 
5
#  BOEHMGC_INCLUDE_DIRS - the BoehmGC include directory
 
6
#  BOEHMGC_LIBRARIES - Link these to use BoehmGC
 
7
#  BOEHMGC_DEFINITIONS - Compiler switches required for using BoehmGC
 
8
#
 
9
#  Copyright (c) 2008 Joshua L. Blocher <verbalshadow@gmail.com>
 
10
#
 
11
#  Redistribution and use is allowed according to the terms of the New
 
12
#  BSD license.
 
13
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
14
#
 
15
 
 
16
 
 
17
if (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS)
 
18
  # in cache already
 
19
  set(BOEHMGC_FOUND TRUE)
 
20
else (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS)
 
21
  find_path(BOEHMGC_INCLUDE_DIR
 
22
    NAMES
 
23
      gc.h
 
24
    PATHS
 
25
      /usr/include
 
26
      /usr/local/include
 
27
      /opt/local/include
 
28
      /sw/include
 
29
      $ENV{DEVLIBS_PATH}//include//
 
30
    PATH_SUFFIXES
 
31
      gc
 
32
  )
 
33
 
 
34
  find_library(GC_LIBRARY
 
35
    NAMES
 
36
      gc
 
37
    PATHS
 
38
      /usr/lib
 
39
      /usr/local/lib
 
40
      /opt/local/lib
 
41
      /sw/lib
 
42
  )
 
43
 
 
44
  if (GC_LIBRARY)
 
45
    set(GC_FOUND TRUE)
 
46
  endif (GC_LIBRARY)
 
47
 
 
48
  set(BOEHMGC_INCLUDE_DIRS
 
49
    ${BOEHMGC_INCLUDE_DIR}
 
50
  )
 
51
 
 
52
  if (GC_FOUND)
 
53
    set(BOEHMGC_LIBRARIES
 
54
      ${BOEHMGC_LIBRARIES}
 
55
      ${GC_LIBRARY}
 
56
    )
 
57
  endif (GC_FOUND)
 
58
 
 
59
  if (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES)
 
60
     set(BOEHMGC_FOUND TRUE)
 
61
  endif (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES)
 
62
 
 
63
  if (BOEHMGC_FOUND)
 
64
    if (NOT BoehmGC_FIND_QUIETLY)
 
65
      message(STATUS "Found BoehmGC: ${BOEHMGC_LIBRARIES}")
 
66
    endif (NOT BoehmGC_FIND_QUIETLY)
 
67
  else (BOEHMGC_FOUND)
 
68
    if (BoehmGC_FIND_REQUIRED)
 
69
      message(FATAL_ERROR "Could not find BoehmGC")
 
70
    endif (BoehmGC_FIND_REQUIRED)
 
71
  endif (BOEHMGC_FOUND)
 
72
 
 
73
  # show the BOEHMGC_INCLUDE_DIRS and BOEHMGC_LIBRARIES variables only in the advanced view
 
74
  mark_as_advanced(BOEHMGC_INCLUDE_DIRS BOEHMGC_LIBRARIES)
 
75
 
 
76
endif (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS)
 
77