1 # - Try to find GDKMM
2 # Once done this will define
3 #
4 # GDKMM_FOUND - system has GDKMM
5 # GDKMM_INCLUDE_DIRS - the GDKMM include directory
6 # GDKMM_LIBRARIES - Link these to use GDKMM
7 # GDKMM_DEFINITIONS - Compiler switches required for using GDKMM
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 (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS)
18 # in cache already
19 set(GDKMM_FOUND TRUE)
20 else (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS)
21 # use pkg-config to get the directories and then use these values
22 # in the FIND_PATH() and FIND_LIBRARY() calls
23 if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
24 include(UsePkgConfig)
25 pkgconfig(gdkmm-2.4 _GDKMM_INCLUDEDIR _GDKMM_LIBDIR _GDKMM_LDFLAGS _GDKMM_CFLAGS)
26 else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
27 find_package(PkgConfig)
28 if (PKG_CONFIG_FOUND)
29 pkg_check_modules(_GDKMM gdkmm-2.4)
30 endif (PKG_CONFIG_FOUND)
31 endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
32 find_path(GDKMM_INCLUDE_DIR
33 NAMES
34 gdkmm.h
35 PATHS
36 ${_GDKMM_INCLUDEDIR}
37 /usr/include
38 /usr/local/include
39 /opt/local/include
40 /opt/local/include/gdkmm-2.4
41 /sw/include
42 PATH_SUFFIXES
43 gdkmm-2.4
44 )
46 find_path(GDKMM_CONFIG_INCLUDE_DIR
47 NAMES
48 gdkmmconfig.h
49 PATHS
50 ${_GDKMM_INCLUDEDIR}
51 /usr/include
52 /usr/local/include
53 /opt/local/include
54 /opt/local/lib/gdkmm-2.4/include
55 /sw/include
56 /usr/lib/gdkmm-2.4/include
57 /usr/lib64/gdkmm-2.4/include
58 )
60 find_library(GDKMM-2.4_LIBRARY
61 NAMES
62 gdkmm-2.4
63 PATHS
64 ${_GDKMM_LIBDIR}
65 /usr/lib
66 /usr/local/lib
67 /opt/local/lib
68 /sw/lib
69 )
71 if (GDKMM-2.4_LIBRARY)
72 set(GDKMM-2.4_FOUND TRUE)
73 endif (GDKMM-2.4_LIBRARY)
75 set(GDKMM_INCLUDE_DIRS
76 ${GDKMM_INCLUDE_DIR}
77 ${GDKMM_CONFIG_INCLUDE_DIR}
78 )
80 if (GDKMM-2.4_FOUND)
81 set(GDKMM_LIBRARIES
82 ${GDKMM_LIBRARIES}
83 ${GDKMM-2.4_LIBRARY}
84 )
85 endif (GDKMM-2.4_FOUND)
87 if (GDKMM_INCLUDE_DIRS AND GDKMM_LIBRARIES)
88 set(GDKMM_FOUND TRUE)
89 endif (GDKMM_INCLUDE_DIRS AND GDKMM_LIBRARIES)
91 if (GDKMM_FOUND)
92 if (NOT GDKMM_FIND_QUIETLY)
93 message(STATUS "Found GDKMM: ${GDKMM_LIBRARIES}")
94 endif (NOT GDKMM_FIND_QUIETLY)
95 else (GDKMM_FOUND)
96 if (GDKMM_FIND_REQUIRED)
97 message(FATAL_ERROR "Could not find GDKMM")
98 endif (GDKMM_FIND_REQUIRED)
99 endif (GDKMM_FOUND)
101 # show the GDKMM_INCLUDE_DIRS and GDKMM_LIBRARIES variables only in the advanced view
102 mark_as_advanced(GDKMM_INCLUDE_DIRS GDKMM_LIBRARIES)
104 endif (GDKMM_LIBRARIES AND GDKMM_INCLUDE_DIRS)