-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
136 lines (118 loc) · 3.12 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
cmake_minimum_required(VERSION 3.22)
# UTF-8 source
add_compile_options("$<$<AND:$<C_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:C>>:/utf-8>")
add_compile_options("$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>>:/utf-8>")
add_compile_options("$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<COMPILE_LANGUAGE:CXX>>:/Zc:__cplusplus>")
project(squirrel VERSION 2.2.4)
# ----------------------------------------------------
# squirrel library
# ----------------------------------------------------
add_library(libsquirrel STATIC
squirrel/sqapi.cpp
squirrel/sqbaselib.cpp
squirrel/sqclass.cpp
squirrel/sqcompiler.cpp
squirrel/sqdebug.cpp
squirrel/sqfuncstate.cpp
squirrel/sqlexer.cpp
squirrel/sqobject.cpp
squirrel/sqstate.cpp
squirrel/sqtable.cpp
squirrel/sqvm.cpp
sqstdlib/sqstdblob.cpp
sqstdlib/sqstdio.cpp
sqstdlib/sqstdstream.cpp
sqstdlib/sqstdmath.cpp
sqstdlib/sqstdstring.cpp
sqstdlib/sqstdaux.cpp
sqstdlib/sqstdrex.cpp
)
target_sources(libsquirrel PUBLIC
FILE_SET public_headers
TYPE HEADERS
BASE_DIRS include
FILES
include/sqstdaux.h
include/sqstdblob.h
include/sqstdio.h
include/sqstdmath.h
include/sqstdstring.h
include/sqstdsystem.h
include/squirrel.h
)
target_include_directories(libsquirrel PUBLIC
include
)
target_include_directories(libsquirrel PRIVATE
sqstdlib
squirrel
)
# ----------------------------------------------------
# sq object
# ----------------------------------------------------
add_library(libsqobject STATIC
sqobject/sqobjectinfo.cpp
sqobject/sqthread.cpp
sqobject/sqobjectclass.cpp
sqobject/sqmemfile.cpp
sqobject/sqratfunc.cpp
)
target_sources(libsqobject PUBLIC
FILE_SET public_headers
TYPE HEADERS
BASE_DIRS sqobject
FILES
sqobject/sqcont.h
sqobject/sqobjectclass.h
sqobject/sqobjectinfo.h
sqobject/sqthread.h
)
target_sources(libsqobject PUBLIC
FILE_SET public_headers
TYPE HEADERS
BASE_DIRS sqrat
FILES
sqrat/sqrat.h
sqrat/sqratimport.h
sqrat/sqrat/sqratAllocator.h
sqrat/sqrat/sqratBridgeMethods.h
sqrat/sqrat/sqratCastMethods.h
sqrat/sqrat/sqratClass.h
sqrat/sqrat/sqratClassType.h
sqrat/sqrat/sqratConst.h
sqrat/sqrat/sqratFunction.h
sqrat/sqrat/sqratGlobalMethods.h
sqrat/sqrat/sqratMemberMethods.h
sqrat/sqrat/sqratObject.h
sqrat/sqrat/sqratOverloadMethods.h
sqrat/sqrat/sqratPrintf.h
sqrat/sqrat/sqratProxyMethods.h
sqrat/sqrat/sqratScript.h
sqrat/sqrat/sqratTable.h
sqrat/sqrat/sqratTypes.h
sqrat/sqrat/sqratUtil.h
)
target_include_directories(libsqobject PRIVATE
sqobject
sqrat
)
target_link_libraries(libsqobject PUBLIC
libsquirrel
)
# ----------------------------------------------------
# sq command
# ----------------------------------------------------
add_executable( sq
sq/sq.cpp
sqstdlib/sqstdsystem.cpp
sqobject/sqfile.cpp
squirrel/sqmem.cpp
)
target_link_libraries( sq PRIVATE
libsquirrel
libsqobject
)
# ----------------------------------------------------
# install
# ----------------------------------------------------
install(TARGETS libsquirrel libsqobject sq FILE_SET public_headers)