From: Anthony Geay Date: Fri, 8 Jan 2016 09:48:00 +0000 (+0100) Subject: Standardize behaviour of graphviz. When GRAPHVIZ_ROOT_DIR cmake var is NOT defined... X-Git-Tag: V7_8_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bfd4db4f8a149cebb656f6928bec1252cdf7d902;p=modules%2Fkernel.git Standardize behaviour of graphviz. When GRAPHVIZ_ROOT_DIR cmake var is NOT defined and that dot is in the path now it works. --- diff --git a/salome_adm/cmake_files/FindGraphviz.cmake b/salome_adm/cmake_files/FindGraphviz.cmake index af89f0cf3..35aada439 100644 --- a/salome_adm/cmake_files/FindGraphviz.cmake +++ b/salome_adm/cmake_files/FindGraphviz.cmake @@ -35,6 +35,14 @@ FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot) FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/cgraph.h) SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz) +IF(GRAPHVIZ_EXECUTABLE) + IF(NOT CMAKE_PREFIX_PATH) # Case where dot is in the path and -DGRAPHVIZ_ROOT_DIR not defined. + GET_FILENAME_COMPONENT(GRAPHVIZ_EXECUTABLE_DIR ${GRAPHVIZ_EXECUTABLE} PATH) + GET_FILENAME_COMPONENT(GRAPHVIZ_EXECUTABLE_DIR ${GRAPHVIZ_EXECUTABLE_DIR} PATH) + SET(CMAKE_PREFIX_PATH "${GRAPHVIZ_EXECUTABLE_DIR}") + ENDIF(NOT CMAKE_PREFIX_PATH) +ENDIF(GRAPHVIZ_EXECUTABLE) + FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY NAMES cdt PATH_SUFFIXES bin) FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY NAMES cgraph PATH_SUFFIXES bin) FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY NAMES gvc PATH_SUFFIXES bin)