-
Notifications
You must be signed in to change notification settings - Fork 313
/
Copy pathCMakeLists.txt
41 lines (31 loc) · 881 Bytes
/
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
set(MISC_LIBRARIES misc CACHE INTERNAL "misc")
include_directories(
${CMAKE_SOURCE_DIR}/src
)
if(LINUX)
list(APPEND misc_SOURCES
# Provide our own copy of strlcpy and strlcat
# because they are not included with Linux.
${CUSTOM_MISC_DIR}/strlcpy.c
${CUSTOM_MISC_DIR}/strlcat.c
)
add_library(misc STATIC
${misc_SOURCES}
)
elseif(WIN32 OR CYGWIN) # windows
list(APPEND misc_SOURCES
# There are several string functions found in Linux
# but not on Windows. Need to provide our own copy.
${CUSTOM_MISC_DIR}/strsep.c
${CUSTOM_MISC_DIR}/strtok_r.c
${CUSTOM_MISC_DIR}/strcasestr.c
${CUSTOM_MISC_DIR}/strlcpy.c
${CUSTOM_MISC_DIR}/strlcat.c
)
add_library(misc STATIC
${misc_SOURCES}
)
else()
# on macOS, OpenBSD and FreeBSD not misc is necessary
set(MISC_LIBRARIES "" CACHE INTERNAL "")
endif()