-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
108 lines (99 loc) · 1.77 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
# set minimum cmake version
cmake_minimum_required(VERSION 3.22)
# project name and language
project(eb VERSION 1.0.0 LANGUAGES C)
set(SOURCES
custom_unistd.h
appendix.c
appendix.h
appsub.c
bcd.c
binary.c
binary.h
bitmap.c
book.c
booklist.c
booklist.h
build-post.h
build-pre.h
copyright.c
cross.c
defs.h
eb.c
eb.h
endword.c
error.c
error.h
exactword.c
filename.c
font.c
font.h
hook.c
jacode.c
keyword.c
lock.c
log.c
match.c
menu.c
multi.c
narwalt.c
narwfont.c
readtext.c
search.c
setword.c
stopcode.c
strcasecmp.c
subbook.c
sysdefs.h
text.c
text.h
eb_utf8.c
widealt.c
widefont.c
word.c
zio.c
zio.h
eb.def
)
if(WIN32)
set(SOURCES
${SOURCES}
win_dirent.h
)
endif()
add_library(eb
SHARED
${SOURCES}
)
if(UNIX)
find_package(ZLIB REQUIRED)
target_link_libraries(eb ZLIB::ZLIB)
endif()
if(WIN32)
set(ZLIB_ROOT winlibs)
find_package(ZLIB REQUIRED)
target_link_libraries(eb PRIVATE ZLIB::ZLIB)
target_link_options(${PROJECT_NAME} PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/FS>)
endif()
include(GNUInstallDirs)
install(TARGETS eb
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
if(WIN32)
INSTALL (
DIRECTORY ${CMAKE_SOURCE_DIR}/
DESTINATION include
FILES_MATCHING PATTERN "*.h*"
PATTERN "CMakeFiles" EXCLUDE)
else()
INSTALL (
DIRECTORY ${CMAKE_SOURCE_DIR}/
DESTINATION include
FILES_MATCHING PATTERN "*.h*"
PATTERN "win_dirent.h" EXCLUDE
PATTERN "win*.h" EXCLUDE
PATTERN ".git*" EXCLUDE
PATTERN "winlibs" EXCLUDE
PATTERN "CMakeFiles" EXCLUDE
)
endif()