Salome HOME
Revert "Synchronize adm files"
[tools/documentation.git] / CMakeModules / FindGraphviz.cmake
1 # - Graphviz detection
2 #
3 # Output variables: GRAPHVIZ_EXECUTABLE   - where is executable 'dot' takes place.
4 #                   GRAPHVIZ_INCLUDE_DIRS - where to find headers.
5 #                   GRAPHVIZ_LIBRARIES    - where to get libraries.
6 #                   GRAPHVIZ_FOUND        - True if Graphiz was found.
7 #
8 ###########################################################################
9 # Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
10 #
11 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
12 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
13 #
14 # This library is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU Lesser General Public
16 # License as published by the Free Software Foundation; either
17 # version 2.1 of the License, or (at your option) any later version.
18 #
19 # This library is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22 # Lesser General Public License for more details.
23 #
24 # You should have received a copy of the GNU Lesser General Public
25 # License along with this library; if not, write to the Free Software
26 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
27 #
28 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
29 #
30
31 FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot)
32
33 FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h)
34 SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz)
35
36 FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY      NAMES cdt PATH_SUFFIXES bin)
37 FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph PATH_SUFFIXES bin)
38 FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc PATH_SUFFIXES bin)
39 FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
40
41 SET(GRAPHVIZ_LIBRARIES 
42   ${GRAPHVIZ_cdt_LIBRARY}
43   ${GRAPHVIZ_graph_LIBRARY} 
44   ${GRAPHVIZ_gvc_LIBRARY}
45   ${GRAPHVIZ_pathplan_LIBRARY}
46   )
47
48 ## Don't detect cgraph on Windows
49 #IF(NOT WIN32)
50 #  FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
51 #  SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_cgraph_LIBRARY})
52 #ENDIF()
53
54 # Handle the standard arguments of the find_package() command:
55 INCLUDE(FindPackageHandleStandardArgs)
56 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS 
57                                            GRAPHVIZ_EXECUTABLE 
58                                            GRAPHVIZ_LIBRARIES 
59                                            GRAPHVIZ_INCLUDE_DIRS)