2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# FindGnuplot
|
|
|
|
# -----------
|
|
|
|
#
|
|
|
|
# this module looks for gnuplot
|
|
|
|
#
|
|
|
|
#
|
2002-02-05 02:41:47 +03:00
|
|
|
#
|
2007-07-19 17:00:51 +04:00
|
|
|
# Once done this will define
|
|
|
|
#
|
2013-10-15 19:17:36 +04:00
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# GNUPLOT_FOUND - system has Gnuplot
|
|
|
|
# GNUPLOT_EXECUTABLE - the Gnuplot executable
|
|
|
|
# GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
|
|
|
|
#
|
|
|
|
#
|
2012-02-29 21:46:47 +04:00
|
|
|
#
|
|
|
|
# GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
|
2002-02-05 02:41:47 +03:00
|
|
|
|
2012-11-04 00:35:44 +04:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
|
2002-02-05 02:41:47 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_program(GNUPLOT_EXECUTABLE
|
2012-08-13 21:42:58 +04:00
|
|
|
NAMES
|
2002-02-05 02:41:47 +03:00
|
|
|
gnuplot
|
|
|
|
pgnuplot
|
|
|
|
wgnupl32
|
2007-07-19 17:00:51 +04:00
|
|
|
PATHS
|
2002-02-05 02:41:47 +03:00
|
|
|
${CYGWIN_INSTALL_PATH}/bin
|
|
|
|
)
|
2007-07-19 17:00:51 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if (GNUPLOT_EXECUTABLE)
|
|
|
|
execute_process(COMMAND "${GNUPLOT_EXECUTABLE}" --version
|
2012-01-28 01:36:37 +04:00
|
|
|
OUTPUT_VARIABLE GNUPLOT_OUTPUT_VARIABLE
|
|
|
|
ERROR_QUIET
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
string(REGEX REPLACE "^gnuplot ([0-9\\.]+)( patchlevel )?" "\\1." GNUPLOT_VERSION_STRING "${GNUPLOT_OUTPUT_VARIABLE}")
|
|
|
|
string(REGEX REPLACE "\\.$" "" GNUPLOT_VERSION_STRING "${GNUPLOT_VERSION_STRING}")
|
|
|
|
unset(GNUPLOT_OUTPUT_VARIABLE)
|
|
|
|
endif()
|
2012-01-28 01:36:37 +04:00
|
|
|
|
2007-07-19 17:00:51 +04:00
|
|
|
# for compatibility
|
2012-08-13 21:47:32 +04:00
|
|
|
set(GNUPLOT ${GNUPLOT_EXECUTABLE})
|
2007-07-19 17:00:51 +04:00
|
|
|
|
2012-08-13 21:42:58 +04:00
|
|
|
# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if
|
2007-07-19 17:00:51 +04:00
|
|
|
# all listed variables are TRUE
|
2012-08-13 21:47:32 +04:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
2012-01-28 01:36:37 +04:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot
|
|
|
|
REQUIRED_VARS GNUPLOT_EXECUTABLE
|
|
|
|
VERSION_VAR GNUPLOT_VERSION_STRING)
|
2007-07-19 17:00:51 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced( GNUPLOT_EXECUTABLE )
|
2007-07-19 17:00:51 +04:00
|
|
|
|