-
Notifications
You must be signed in to change notification settings - Fork 1
/
FindLibMicroHTTPD.cmake
70 lines (59 loc) · 1.6 KB
/
FindLibMicroHTTPD.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Copyright (c) 2010 Carlos Junior <[email protected]>
#
# - Try to find libmicrohttpd
# Once done this will define
#
# MHD_FOUND - system has libmicrohttpd
# MHD_INCLUDE_DIRS - the libmicrohttpd include directory
# MHD_LIBRARIES - Link these to use libmicrohttpd
# MHD_DEFINITIONS - Compiler switches required for using libmicrohttpd
#
# Redistribution and use is allowed according to the terms of the GPLv3 license
# For details see the accompanying LICENSE file.
#
if (MHD_LIBRARIES AND MHD_INCLUDE_DIRS)
# in cache already
set(MHD_FOUND TRUE)
else (MHD_LIBRARIES AND MHD_INCLUDE_DIRS)
set(MHD_DEFINITIONS "")
find_path(MHD_INCLUDE_DIR
NAMES
microhttpd.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
find_library(MHD_LIBRARY
NAMES
microhttpd
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
message("Found MicroHTTPD on ${MHD_LIBRARY}")
if (MHD_LIBRARY)
set(MHD_FOUND TRUE)
endif (MHD_LIBRARY)
set(MHD_INCLUDE_DIRS
${MHD_INCLUDE_DIR}
)
if (MHD_FOUND)
set(MHD_LIBRARIES
${MHD_LIBRARIES}
${MHD_LIBRARY}
)
endif (MHD_FOUND)
if (MHD_INCLUDE_DIRS AND MHD_LIBRARIES)
set(MHD_FOUND TRUE)
endif (MHD_INCLUDE_DIRS AND MHD_LIBRARIES)
if (MHD_FIND_REQUIRED AND NOT MHD_FOUND)
message(FATAL_ERROR "Could not find LibMicroHTTPD")
endif (MHD_FIND_REQUIRED AND NOT MHD_FOUND)
# show the MHD_INCLUDE_DIRS and MHD_LIBRARIES variables only in the advanced view
mark_as_advanced(MHD_INCLUDE_DIRS MHD_LIBRARIES)
endif (MHD_LIBRARIES AND MHD_INCLUDE_DIRS)