comparison extern/libircclient/CMakeLists.txt @ 0:1158cffe5a5e

Initial import
author David Demelier <markand@malikania.fr>
date Mon, 08 Feb 2016 16:43:14 +0100
parents
children 98ac3c79009f
comparison
equal deleted inserted replaced
-1:000000000000 0:1158cffe5a5e
1 #
2 # CMakeLists.txt -- CMake build system for irccd
3 #
4 # Copyright (c) 2013-2016 David Demelier <markand@malikania.fr>
5 #
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #
18
19 # Libircclient bundled
20 project(extern-libircclient)
21
22 set(FLAGS "ENABLE_THREADS")
23
24 # Portability checks
25 include(CheckFunctionExists)
26
27 check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
28 check_function_exists(localtime_r HAVE_LOCALTIME_R)
29
30 if (HAVE_GETHOSTBYNAME_R)
31 list(APPEND FLAGS "HAVE_GETHOSTBYNAME_R")
32 endif ()
33 if (HAVE_LOCALTIME_R)
34 list(APPEND FLAGS "HAVE_LOCALTIME_R")
35 endif ()
36
37 # SSL is optional
38 if (WITH_SSL)
39 list(APPEND INCLUDES ${OPENSSL_INCLUDE_DIR})
40 list(APPEND LIBRARIES ${OPENSSL_LIBRARIES})
41 list(APPEND FLAGS "ENABLE_SSL")
42 endif ()
43
44 # Enable or disable IPv6
45 if (WITH_IPV6)
46 list(APPEND FLAGS "ENABLE_IPV6")
47 endif ()
48
49 irccd_define_library(
50 TARGET extern-ircclient
51 SOURCES src/libircclient.c
52 FLAGS ${FLAGS}
53 LIBRARIES ${LIBRARIES}
54 PUBLIC_INCLUDES "${extern-libircclient_SOURCE_DIR}/include"
55 LOCAL_INCLUDES ${INCLUDES}
56 )