File: FindPstoeditSvgOutput.cmake

package info (click to toggle)
calligra 1%3A3.2.1%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 261,632 kB
  • sloc: cpp: 650,836; xml: 27,662; python: 6,044; perl: 2,724; yacc: 1,817; ansic: 1,325; sh: 1,277; lex: 1,107; ruby: 1,010; javascript: 495; makefile: 17
file content (31 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (4)
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
# - Try to find Pstoedit with svg output plugin
# Once done this will define
#
#  PstoeditSvgOutput_FOUND - system has pstoedit with svg output plugin
#  PSTOEDIT_EXECUTABLE - path of the pstoedit executable
#  PSTOEDIT_VERSION - the version string, like "3.45"

find_program(PSTOEDIT_EXECUTABLE NAMES pstoedit)

include(MacroEnsureVersion)

if(PSTOEDIT_EXECUTABLE)
    execute_process(COMMAND ${PSTOEDIT_EXECUTABLE} -help
        ERROR_VARIABLE _PSTOEDIT_VERSION OUTPUT_VARIABLE _PSTOEDIT_PLUGINS
    )
    string (REGEX MATCH "[0-9]\\.[0-9]+" PSTOEDIT_VERSION "${_PSTOEDIT_VERSION}")
    string (REGEX MATCH "plot-svg" PSTOEDIT_SVG_PLUGIN "${_PSTOEDIT_PLUGINS}")
    string (COMPARE EQUAL "plot-svg" "${PSTOEDIT_SVG_PLUGIN}" PstoeditSvgOutput_FOUND )
endif()

if(PstoeditSvgOutput_FOUND)
  if(NOT Pstoedit_FIND_QUIETLY)
    message(STATUS "Found pstoedit version ${PSTOEDIT_VERSION}: ${PSTOEDIT_EXECUTABLE}")
    message(STATUS "Found pstoedit svg-plugin: ${PSTOEDIT_SVG_PLUGIN}")
  endif()
else()
  if(Pstoedit_FIND_REQUIRED)
    message(FATAL_ERROR "Could not find pstoedit or the svg output plugin")
  endif()
endif()