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 $ENV{DEVLIBS_PATH}//include//
30 PATH_SUFFIXES
31 gc
32 )
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 )
44 if (GC_LIBRARY)
45 set(GC_FOUND TRUE)
46 endif (GC_LIBRARY)
48 set(BOEHMGC_INCLUDE_DIRS
49 ${BOEHMGC_INCLUDE_DIR}
50 )
52 if (GC_FOUND)
53 set(BOEHMGC_LIBRARIES
54 ${BOEHMGC_LIBRARIES}
55 ${GC_LIBRARY}
56 )
57 endif (GC_FOUND)
59 if (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES)
60 set(BOEHMGC_FOUND TRUE)
61 endif (BOEHMGC_INCLUDE_DIRS AND BOEHMGC_LIBRARIES)
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)
73 # show the BOEHMGC_INCLUDE_DIRS and BOEHMGC_LIBRARIES variables only in the advanced view
74 mark_as_advanced(BOEHMGC_INCLUDE_DIRS BOEHMGC_LIBRARIES)
76 endif (BOEHMGC_LIBRARIES AND BOEHMGC_INCLUDE_DIRS)