Salome HOME
d25cffe6330423fc61081303eaca21cab8cffb2e
[modules/yacs.git] / adm / cmake / 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-2013  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.
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
32 FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot)
33
34 FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h)
35 SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz)
36
37 FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY      NAMES cdt PATH_SUFFIXES bin)
38 FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph PATH_SUFFIXES bin)
39 FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc PATH_SUFFIXES bin)
40 FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
41
42 SET(GRAPHVIZ_LIBRARIES 
43   ${GRAPHVIZ_cdt_LIBRARY}
44   ${GRAPHVIZ_graph_LIBRARY} 
45   ${GRAPHVIZ_gvc_LIBRARY}
46   ${GRAPHVIZ_pathplan_LIBRARY}
47   )
48
49 ## Don't detect cgraph on Windows
50 #IF(NOT WIN32)
51 #  FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)
52 #  SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_cgraph_LIBRARY})
53 #ENDIF()
54
55 # Handle the standard arguments of the find_package() command:
56 INCLUDE(FindPackageHandleStandardArgs)
57 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS 
58                                            GRAPHVIZ_EXECUTABLE 
59                                            GRAPHVIZ_LIBRARIES 
60                                            GRAPHVIZ_INCLUDE_DIRS)