Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
4c5d7acadb2ff89d2a694a5987230f67c51d40e1
[simgrid.git] / tools / cmake / Modules / FindGraphviz.cmake
1 find_path(HAVE_CGRAPH_H cgraph.h
2   HINTS  $ENV{LD_LIBRARY_PATH}
3   PATH_SUFFIXES include/graphviz include
4   PATHS         /opt;/opt/local;/opt/csw;/sw;/usr
5 )
6
7 find_library(HAVE_CGRAPH_LIB
8   NAME          cgraph
9   HINTS         $ENV{LD_LIBRARY_PATH}
10   PATH_SUFFIXES lib/graphviz lib
11   PATHS         /opt;/opt/local;/opt/csw;/sw;/usr)
12
13 find_library(HAVE_CDT_LIB
14   NAME          cdt
15   HINTS         $ENV{LD_LIBRARY_PATH}
16   PATH_SUFFIXES lib/graphviz lib
17   PATHS         /opt;/opt/local;/opt/csw;/sw;/usr)
18
19
20 if(HAVE_CDT_LIB AND HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H)
21   string(REGEX REPLACE "/libcgraph.*" "" lib_graphviz ${HAVE_CGRAPH_LIB})
22
23   string(REPLACE "/graphviz/cgraph.h" "" file_graphviz_h ${HAVE_CGRAPH_H})
24   string(REPLACE "/graphviz" "" file_graphviz_h ${file_graphviz_h})
25
26   include_directories(${file_graphviz_h} ${file_graphviz_h}/graphviz)
27   link_directories(${lib_graphviz})
28
29   set(HAVE_GRAPHVIZ "1")
30 else()
31   set(HAVE_GRAPHVIZ "0")
32 endif()
33
34 mark_as_advanced(HAVE_GRAPHVIZ)
35 unset(HAVE_CGRAPH_H)
36 unset(HAVE_CGRAPH_LIB)
37 unset(HAVE_CDT_LIB)
38
39 message(STATUS "Looking for graphviz")
40 if(HAVE_GRAPHVIZ)
41   message(STATUS "Looking for graphviz - found")
42 else()
43   message(STATUS "Looking for graphviz - not found")
44 endif()