This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
156 lines (148 loc) · 3.94 KB
/
CMakeLists.txt
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Copyright (C) 2012 LuaDist
# Submitted by David Manura.
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the COPYRIGHT file distributed with LuaDist.
# Please note that the package source code is licensed under its own license.
project ( libbsd C )
cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
add_definitions (
-DLIBBSD_OVERLAY
-DLIBBSD_DISABLE_DEPRECATED
-D_GNU_SOURCE
-D__REENTRANT
)
include_directories ( include/bsd include )
# custom builders.
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_md5.cmake "
file ( READ ${CMAKE_CURRENT_SOURCE_DIR}/src/hash/helper.c _text )
string ( REPLACE hashinc bsd/md5.h _text \"\${_text}\" )
string ( REPLACE HASH MD5 _text \"\${_text}\" )
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/md5hl.c \"\${_text}\" )
" )
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_man.cmake "
file ( READ ${CMAKE_CURRENT_SOURCE_DIR}/src/mdX.3 _text )
string ( REPLACE mdX md5 _text \"\${_text}\" )
string ( REPLACE mdY md4 _text \"\${_text}\" )
string ( REPLACE MDX MD5 _text \"\${_text}\" )
file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/md5.3bsd \"\${_text}\" )
" )
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/md5hl.c
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/make_md5.cmake
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/hash/helper.c
)
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/md5.3bsd
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/make_man.cmake
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/mdX.3
)
add_custom_target ( md5.3bsd_target ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/md5.3bsd )
set ( SRC
src/fmtcheck.c
src/setproctitle.c
src/strlcat.c
src/strlcpy.c
)
if ( WIN32 AND NOT CYGWIN )
message ( WARNING
"WARNING: disabling many functions that are not currently compiling on windows [TODO]" )
else ()
set ( SRC ${SRC}
src/arc4random.c
src/bsd_getopt.c
src/dehumanize_number.c
src/err.c
src/fgetln.c
src/flopen.c
src/fpurge.c
src/getpeereid.c
src/heapsort.c
src/humanize_number.c
src/inet_net_pton.c
src/merge.c
src/nlist.c
src/pidfile.c
src/progname.c
src/radixsort.c
src/readpassphrase.c
src/reallocf.c
src/setmode.c
src/strmode.c
src/strtonum.c
src/unvis.c
src/vis.c
src/hash/md5.c
${CMAKE_CURRENT_BINARY_DIR}/md5hl.c
)
endif ()
set ( INCLUDE_BSD_SYS
include/bsd/sys/bitstring.h
include/bsd/sys/cdefs.h
include/bsd/sys/endian.h
include/bsd/sys/poll.h
include/bsd/sys/queue.h
include/bsd/sys/tree.h )
set ( INCLUDE_BSD_NETINET
include/bsd/netinet/ip_icmp.h )
set ( INCLUDE_BSD
include/bsd/bsd.h
include/bsd/cdefs.h
include/bsd/err.h
include/bsd/getopt.h
include/bsd/inet.h
include/bsd/ip_icmp.h
include/bsd/libutil.h
include/bsd/md5.h
include/bsd/nlist.h
include/bsd/queue.h
include/bsd/random.h
include/bsd/readpassphrase.h
include/bsd/stdio.h
include/bsd/stdlib.h
include/bsd/string.h
include/bsd/unistd.h
include/bsd/vis.h )
set ( INCLUDE
include/libutil.h
include/nlist.h
include/vis.h
)
set ( MAN
src/arc4random.3
src/arc4random_addrandom.3
src/arc4random_buf.3
src/dehumanize_number.3
src/arc4random_stir.3
src/arc4random_uniform.3
src/fgetln.3
src/flopen.3
src/fmtcheck.3
src/getmode.3
src/getpeereid.3
src/heapsort.3
src/humanize_number.3
src/mergesort.3
src/nlist.3
src/pidfile.3
src/readpassphrase.3
src/reallocf.3
src/strlcpy.3
src/strlcat.3
src/strtonum.3
src/radixsort.3
src/setmode.3
src/sradixsort.3
src/strmode.3
src/unvis.3
src/vis.3
${CMAKE_CURRENT_BINARY_DIR}/md5.3bsd
)
add_library ( bsd ${SRC} )
install_library ( bsd )
install_header ( ${INCLUDE} )
install_header ( ${INCLUDE_BSD} INTO bsd )
install_header ( ${INCLUDE_BSD_NETINET} INTO bsd/netinet )
install_header ( ${INCLUDE_BSD_SYS} INTO bsd/sys )
install_doc ( ${MAN} INTO man )
install_data ( COPYING README TODO Versions )