Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a typo in the Makefile we propose to our users
[simgrid.git] / tools / cmake / Modules / FindLibdw.cmake
1 find_library(PATH_LIBDW_LIB
2   NAMES dw
3   HINTS
4   $ENV{SIMGRID_LIBDW_LIBRARY_PATH}
5   $ENV{LD_LIBRARY_PATH}
6   $ENV{LIBDW_LIBRARY_PATH}
7   PATH_SUFFIXES lib/ GnuWin32/lib
8   PATHS
9   /opt
10   /opt/local
11   /opt/csw
12   /sw
13   /usr)
14
15
16 find_path(PATH_LIBDW_H "elfutils/libdw.h"
17   HINTS
18   $ENV{SIMGRID_LIBDW_LIBRARY_PATH}
19   $ENV{LD_LIBRARY_PATH}
20   $ENV{LIBDW_LIBRARY_PATH}
21   PATH_SUFFIXES include/ GnuWin32/include
22   PATHS
23   /opt
24   /opt/local
25   /opt/csw
26   /sw
27   /usr)
28
29 message(STATUS "Looking for libdw.h")
30 if(PATH_LIBDW_H)
31   message(STATUS "Looking for libdw.h - found")
32 else()
33   message(STATUS "Looking for libdw.h - not found")
34 endif()
35
36 message(STATUS "Looking for libdw")
37 if(PATH_LIBDW_LIB)
38   message(STATUS "Looking for libdw - found")
39 else()
40   message(STATUS "Looking for libdw - not found")
41 endif()
42
43 if(PATH_LIBDW_LIB AND PATH_LIBDW_H)
44   string(REGEX REPLACE "/libdw.*[.]${LIB_EXE}$" "" PATH_LIBDW_LIB "${PATH_LIBDW_LIB}")
45   string(REGEX REPLACE "/libdw.h"               "" PATH_LIBDW_H   "${PATH_LIBDW_H}")
46
47   include_directories(${PATH_LIBDW_H})
48   link_directories(${PATH_LIBDW_LIB})
49
50 else()
51   message(FATAL_ERROR "Please either install the libdw-dev package (or equivalent) or turn off the model-checking option of SimGrid.")
52 endif()
53
54 mark_as_advanced(PATH_LIBDW_H)
55 mark_as_advanced(PATH_LIBDW_LIB)