From 36c807d219b489046e80e5d9c6c8e45217845a97 Mon Sep 17 00:00:00 2001 From: "Maintenance team (INV)" Date: Fri, 10 Oct 2014 23:21:01 +0400 Subject: [PATCH] Synchronize adm files --- .../cmake_files/FindGraphviz.cmake | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/adm_local_without_kernel/cmake_files/FindGraphviz.cmake b/adm_local_without_kernel/cmake_files/FindGraphviz.cmake index ecae91f0a..5457f7a66 100644 --- a/adm_local_without_kernel/cmake_files/FindGraphviz.cmake +++ b/adm_local_without_kernel/cmake_files/FindGraphviz.cmake @@ -3,7 +3,9 @@ # Output variables: GRAPHVIZ_EXECUTABLE - where is executable 'dot' takes place. # GRAPHVIZ_INCLUDE_DIRS - where to find headers. # GRAPHVIZ_LIBRARIES - where to get libraries. -# GRAPHVIZ_FOUND - True if Graphiz was found. +# GRAPHVIZ_VERSION - Graphviz version +# GRAPHVIZ_DEFINITIONS - Graphviz definitions +# GRAPHVIZ_FOUND - True if Graphviz was found. # ########################################################################### # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE @@ -30,11 +32,11 @@ FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot) -FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h) +FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/cgraph.h) SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz) FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY NAMES cdt PATH_SUFFIXES bin) -FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY NAMES graph PATH_SUFFIXES bin) +FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY NAMES cgraph PATH_SUFFIXES bin) FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY NAMES gvc PATH_SUFFIXES bin) FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin) @@ -45,6 +47,16 @@ SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_pathplan_LIBRARY} ) +IF(GRAPHVIZ_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${GRAPHVIZ_EXECUTABLE} "-V" ERROR_VARIABLE GRAPHVIZ_VERSION ERROR_STRIP_TRAILING_WHITESPACE) + STRING(REGEX REPLACE ".* ([0-9.]+) .*" "\\1" GRAPHVIZ_VERSION "${GRAPHVIZ_VERSION}") +ENDIF() + +SET(GRAPHVIZ_DEFINITIONS) +IF("${GRAPHVIZ_VERSION}" VERSION_LESS "2.36.0") + SET(GRAPHVIZ_DEFINITIONS -DWITH_CGRAPH) +ENDIF() + ## Don't detect cgraph on Windows #IF(NOT WIN32) # FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY NAMES cgraph PATH_SUFFIXES bin) -- 2.39.2