aboutsummaryrefslogtreecommitdiff
path: root/attic/modules/FindDNSSD.cmake
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2011-06-30 17:36:45 -0400
committerAllen Winter <allen.winter@kdab.com>2011-06-30 17:36:45 -0400
commitd2b2c90a06bf1f4a21df196430d1f95856900410 (patch)
treeaba9d2a48d7b2ac1e960e1b68218394524c7e6a8 /attic/modules/FindDNSSD.cmake
parente15ffacc69242c89107afbfda6f8ece9f2b56633 (diff)
downloadextra-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/FindDNSSD.cmake')
-rw-r--r--attic/modules/FindDNSSD.cmake48
1 files changed, 48 insertions, 0 deletions
diff --git a/attic/modules/FindDNSSD.cmake b/attic/modules/FindDNSSD.cmake
new file mode 100644
index 00000000..8604bd57
--- /dev/null
+++ b/attic/modules/FindDNSSD.cmake
@@ -0,0 +1,48 @@
+# - Try to find DNSSD
+# Once done this will define
+#
+# DNSSD_FOUND - system has DNSSD
+# DNSSD_INCLUDE_DIR - the DNSSD include directory
+# DNSSD_LIBRARIES - Link these to use dnssd
+# DNSSD_DEFINITIONS - Compiler switches required for using DNSSD
+#
+# need more test: look at into dnssd/configure.in.in
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PATH(DNSSD_INCLUDE_DIR dns_sd.h
+ /usr/include/avahi-compat-libdns_sd/
+)
+
+if (DNSSD_INCLUDE_DIR)
+ if (APPLE)
+ set(DNSSD_LIBRARIES "/usr/lib/libSystem.dylib")
+ else (APPLE)
+ FIND_LIBRARY(DNSSD_LIBRARIES NAMES dns_sd )
+ endif (APPLE)
+
+ MACRO_PUSH_REQUIRED_VARS()
+ set(CMAKE_REQUIRED_INCLUDES ${DNSSD_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${DNSSD_LIBRARIES})
+ CHECK_FUNCTION_EXISTS(DNSServiceRefDeallocate DNSSD_FUNCTION_FOUND)
+ MACRO_POP_REQUIRED_VARS()
+
+ if (DNSSD_INCLUDE_DIR AND DNSSD_LIBRARIES AND DNSSD_FUNCTION_FOUND)
+ set(DNSSD_FOUND TRUE)
+ endif (DNSSD_INCLUDE_DIR AND DNSSD_LIBRARIES AND DNSSD_FUNCTION_FOUND)
+endif (DNSSD_INCLUDE_DIR)
+
+if (DNSSD_FOUND)
+ if (NOT DNSSD_FIND_QUIETLY)
+ message(STATUS "Found DNSSD: ${DNSSD_LIBRARIES}")
+ endif (NOT DNSSD_FIND_QUIETLY)
+else (DNSSD_FOUND)
+ if (DNSSD_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find DNSSD")
+ endif (DNSSD_FIND_REQUIRED)
+endif (DNSSD_FOUND)
+
+MARK_AS_ADVANCED(DNSSD_INCLUDE_DIR DNSSD_LIBRARIES)