Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add missing file FindLibSigc++
[simgrid.git] / buildtools / Cmake / Modules / FindLibSigc++.cmake
1 find_path(PATH_LIBSIGC++_H "sigc++/sigc++.h"
2   HINTS
3   $ENV{LD_LIBRARY_PATH}
4   PATH_SUFFIXES include/sigc++-2.0/ include/
5   PATHS
6   /opt
7   /opt/local
8   /opt/csw
9   /sw
10   /usr)
11
12 find_path(PATH_LIBSIGC++CONFIG_H "sigc++config.h"
13   HINTS
14   $ENV{LD_LIBRARY_PATH}
15   PATH_SUFFIXES lib/x86_64-linux-gnu/sigc++-2.0/include/ include/
16   PATHS
17   /opt
18   /opt/local
19   /opt/csw
20   /sw
21   /usr)
22
23 find_library(PATH_LIBSIGC++_LIB
24   NAMES sigc-2.0
25   HINTS
26   $ENV{LD_LIBRARY_PATH}
27   PATH_SUFFIXES lib/x86_64-linux-gnu/ lib/sigc++/ lib/
28   PATHS
29   /opt
30   /opt/local
31   /opt/csw
32   /sw
33   /usr)
34
35 message(STATUS "Looking for sigc++/sigc++.h")
36 if(PATH_LIBSIGC++_H)
37   message(STATUS "Looking for sigc++/sigc++.h - found")
38 else()
39   message(STATUS "Looking for sigc++/sigc++.h - not found")
40 endif()
41
42 message(STATUS "Looking for sigc++config.h")
43 if(PATH_LIBSIGC++CONFIG_H)
44   message(STATUS "Looking for sigc++config.h - found")
45 else()
46   message(STATUS "Looking for sigc++config.h - not found")
47 endif()
48
49 message(STATUS "Looking for libsigc++")
50 if(PATH_LIBSIGC++_LIB)
51   message(STATUS "Looking for libsigc++ - found")
52 else()
53   message(STATUS "Looking for libsigc++ - not found")
54 endif()
55
56 if(PATH_LIBSIGC++_LIB AND PATH_LIBSIGC++_H AND PATH_LIBSIGC++CONFIG_H)
57   string(REGEX REPLACE "/sigc\\+\\+/sigc\\+\\+.h" "" PATH_LIBSIGC++_H   "${PATH_LIBSIGC++_H}")
58   string(REGEX REPLACE "/sigc\\+\\+config.h" "" PATH_LIBSIGC++CONFIG_H   "${PATH_LIBSIGC++CONFIG_H}")
59   string(REGEX REPLACE "/libsig.*" "" PATH_LIBSIGC++_LIB "${PATH_LIBSIGC++_LIB}")
60       
61   include_directories(${PATH_LIBSIGC++_H})
62   include_directories(${PATH_LIBSIGC++CONFIG_H})
63   link_directories(${PATH_LIBSIGC++_LIB})
64   set(HAVE_LIBSIGC++ "1")
65 else()
66   set(HAVE_LIBSIGC++ "0")
67 endif()
68
69 mark_as_advanced(PATH_LIBSIGC++_H)
70 mark_as_advanced(PATH_LIBSIGC++CONFIG_H)
71 mark_as_advanced(PATH_LIBSIGC++_LIB)