1 # - Try to find PANGOMM
2 # Once done this will define
3 #
4 # PANGOMM_FOUND - system has PANGOMM
5 # PANGOMM_INCLUDE_DIRS - the PANGOMM include directory
6 # PANGOMM_LIBRARIES - Link these to use PANGOMM
7 # PANGOMM_DEFINITIONS - Compiler switches required for using PANGOMM
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 (PANGOMM_LIBRARIES AND PANGOMM_INCLUDE_DIRS)
18 # in cache already
19 set(PANGOMM_FOUND TRUE)
20 else (PANGOMM_LIBRARIES AND PANGOMM_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(pangomm-1.4 _PANGOMM_INCLUDEDIR _PANGOMM_LIBDIR _PANGOMM_LDFLAGS _PANGOMM_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(_PANGOMM pangomm-1.4)
30 endif (PKG_CONFIG_FOUND)
31 endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
32 find_path(PANGOMM_INCLUDE_DIR
33 NAMES
34 pangomm.h
35 PATHS
36 ${_PANGOMM_INCLUDEDIR}
37 /usr/include
38 /usr/local/include
39 /opt/local/include
40 /sw/include
41 PATH_SUFFIXES
42 pangomm-1.4
43 )
45 find_library(PANGOMM-1.4_LIBRARY
46 NAMES
47 pangomm-1.4
48 PATHS
49 ${_PANGOMM_LIBDIR}
50 /usr/lib
51 /usr/local/lib
52 /opt/local/lib
53 /sw/lib
54 )
56 if (PANGOMM-1.4_LIBRARY)
57 set(PANGOMM-1.4_FOUND TRUE)
58 endif (PANGOMM-1.4_LIBRARY)
60 set(PANGOMM_INCLUDE_DIRS
61 ${PANGOMM_INCLUDE_DIR}
62 )
64 if (PANGOMM-1.4_FOUND)
65 set(PANGOMM_LIBRARIES
66 ${PANGOMM_LIBRARIES}
67 ${PANGOMM-1.4_LIBRARY}
68 )
69 endif (PANGOMM-1.4_FOUND)
71 if (PANGOMM_INCLUDE_DIRS AND PANGOMM_LIBRARIES)
72 set(PANGOMM_FOUND TRUE)
73 endif (PANGOMM_INCLUDE_DIRS AND PANGOMM_LIBRARIES)
75 if (PANGOMM_FOUND)
76 if (NOT PANGOMM_FIND_QUIETLY)
77 message(STATUS "Found PANGOMM: ${PANGOMM_LIBRARIES}")
78 endif (NOT PANGOMM_FIND_QUIETLY)
79 else (PANGOMM_FOUND)
80 if (PANGOMM_FIND_REQUIRED)
81 message(FATAL_ERROR "Could not find PANGOMM")
82 endif (PANGOMM_FIND_REQUIRED)
83 endif (PANGOMM_FOUND)
85 # show the PANGOMM_INCLUDE_DIRS and PANGOMM_LIBRARIES variables only in the advanced view
86 mark_as_advanced(PANGOMM_INCLUDE_DIRS PANGOMM_LIBRARIES)
88 endif (PANGOMM_LIBRARIES AND PANGOMM_INCLUDE_DIRS)