Subversion Repositories Scribus

Rev

Rev 5157 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5138 cbradney 1
#
2
# Find the native LIBART includes and library
3
#
4
 
5
# This module defines
6
# LIBART_LGPL_INCLUDE_DIR, where to find art*.h etc
7
# LIBART_LGPL_LIBRARY, the libraries to link against to use LIBART.
8
# LIBART_LGPL_FOUND, If false, do not try to use LIBART.
9
# LIBART_LGPL_LIBS, link information
10
# LIBART_LGPL_CFLAGS, cflags for include information
11
 
12
 
13
INCLUDE(UsePkgConfig)
14
 
15
# use pkg-config to get the directories and then use these values
16
# in the FIND_PATH() and FIND_LIBRARY() calls
17
PKGCONFIG(libart-2.0 _libArtIncDir _libArtLinkDir _libArtLinkFlags _libArtCflags)
18
 
19
SET(LIBART_LGPL_LIBS ${_libArtCflags})
20
 
21
FIND_PATH(LIBART_LGPL_INCLUDE_DIR libart_lgpl/libart.h
22
${_libArtIncDir}
23
/usr/include
24
/usr/local/include/
25
PATH_SUFFIXES
26
libart-2.0
27
)
28
 
29
# quick hack as the above finds it nicely but our source includes the libart_lgpl text at the moment
30
# STRING(REGEX REPLACE "/libart_lgpl" "" LIBART_LGPL_INCLUDE_DIR ${LIBART_LGPL_INCLUDE_DIR})
31
 
32
FIND_LIBRARY(LIBART_LGPL_LIBRARY NAMES art_lgpl_2
33
PATHS
34
${_libArtLinkDir}
35
/usr/lib
36
/usr/local/lib
37
)
38
 
39
SET(LIBART_LGPL_FIND_QUIETLY 1)
40
 
41
IF (LIBART_LGPL_LIBRARY)
42
  IF (LIBART_LGPL_INCLUDE_DIR)
43
    SET( LIBART_LGPL_FOUND "YES" )
44
    IF(NOT LIBART_LGPL_FIND_QUIETLY)
45
      MESSAGE(STATUS "Found Libart_LGPL: ${LIBART_LGPL_LIBRARY}")
46
    ENDIF(NOT LIBART_LGPL_FIND_QUIETLY)
47
    SET( LIBART_LGPL_LIBRARIES ${LIBART_LGPL_LIBRARY} )
48
    FIND_PROGRAM(LIBART_LGPL_CONFIG NAMES libart2-config PATHS ${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin /usr/nekoware/bin /usr/X11/bin)
49
    EXEC_PROGRAM(${LIBART_LGPL_CONFIG} ARGS --libs OUTPUT_VARIABLE LIBART_LGPL_LIBS)
50
    EXEC_PROGRAM(${LIBART_LGPL_CONFIG} ARGS --cflags OUTPUT_VARIABLE LIBART_LGPL_CFLAGS)
51
#  	MESSAGE(STATUS ${LIBART_LGPL_LIBS})
52
#  	MESSAGE(STATUS ${LIBART_LGPL_CFLAGS})
53
  ENDIF (LIBART_LGPL_INCLUDE_DIR)
54
ENDIF (LIBART_LGPL_LIBRARY)