Subversion Repositories Scribus

Rev

Rev 13960 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13960 herm 1
#
2
# Find the native GraphicksMagick++ includes and library
3
#
4
 
5
# This module defines
6
# GMAGICK_INCLUDE_DIR, where to find Magick++.h
7
# GMAGICK_LIBRARY, the libraries to link against to use GraphicksMagick++.
8
# GMAGICK_FOUND, If false, do not try to use GraphicksMagick++.
9
# GMAGICK_LIBS, link information
10
# GMAGICK_CFLAGS, cflags for include information
11
 
12
 
13
find_program(GMAGICK_CONFIG_EXECUTABLE NAMES GraphicsMagick++-config PATH ${PREFIX_GMAGICK} DOC "GraphicsMagick++-config executable")
14
mark_as_advanced(GMAGICK_CONFIG_EXECUTABLE)
15
 
16
MESSAGE(STATUS "Gmconf ${GMAGICK_CONFIG_EXECUTABLE}")
17
 
18
macro(_gmagickconfig_invoke _type _varname _regexp)
19
  set(_gmagickconfig_invoke_result)
20
 
21
  execute_process(
22
    COMMAND ${GMAGICK_CONFIG_EXECUTABLE} ${_type}
23
    OUTPUT_VARIABLE _gmagickconfig_invoke_result
24
    RESULT_VARIABLE _gmagickconfig_failed)
25
 
26
  if (NOT _gmagickconfig_failed)
27
    set(GMAGICK_FOUND "YES")
28
    string(REGEX REPLACE "[\r\n]"  " " _gmagickconfig_invoke_result "${_gmagickconfig_invoke_result}")
29
    string(REGEX REPLACE " +$"     ""  _gmagickconfig_invoke_result "${_gmagickconfig_invoke_result}")
30
 
31
    if (NOT ${_regexp} STREQUAL "")
32
      string(REGEX REPLACE "${_regexp}" " " _gmagickconfig_invoke_result "${_gmagickconfig_invoke_result}")
33
    endif(NOT ${_regexp} STREQUAL "")
34
 
35
    separate_arguments(_gmagickconfig_invoke_result)
36
 
37
    MESSAGE(STATUS "GMAGICK result for ${_type}: ${_gmagickconfig_invoke_result}")
38
 
39
    #message(STATUS "  ${_varname} ... ${_pkgconfig_invoke_result}")
40
     set(${_varname} ${_gmagickconfig_invoke_result})
41
#     _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
42
    endif(NOT _gmagickconfig_failed)
43
endmacro(_gmagickconfig_invoke)
44
 
45
_gmagickconfig_invoke("--cppflags" GMAGICK_INCLUDES "(^| )-I")
46
_gmagickconfig_invoke("--ldflags" GMAGICK_LDFLAGS "(^| )-L")
47
_gmagickconfig_invoke("--libs" GMAGICK_LIBRARIES "(^| )-l")
48
 
13961 cbradney 49
if(GMAGICK_INCLUDES)
50
	SET(GMAGICK_FOUND "YES")
51
else(GMAGICK_INCLUDES)
52
	SET(GMAGICK_INCLUDES)
53
	SET(GMAGICK_LIBRARIES)
54
	SET(GMAGICK_LDFLAGS)
55
endif(GMAGICK_INCLUDES)