diff options
| author | Allen Winter <allen.winter@kdab.com> | 2011-06-30 17:36:45 -0400 |
|---|---|---|
| committer | Allen Winter <allen.winter@kdab.com> | 2011-06-30 17:36:45 -0400 |
| commit | d2b2c90a06bf1f4a21df196430d1f95856900410 (patch) | |
| tree | aba9d2a48d7b2ac1e960e1b68218394524c7e6a8 /attic/modules/FindHUpnp.cmake | |
| parent | e15ffacc69242c89107afbfda6f8ece9f2b56633 (diff) | |
| download | extra-cmake-modules-d2b2c90a06bf1f4a21df196430d1f95856900410.tar.gz extra-cmake-modules-d2b2c90a06bf1f4a21df196430d1f95856900410.tar.bz2 | |
Move the modules, modules-test and systeminfo subdirs into 'attic'
Diffstat (limited to 'attic/modules/FindHUpnp.cmake')
| -rw-r--r-- | attic/modules/FindHUpnp.cmake | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/attic/modules/FindHUpnp.cmake b/attic/modules/FindHUpnp.cmake new file mode 100644 index 00000000..85c80306 --- /dev/null +++ b/attic/modules/FindHUpnp.cmake @@ -0,0 +1,31 @@ +# - Try to find HUPnP library +# Once done this will define +# +# HUPNP_FOUND - system has HUPnP +# HUPNP_INCLUDE_DIR - the LIBHUpnp include directory +# HUPNP_LIBS - the LIBHUpnp libraries +# HUPNP_VERSION_STRING - The version of HUpnp +# HUPNP_VERSION_MAJOR - The major version of HUpnp +# HUPNP_VERSION_MINOR - The minor version of HUpnp +# HUPNP_VERSION_PATCH - The patch version of HUpnp +# +# Copyright (c) 2010, Paulo Romulo Alves Barros <paulo.romulo@kdemail.net> + +find_path( HUPNP_INCLUDE_DIR HUpnpCore/HUpnp ) + +find_library( HUPNP_LIBS HUpnp ) + +if( HUPNP_INCLUDE_DIR AND EXISTS "${HUPNP_INCLUDE_DIR}/HUpnpCore/public/hupnpinfo.h" ) + file( STRINGS "${HUPNP_INCLUDE_DIR}/HUpnpCore/public/hupnpinfo.h" HUPNP_INFO_H REGEX "^#define HUPNP_CORE_.*_VERSION .*$" ) + string( REGEX REPLACE ".*HUPNP_CORE_MAJOR_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_MAJOR "${HUPNP_INFO_H}" ) + string( REGEX REPLACE ".*HUPNP_CORE_MINOR_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_MINOR "${HUPNP_INFO_H}" ) + string( REGEX REPLACE ".*HUPNP_CORE_PATCH_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_PATCH "${HUPNP_INFO_H}" ) + + set( HUPNP_VERSION_STRING "${HUPNP_VERSION_MAJOR}.${HUPNP_VERSION_MINOR}.${HUPNP_VERSION_PATCH}" ) +endif() + +include( FindPackageHandleStandardArgs ) + +find_package_handle_standard_args( HUpnp DEFAULT_MSG HUPNP_INCLUDE_DIR HUPNP_LIBS ) + +mark_as_advanced( HUPNP_INCLUDE_DIR HUPNP_LIBS ) |
