[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkio-upnp-ms=5D_/=3A_Include_FindHUpnp=2Ecmake_in_re?=
From:       Nikhil Marathe <nsm.nikhil () gmail ! com>
Date:       2011-06-04 15:33:59
Message-ID: 20110604153359.70A40A60CE () git ! kde ! org
[Download RAW message or body]

Git commit 5af17b453e0c6f34aab0694e686f9174e5b73307 by Nikhil Marathe.
Committed on 21/05/2011 at 02:04.
Pushed by nikhilm into branch 'master'.

Include FindHUpnp.cmake in release

M  +1    -0    CMakeLists.txt     
A  +32   -0    FindHUpnp.cmake     

http://commits.kde.org/kio-upnp-ms/5af17b453e0c6f34aab0694e686f9174e5b73307

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5daa498..e36ddf3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ set(KIO_UPNP_MS_MAJOR_VERSION "1")
 set(KIO_UPNP_MS_MINOR_VERSION "0")
 set(KIO_UPNP_MS_PATCH_VERSION "0")
 
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
 find_package(HUpnp REQUIRED)
 
 if ( HUPNP_FOUND AND ((HUPNP_VERSION_MAJOR EQUAL 0 AND HUPNP_VERSION_MINOR EQUAL 9) \
                OR (HUPNP_VERSION_MAJOR EQUAL 1)))
diff --git a/FindHUpnp.cmake b/FindHUpnp.cmake
new file mode 100644
index 0000000..b69ba4f
--- /dev/null
+++ b/FindHUpnp.cmake
@@ -0,0 +1,32 @@
+# - 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>
+# Copyright (c) 2011, Nikhil Marathe <nsm.nikhil@gmail.com>
+
+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 )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic