summaryrefslogtreecommitdiffstats
path: root/Modules/FindGnuplot.cmake
blob: b4ea6ab3f39a6940adc3232bf0d385a9f5fefebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindGnuplot
-----------

this module looks for gnuplot



Once done this will define

::

  GNUPLOT_FOUND - system has Gnuplot
  GNUPLOT_EXECUTABLE - the Gnuplot executable
  GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)



GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
#]=======================================================================]

include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindMsys.cmake)

find_program(GNUPLOT_EXECUTABLE
  NAMES
  gnuplot
  pgnuplot
  wgnupl32
  PATHS
  ${CYGWIN_INSTALL_PATH}/bin
  ${MSYS_INSTALL_PATH}/usr/bin
)

if (GNUPLOT_EXECUTABLE)
    execute_process(COMMAND "${GNUPLOT_EXECUTABLE}" --version
                  OUTPUT_VARIABLE GNUPLOT_OUTPUT_VARIABLE
                  ERROR_QUIET
                  OUTPUT_STRIP_TRAILING_WHITESPACE)

    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()

# for compatibility
set(GNUPLOT ${GNUPLOT_EXECUTABLE})

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot
                                  REQUIRED_VARS GNUPLOT_EXECUTABLE
                                  VERSION_VAR GNUPLOT_VERSION_STRING)

mark_as_advanced( GNUPLOT_EXECUTABLE )
>* | | Merge topic 'cpack-rpm-and-deb-runcmake-tests'Brad King2015-06-1621-28/+392 |\ \ \ | * | | Tests: Move RunCMake.CPackRPM case into RunCMake.CPack_RPM testDomen Vrankar2015-06-157-28/+6 | * | | Tests: Add RunCMake tests for CPack{Deb,RPM}Domen Vrankar2015-06-1516-0/+386 * | | | CMake Nightly Date StampKitware Robot2015-06-161-1/+1 | |_|/ |/| | * | | Merge topic 'FindCUDA-fix-ccache'Brad King2015-06-151-9/+23 |\ \ \ | * | | FindCUDA: Resolve a host compiler symlink only if it is Apple cc -> clangBill Hoffman2015-06-151-9/+23 * | | | Merge topic 'compiler-launcher'Brad King2015-06-1521-0/+119 |\ \ \ \ | * | | | Add options to launch the compiler through tools like ccache or distccBill Hoffman2015-06-1521-0/+119 * | | | | Merge topic 'ctest_update-RETURN_VALUE'Brad King2015-06-156-16/+112 |\ \ \ \ \ | * | | | | ctest_update: Fix RETURN_VALUE on VCS tool failure (#15610)Brad King2015-06-116-2/+99 | * | | | | Tests: Teach CTest.Update* tests to check ctest_update return codeBrad King2015-06-111-2/+10 | * | | | | Tests: Simplify CTest.UpdateGIT QUIET mode testBrad King2015-06-112-13/+4 * | | | | | Merge topic 'fix-fast-special-targets'Brad King2015-06-154-14/+25 |\ \ \ \ \ \ | * | | | | | cmGlobalGenerator: Add ComputeHomeRelativeOutputPath method.Stephen Kelly2015-06-134-13/+25 | * | | | | | cmLocalUnixMakefileGenerator3: Remove unused variable.Stephen Kelly2015-06-131-1/+0 | | |_|_|_|/ | |/| | | | * | | | | | CMake Nightly Date StampKitware Robot2015-06-151-1/+1 * | | | | | CMake Nightly Date StampKitware Robot2015-06-141-1/+1 * | | | | | CMake Nightly Date StampKitware Robot2015-06-131-1/+1 | |_|_|/ / |/| | | | * | | | | CMake Nightly Date StampKitware Robot2015-06-121-1/+1 |/ / / / * | | | Merge topic 'FindBISON-DEFINES_FILE'Brad King2015-06-112-61/+100 |\ \ \ \ | * | | | Help: Add notes for topic 'FindBISON-DEFINES_FILE'Brad King2015-06-111-0/+6 | * | | | FindBISON: Add DEFINES_FILE option to pass --defines=FILEEon Jeong2015-06-091-8/+26 | * | | | FindBISON: Use CMAKE_PARSE_ARGUMENTS to parse argumentsEon Jeong2015-06-091-18/+23 | * | | | FindBISON: Use BISON_TARGET macro argument names internallyEon Jeong2015-06-091-5/+5 | * | | | FindBISON: Improve documentation formattingBrad King2015-06-091-33/+43 * | | | | Merge topic 'fix-CMP0009-future-states'Brad King2015-06-111-8/+4 |\ \ \ \ \ | * | | | | cmFileCommand: Fix implementation of CMP0009.Stephen Kelly2015-06-091-8/+4 * | | | | | Merge topic 'minor-cleanups'Brad King2015-06-114-12/+1 |\ \ \ \ \ \ | * | | | | | cmLocalGenerator: Remove ConfigureFinalPass.Stephen Kelly2015-06-093-11/+1 | * | | | | | project(): Remove unused variable.Stephen Kelly2015-06-091-1/+0 | |/ / / / / * | | | | | CMake Nightly Date StampKitware Robot2015-06-111-1/+1 | |_|/ / / |/| | | | * | | | | Merge branch 'release'Brad King2015-06-100-0/+0 |\ \ \ \ \ | * | | | | CMake 3.3.0-rc2v3.3.0-rc2Brad King2015-06-091-1/+1 * | | | | | CMake Nightly Date StampKitware Robot2015-06-101-1/+1 | |/ / / / |/| | | | * | | | | Merge branch 'release'Brad King2015-06-090-0/+0 |\ \ \ \ \ | |/ / / / | * | | | Merge branch 'doc-policy-OLD-deprecated' into releaseBrad King2015-06-0967-5/+139 | |\ \ \ \ | * \ \ \ \ Merge branch 'doc-drop-incorrect-cmake-developer-advice' into releaseBrad King2015-06-081-1/+0 | |\ \ \ \ \ | * \ \ \ \ \ Merge branch 'revert-mingw-no-find_library-dll' into releaseBrad King2015-06-082-7/+1 | |\ \ \ \ \ \ | * \ \ \ \ \ \ Merge branch 'ctest-script-mode-no-legacy-cygwin' into releaseBrad King2015-06-081-0/+4 | |\ \ \ \ \ \ \ | * \ \ \ \ \ \ \ Merge branch 'cmake-gui-osx-install-command-line' into releaseBrad King2015-06-08