~ubuntu-branches/ubuntu/oneiric/kde4libs/oneiric-proposed

« back to all changes in this revision

Viewing changes to cmake/modules/FindHUpnp.cmake

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-07-08 00:08:34 UTC
  • mto: This revision was merged to the branch mainline in revision 247.
  • Revision ID: package-import@ubuntu.com-20110708000834-dr9a8my4iml90qe5
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#  HUPNP_FOUND - system has HUPnP
5
5
#  HUPNP_INCLUDE_DIR - the LIBHUpnp include directory
6
6
#  HUPNP_LIBS - the LIBHUpnp libraries
 
7
#  HUPNP_VERSION_STRING - The version of HUpnp
 
8
#  HUPNP_VERSION_MAJOR - The major version of HUpnp
 
9
#  HUPNP_VERSION_MINOR - The minor version of HUpnp
 
10
#  HUPNP_VERSION_PATCH - The patch version of HUpnp
7
11
#
8
12
# Copyright (c) 2010, Paulo Romulo Alves Barros <paulo.romulo@kdemail.net>
9
13
 
10
 
find_path( HUPNP_INCLUDE_DIR
11
 
     NAMES HUpnp
12
 
     PATH_SUFFIXES HUpnpCore
13
 
)
 
14
find_path( HUPNP_INCLUDE_DIR HUpnpCore/HUpnp )
14
15
 
15
16
find_library( HUPNP_LIBS HUpnp )
16
17
 
 
18
if( HUPNP_INCLUDE_DIR AND EXISTS "${HUPNP_INCLUDE_DIR}/HUpnpCore/public/hupnpinfo.h" )
 
19
    file( STRINGS "${HUPNP_INCLUDE_DIR}/HUpnpCore/public/hupnpinfo.h" HUPNP_INFO_H REGEX "^#define HUPNP_CORE_.*_VERSION .*$" )
 
20
    string( REGEX REPLACE ".*HUPNP_CORE_MAJOR_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_MAJOR "${HUPNP_INFO_H}" )
 
21
    string( REGEX REPLACE ".*HUPNP_CORE_MINOR_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_MINOR "${HUPNP_INFO_H}" )
 
22
    string( REGEX REPLACE ".*HUPNP_CORE_PATCH_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_PATCH "${HUPNP_INFO_H}" )
 
23
 
 
24
    set( HUPNP_VERSION_STRING "${HUPNP_VERSION_MAJOR}.${HUPNP_VERSION_MINOR}.${HUPNP_VERSION_PATCH}" )
 
25
endif()
 
26
 
17
27
include( FindPackageHandleStandardArgs )
18
28
 
19
29
find_package_handle_standard_args( HUpnp DEFAULT_MSG HUPNP_INCLUDE_DIR HUPNP_LIBS )