diff options
Diffstat (limited to 'trunk/cmake/Modules/FindSIGC++.cmake')
-rw-r--r-- | trunk/cmake/Modules/FindSIGC++.cmake | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/trunk/cmake/Modules/FindSIGC++.cmake b/trunk/cmake/Modules/FindSIGC++.cmake new file mode 100644 index 0000000..236ee3d --- /dev/null +++ b/trunk/cmake/Modules/FindSIGC++.cmake | |||
@@ -0,0 +1,43 @@ | |||
1 | # - Try to find SigC++-2.0 | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # SIGC++_FOUND - system has SigC++ | ||
5 | # SIGC++_INCLUDE_DIR - the SigC++ include directory | ||
6 | # SIGC++_LIBRARY - SigC++ library | ||
7 | |||
8 | if(SIGC++_INCLUDE_DIR AND SIGC++_LIBRARIES) | ||
9 | # Already in cache, be silent | ||
10 | set(SIGC++_FIND_QUIETLY TRUE) | ||
11 | endif(SIGC++_INCLUDE_DIR AND SIGC++_LIBRARIES) | ||
12 | |||
13 | if (NOT WIN32) | ||
14 | include(FindPkgConfig) | ||
15 | pkgconfig(sigc++-2.0 _LibSIGC++IncDir _LibSIGC++LinkDir _LibSIGC++LinkFlags _LibSIGC++Cflags) | ||
16 | endif(NOT WIN32) | ||
17 | |||
18 | find_path(SIGC++_INCLUDE_DIR sigc++/sigc++.h | ||
19 | PATH_SUFFIXES sigc++-2.0 | ||
20 | PATHS ${_LibSIGC++IncDir} ) | ||
21 | |||
22 | find_library(SIGC++_LIBRARY | ||
23 | NAMES sigc-2.0 | ||
24 | PATHS ${_LibSIGC++LinkDir} ) | ||
25 | |||
26 | get_filename_component(sigc++LibDir "${SIGC++_LIBRARY}" PATH) | ||
27 | |||
28 | # search the sigc++config.h include dir under the same root where the library is found | ||
29 | |||
30 | find_path(SIGC++_CONFIG_INCLUDE_DIR sigc++config.h | ||
31 | PATH_SUFFIXES sigc++-2.0/include | ||
32 | PATHS ${_LibSIGC++IncDir} "${sigc++LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}) | ||
33 | |||
34 | # not sure if this include dir is optional or required | ||
35 | # for now it is optional | ||
36 | if(SIGC++_CONFIG_INCLUDE_DIR) | ||
37 | set(SIGC++_INCLUDE_DIR ${SIGC++_INCLUDE_DIR} "${SIGC++_CONFIG_INCLUDE_DIR}") | ||
38 | endif(SIGC++_CONFIG_INCLUDE_DIR) | ||
39 | |||
40 | include(FindPackageHandleStandardArgs) | ||
41 | find_package_handle_standard_args(SIGC++ DEFAULT_MSG SIGC++_LIBRARY SIGC++_INCLUDE_DIR) | ||
42 | |||
43 | mark_as_advanced(SIGC++_INCLUDE_DIR SIGC++_LIBRARY) | ||