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_VERSION - Graphviz version
7 # GRAPHVIZ_DEFINITIONS - Graphviz definitions
8 # GRAPHVIZ_FOUND - True if Graphviz was found.
10 ###########################################################################
11 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
13 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
14 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
16 # This library is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU Lesser General Public
18 # License as published by the Free Software Foundation; either
19 # version 2.1 of the License, or (at your option) any later version.
21 # This library is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 # Lesser General Public License for more details.
26 # You should have received a copy of the GNU Lesser General Public
27 # License along with this library; if not, write to the Free Software
28 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
33 FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot)
35 FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/cgraph.h)
36 SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz)
38 FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY NAMES cdt PATH_SUFFIXES bin)
39 FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY NAMES cgraph PATH_SUFFIXES bin)
40 FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY NAMES gvc PATH_SUFFIXES bin)
41 FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
43 SET(GRAPHVIZ_LIBRARIES
44 ${GRAPHVIZ_cdt_LIBRARY}
45 ${GRAPHVIZ_graph_LIBRARY}
46 ${GRAPHVIZ_gvc_LIBRARY}
47 ${GRAPHVIZ_pathplan_LIBRARY}
50 IF(GRAPHVIZ_EXECUTABLE)
51 EXECUTE_PROCESS(COMMAND ${GRAPHVIZ_EXECUTABLE} "-V" ERROR_VARIABLE GRAPHVIZ_VERSION ERROR_STRIP_TRAILING_WHITESPACE)
52 STRING(REGEX REPLACE ".* ([0-9.]+) .*" "\\1" GRAPHVIZ_VERSION "${GRAPHVIZ_VERSION}")
55 SET(GRAPHVIZ_DEFINITIONS)
56 IF("${GRAPHVIZ_VERSION}" VERSION_LESS "2.36.0")
57 SET(GRAPHVIZ_DEFINITIONS -DWITH_CGRAPH)
60 ## Don't detect cgraph on Windows
62 # FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY NAMES cgraph PATH_SUFFIXES bin)
63 # SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_cgraph_LIBRARY})
66 # Handle the standard arguments of the find_package() command:
67 INCLUDE(FindPackageHandleStandardArgs)
68 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS
71 GRAPHVIZ_INCLUDE_DIRS)