]> git.mxchange.org Git - simgear.git/blob - CMakeModules/FindUdns.cmake
iostream overloads taking an SGPath
[simgear.git] / CMakeModules / FindUdns.cmake
1 # - Try to find UDNS library
2 # Once done this will define
3 #
4 #  UDNS_FOUND - system has UDNS
5 #  UDNS_INCLUDE_DIRS - the UDNS include directory
6 #  UDNS_LIBRARIES - Link these to use UDNS
7 #  UDNS_DEFINITIONS - Compiler switches required for using UDNS
8 #
9 #  Copyright (c) 2016 Maciej Mrozowski <reavertm@gmail.com>
10 #
11 # Distributed under the Boost Software License, Version 1.0.
12 # (See accompanying file LICENSE_1_0.txt or copy at
13 # http://www.boost.org/LICENSE_1_0.txt)
14
15
16 if (UDN_LIBRARIES AND UDN_INCLUDE_DIRS)
17   # in cache already
18   set(UDNS_FOUND TRUE)
19 else ()
20   set(UDNS_DEFINITIONS "")
21
22   find_path(UDNS_INCLUDE_DIRS NAMES udns.h)
23   find_library(UDNS_LIBRARIES NAMES udns)
24
25   if (UDNS_INCLUDE_DIRS AND UDNS_LIBRARIES)
26     set(UDNS_FOUND TRUE)
27   endif ()
28
29   if (UDNS_FOUND)
30     if (NOT Udns_FIND_QUIETLY)
31       message(STATUS "Found UDNS: ${UDNS_LIBRARIES}")
32     endif ()
33   else ()
34     if (Udns_FIND_REQUIRED)
35       message(FATAL_ERROR "Could not find UDNS")
36     endif ()
37   endif ()
38
39   # show the UDNS_INCLUDE_DIRS and UDNS_LIBRARIES variables only in the advanced view
40   mark_as_advanced(UDNS_INCLUDE_DIRS UDNS_LIBRARIES)
41
42 endif ()