~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to cmake/FindImlib2.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# This module finds if IMLIB2 is available and determines where the
 
3
# include files and libraries are. 
 
4
# On Unix/Linux it relies on the output of imlib2-config.
 
5
# This code sets the following variables:
 
6
 
7
#
 
8
#
 
9
# IMLIB2_FOUND       = system has IMLIB2 lib
 
10
#
 
11
# IMLIB2_LIBRARIES   = full path to the libraries
 
12
#    on Unix/Linux with additional linker flags from "imlib2-config --libs"
 
13
 
14
# CMAKE_IMLIB2_CXX_FLAGS  = Unix compiler flags for IMLIB2, essentially "`imlib2-config --cxxflags`"
 
15
#
 
16
# IMLIB2_INCLUDE_DIR      = where to find headers 
 
17
#
 
18
# IMLIB2_LINK_DIRECTORIES = link directories, useful for rpath on Unix
 
19
#
 
20
 
21
# author Jan Woetzel and Jan-Friso Evers
 
22
# www.mip.informatik.uni-kiel.de/~jw
 
23
 
 
24
IF(WIN32)
 
25
  MESSAGE("FindIMLIB2.cmake: IMLIB2 not (yet) supported on WIN32")
 
26
    SET(IMLIB2_FOUND OFF        )
 
27
 
 
28
  
 
29
ELSE(WIN32)
 
30
  IF(UNIX) 
 
31
    SET(IMLIB2_CONFIG_PREFER_PATH "$ENV{IMLIB2_HOME}/bin" CACHE STRING "preferred path to imlib2")
 
32
    FIND_PROGRAM(IMLIB2_CONFIG imlib2-config
 
33
      ${IMLIB2_CONFIG_PREFER_PATH}
 
34
      /usr/bin/
 
35
      /opt/gnome/bin/
 
36
      )
 
37
 
 
38
    IF (IMLIB2_CONFIG) 
 
39
      # OK, found imlib2-config. 
 
40
      # set CXXFLAGS to be fed into CXX_FLAGS by the user:
 
41
      SET(IMLIB2_CXX_FLAGS "`${IMLIB2_CONFIG} --cflags`")
 
42
      
 
43
      # set INCLUDE_DIRS to prefix+include
 
44
      EXEC_PROGRAM(${IMLIB2_CONFIG}
 
45
        ARGS --prefix
 
46
        OUTPUT_VARIABLE IMLIB2_PREFIX)
 
47
      SET(IMLIB2_INCLUDE_DIR ${IMLIB2_PREFIX}/include CACHE STRING INTERNAL)
 
48
 
 
49
      # extract link dirs for rpath  
 
50
      EXEC_PROGRAM(${IMLIB2_CONFIG}
 
51
        ARGS --libs
 
52
        OUTPUT_VARIABLE IMLIB2_CONFIG_LIBS )
 
53
      
 
54
      # set link libraries and link flags
 
55
      #SET(IMLIB2_LIBRARIES "`${IMLIB2_CONFIG} --libs`")
 
56
      SET(IMLIB2_LIBRARIES ${IMLIB2_CONFIG_LIBS})
 
57
      
 
58
      # split off the link dirs (for rpath)
 
59
      # use regular expression to match wildcard equivalent "-L*<endchar>"
 
60
      # with <endchar> is a space or a semicolon
 
61
      STRING(REGEX MATCHALL "[-][L]([^ ;])+" 
 
62
        IMLIB2_LINK_DIRECTORIES_WITH_PREFIX 
 
63
        "${IMLIB2_CONFIG_LIBS}" )
 
64
      #MESSAGE("DBG  IMLIB2_LINK_DIRECTORIES_WITH_PREFIX=${IMLIB2_LINK_DIRECTORIES_WITH_PREFIX}")
 
65
      
 
66
      # remove prefix -L because we need the pure directory for LINK_DIRECTORIES
 
67
      # replace -L by ; because the separator seems to be lost otherwise (bug or feature?)
 
68
      IF (IMLIB2_LINK_DIRECTORIES_WITH_PREFIX)
 
69
        STRING(REGEX REPLACE "[-][L]" ";" IMLIB2_LINK_DIRECTORIES ${IMLIB2_LINK_DIRECTORIES_WITH_PREFIX} )
 
70
        #MESSAGE("DBG  IMLIB2_LINK_DIRECTORIES=${IMLIB2_LINK_DIRECTORIES}")
 
71
      ENDIF (IMLIB2_LINK_DIRECTORIES_WITH_PREFIX)
 
72
      
 
73
      # replace space separated string by semicolon separated vector to make 
 
74
      # it work with LINK_DIRECTORIES
 
75
      SEPARATE_ARGUMENTS(IMLIB2_LINK_DIRECTORIES)
 
76
      
 
77
      MARK_AS_ADVANCED(
 
78
        IMLIB2_CXX_FLAGS
 
79
        IMLIB2_INCLUDE_DIR
 
80
        IMLIB2_LIBRARIES
 
81
        IMLIB2_LINK_DIRECTORIES
 
82
        IMLIB2_CONFIG_PREFER_PATH 
 
83
        IMLIB2_CONFIG
 
84
        )
 
85
 
 
86
    ELSE(IMLIB2_CONFIG)
 
87
      MESSAGE( "FindIMLIB2.cmake: imlib2-config not found. Please set it manually. IMLIB2_CONFIG=${IMLIB2_CONFIG}")
 
88
    ENDIF(IMLIB2_CONFIG)
 
89
 
 
90
  ENDIF(UNIX)
 
91
ENDIF(WIN32)
 
92
 
 
93
 
 
94
IF(IMLIB2_LIBRARIES)
 
95
  IF(IMLIB2_INCLUDE_DIR OR IMLIB2_CXX_FLAGS)
 
96
 
 
97
    SET(IMLIB2_FOUND 1)
 
98
 
 
99
  ENDIF(IMLIB2_INCLUDE_DIR OR IMLIB2_CXX_FLAGS)
 
100
ENDIF(IMLIB2_LIBRARIES)
 
101
 
 
102
# make FIND_PACKAGE case sensitive compatible
 
103
SET(Imlib2_FOUND       ${IMLIB2_FOUND})
 
104
SET(Imlib2_LIBRARIES   ${IMLIB2_LIBRARIES})
 
105
SET(Imlib2_INCLUDE_DIR ${IMLIB2_INCLUDE_DIR})
 
106
SET(Imlib2_CXX_FLAGS   ${IMLIB2_CXX_FLAGS})
 
107
SET(Imlib2_LINK_DIRECTORIES ${IMLIB2_LINK_DIRECTORIES})
 
 
b'\\ No newline at end of file'