~ubuntu-branches/ubuntu/natty/kde4libs/natty-proposed

« back to all changes in this revision

Viewing changes to cmake/modules/FindLCMS.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell, Scott Kitterman, Jonathan Riddell
  • Date: 2010-11-22 17:59:02 UTC
  • mfrom: (1.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122175902-yubxubd0pg6hn11z
Tags: 4:4.5.80a-0ubuntu1
[ Scott Kitterman ]
* New upstream beta release
  - Refreshed all patches
  - Updated debian/patches/10_make_libkdeinit4_private.diff to use Qfile
    instead of Qstring in kdecore/kernel/kstandarddirs_unix.cpp
  - Updated debian/patches/kubuntu_01_kubuntu_useragent.diff to provide
    Kubuntu in the Konqueror user agen string with the changes in
    kio/kio/kprotocolmanager.cpp
  - Partially updated debian/patches/kubuntu_05_langpack_desktop_files.diff
    and left the balance in kdecore/localization/klocale.cpp.rej for later
    revision
  - Update debian/patches/kubuntu_06_user_disk_mounting.diff for changes in
    solid/solid/backends/hal/halstorageaccess.cpp
  - Remove debian/patches/kubuntu_71_backport_plasma_webview_changes.diff
    (backported from upstream, so already present now)
  - Add minimum version for libattica-dev of 0.1.90 to build-depends
  - Bump minimum version for libsoprano-dev build-depend to 2.5.60
  - Add minimum version for shared-desktop-ontologies of 0.5 in build-dep

[ Jonathan Riddell ]
* Add build-depends on grantlee, libudev-dev, hupnp (FIXME needs packaging fixes)
* Update kubuntu_04_add_langpack_path.diff 28_find_old_kde4_html_documentation.diff
  22_hack_in_etc_kde4_in_kstandarddirs.diff for QT_NO_CAST_FROM_ASCII
* Update kubuntu_05_langpack_desktop_files.diff for new upstream code
* Add kubuntu_78_solid_trunk.diff to fix solid linking
* Add libnepomukutils4 package for new library
* Don't install kcm_ssl for now, e-mailed upstream to suggest moving to kdebase
* Add kubuntu_79_knewstuff_fix.diff to fix compile broken by non-trunk commit
  http://websvn.kde.org/?view=revision&revision=1199825
* kdelibs5-data replaces old kdebase-runtime-data due to moved file
* Add kubuntu_80_find_hupnp.diff to find hupnp include files, committed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# - Find LCMS
2
 
# Find the LCMS includes and library
 
2
# Find the LCMS (Little Color Management System) library and includes and
3
3
# This module defines
4
4
#  LCMS_INCLUDE_DIR, where to find lcms.h
5
5
#  LCMS_LIBRARIES, the libraries needed to use LCMS.
6
 
#  LCMS_VERSION, The value of LCMS_VERSION defined in lcms.h
 
6
#  LCMS_DOT_VERSION, The version number of the LCMS library, e.g. "1.19"
 
7
#  LCMS_VERSION, Similar to LCMS_DOT_VERSION, but without the dots, e.g. "119"
7
8
#  LCMS_FOUND, If false, do not try to use LCMS.
8
 
 
 
9
#
 
10
# The minimum required version of LCMS can be specified using the
 
11
# standard syntax, e.g. find_package(LCMS 1.10)
9
12
 
10
13
# Copyright (c) 2008, Adrian Page, <adrian@pagenet.plus.com>
11
14
# Copyright (c) 2009, Cyrille Berger, <cberger@cberger.net>
23
26
endif(NOT WIN32)
24
27
 
25
28
find_path(LCMS_INCLUDE_DIR lcms.h
26
 
   PATHS
 
29
   HINTS
27
30
   ${PC_LCMS_INCLUDEDIR}
28
31
   ${PC_LCMS_INCLUDE_DIRS}
29
32
   PATH_SUFFIXES lcms liblcms1
30
33
)
31
34
 
32
35
find_library(LCMS_LIBRARIES NAMES lcms liblcms lcms-1 liblcms-1
33
 
   PATHS     
 
36
   HINTS
34
37
   ${PC_LCMS_LIBDIR}
35
38
   ${PC_LCMS_LIBRARY_DIRS}
36
39
   PATH_SUFFIXES lcms
37
40
)
38
41
 
39
 
if(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES)
40
 
   set(LCMS_FOUND TRUE)
41
 
else(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES)
42
 
   set(LCMS_FOUND FALSE)
43
 
endif(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES)
44
 
 
45
 
if(LCMS_FOUND)
 
42
# Store the LCMS version number in the cache, so we don't have to search everytime again
 
43
if(LCMS_INCLUDE_DIR  AND NOT  LCMS_VERSION)
46
44
   file(READ ${LCMS_INCLUDE_DIR}/lcms.h LCMS_VERSION_CONTENT)
47
45
   string(REGEX MATCH "#define LCMS_VERSION[ ]*[0-9]*\n" LCMS_VERSION_MATCH ${LCMS_VERSION_CONTENT})
48
46
   if(LCMS_VERSION_MATCH)
49
 
      string(REGEX REPLACE "#define LCMS_VERSION[ ]*([0-9]*)\n" "\\1" LCMS_VERSION ${LCMS_VERSION_MATCH})
50
 
      if(NOT LCMS_FIND_QUIETLY)
51
 
         string(SUBSTRING ${LCMS_VERSION} 0 1 LCMS_MAJOR_VERSION)
52
 
         string(SUBSTRING ${LCMS_VERSION} 1 2 LCMS_MINOR_VERSION)
53
 
         message(STATUS "Found lcms version ${LCMS_MAJOR_VERSION}.${LCMS_MINOR_VERSION}, ${LCMS_LIBRARIES}")
54
 
      endif(NOT LCMS_FIND_QUIETLY)
55
 
   else(LCMS_VERSION_MATCH)
56
 
      if(NOT LCMS_FIND_QUIETLY)
57
 
         message(STATUS "Found lcms but failed to find version ${LCMS_LIBRARIES}")
58
 
      endif(NOT LCMS_FIND_QUIETLY)
59
 
      set(LCMS_VERSION NOTFOUND)
 
47
      string(REGEX REPLACE "#define LCMS_VERSION[ ]*([0-9]*)\n" "\\1" _LCMS_VERSION ${LCMS_VERSION_MATCH})
 
48
      string(SUBSTRING ${_LCMS_VERSION} 0 1 LCMS_MAJOR_VERSION)
 
49
      string(SUBSTRING ${_LCMS_VERSION} 1 2 LCMS_MINOR_VERSION)
60
50
   endif(LCMS_VERSION_MATCH)
61
 
else(LCMS_FOUND)
62
 
   if(NOT LCMS_FIND_QUIETLY)
63
 
      if(LCMS_FIND_REQUIRED)
64
 
         message(FATAL_ERROR "Required package lcms NOT found")
65
 
      else(LCMS_FIND_REQUIRED)
66
 
         message(STATUS "lcms NOT found")
67
 
      endif(LCMS_FIND_REQUIRED)
68
 
   endif(NOT LCMS_FIND_QUIETLY)
69
 
endif(LCMS_FOUND)
 
51
   set(LCMS_VERSION "${LCMS_MAJOR_VERSION}${LCMS_MINOR_VERSION}" CACHE STRING "Version number of lcms" FORCE)
 
52
   set(LCMS_DOT_VERSION "${LCMS_MAJOR_VERSION}.${LCMS_MINOR_VERSION}" CACHE STRING "Version number of lcms split into components" FORCE)
 
53
endif(LCMS_INCLUDE_DIR  AND NOT  LCMS_VERSION)
 
54
 
 
55
include(FindPackageHandleStandardArgs)
 
56
find_package_handle_standard_args(LCMS REQUIRED_VARS LCMS_LIBRARIES LCMS_INCLUDE_DIR
 
57
                                       VERSION_VAR LCMS_DOT_VERSION )
70
58
 
71
59
mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARIES LCMS_VERSION)
72
60