Code

Cmake: More Dependency work, added new files
[inkscape.git] / CMakeScripts / FindBoehmGC.cmake
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 #
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     PATH_SUFFIXES
30       gc
31   )
33   find_library(GC_LIBRARY
34     NAMES
35       gc
36     PATHS
37       /usr/lib
38       /usr/local/lib
39       /opt/local/lib
40       /sw/lib
41   )
43   if (GC_LIBRARY)
44     set(GC_FOUND TRUE)
45   endif (GC_LIBRARY)
47   set(BOEHMGC_INCLUDE_DIRS
48     ${BOEHMGC_INCLUDE_DIR}
49   )
51   if (GC_FOUND)
52     set(BOEHMGC_LIBRARIES
53       ${BOEHMGC_LIBRARIES}
54       ${GC_LIBRARY}
55     )
56   endif (GC_FOUND)
58   if (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES)
59      set(BOEHMGC_FOUND TRUE)
60   endif (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES)
62   if (BOEHMGC_FOUND)
63     if (NOT BoehmGC_FIND_QUIETLY)
64       message(STATUS "Found BoehmGC: ${BOEHMGC_LIBRARIES}")
65     endif (NOT BoehmGC_FIND_QUIETLY)
66   else (BOEHMGC_FOUND)
67     if (BoehmGC_FIND_REQUIRED)
68       message(FATAL_ERROR "Could not find BoehmGC")
69     endif (BoehmGC_FIND_REQUIRED)
70   endif (BOEHMGC_FOUND)
72   # show the BOEHMGC_INCLUDE_DIRS and BOEHMGC_LIBRARIES variables only in the advanced view
73   mark_as_advanced(BOEHMGC_INCLUDE_DIRS BOEHMGC_LIBRARIES)
75 endif (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS)