Code

Indent support for XSLT extensions output.
[inkscape.git] / CMakeScripts / FindSigC++.cmake
1 # - Try to find SIGC++
2 # Once done this will define
3 #
4 #  SIGC++_FOUND - system has SIGC++
5 #  SIGC++_INCLUDE_DIRS - the SIGC++ include directory
6 #  SIGC++_LIBRARIES - Link these to use SIGC++
7 #  SIGC++_DEFINITIONS - Compiler switches required for using SIGC++
8 #
9 #  Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
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 (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS)
18   # in cache already
19   set(SIGC++_FOUND TRUE)
20 else (SIGC++_LIBRARIES AND SIGC++_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(sigc++-2.0 _SIGC++_INCLUDEDIR _SIGC++_LIBDIR _SIGC++_LDFLAGS _SIGC++_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(_SIGC++ sigc++-2.0)
30     endif (PKG_CONFIG_FOUND)
31   endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
33   find_path(SIGC++_INCLUDE_DIR
34     NAMES
35       sigc++/sigc++.h
36     PATHS
37       ${_SIGC++_INCLUDEDIR}
38       /usr/include
39       /usr/local/include
40       /opt/local/include
41       /sw/include
42     PATH_SUFFIXES
43       sigc++-2.0
44   )
46   find_path(SIGC++_CONFIG_INCLUDE_DIR
47     NAMES
48       sigc++config.h
49     PATHS
50       ${_SIGC++_INCLUDEDIR}
51       /usr/include
52       /usr/local/include
53       /opt/local/include
54       /opt/local/lib/sigc++-2.0/include
55       /sw/include
56       /usr/lib/sigc++-2.0/include
57       /usr/lib64/sigc++-2.0/include
58   )
60   find_library(SIGC-2.0_LIBRARY
61     NAMES
62       sigc-2.0
63     PATHS
64       ${_SIGC++_LIBDIR}
65       /usr/lib
66       /usr/local/lib
67       /opt/local/lib
68       /sw/lib
69   )
71   if (SIGC-2.0_LIBRARY)
72     set(SIGC-2.0_FOUND TRUE)
73   endif (SIGC-2.0_LIBRARY)
75   set(SIGC++_INCLUDE_DIRS
76     ${SIGC++_INCLUDE_DIR}
77     ${SIGC++_CONFIG_INCLUDE_DIR}
78   )
80   if (SIGC-2.0_FOUND)
81     set(SIGC++_LIBRARIES
82       ${SIGC++_LIBRARIES}
83       ${SIGC-2.0_LIBRARY}
84     )
85   endif (SIGC-2.0_FOUND)
87   if (SIGC++_INCLUDE_DIRS AND SIGC++_LIBRARIES)
88      set(SIGC++_FOUND TRUE)
89   endif (SIGC++_INCLUDE_DIRS AND SIGC++_LIBRARIES)
91   if (SIGC++_FOUND)
92     if (NOT SIGC++_FIND_QUIETLY)
93       message(STATUS "Found SIGC++: ${SIGC++_LIBRARIES}")
94     endif (NOT SIGC++_FIND_QUIETLY)
95   else (SIGC++_FOUND)
96     if (SIGC++_FIND_REQUIRED)
97       message(FATAL_ERROR "Could not find SIGC++")
98     endif (SIGC++_FIND_REQUIRED)
99   endif (SIGC++_FOUND)
101   # show the SIGC++_INCLUDE_DIRS and SIGC++_LIBRARIES variables only in the advanced view
102   mark_as_advanced(SIGC++_INCLUDE_DIRS SIGC++_LIBRARIES)
104 endif (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS)