-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
103 lines (77 loc) · 2.29 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
cmake_minimum_required(VERSION 3.6.2)
project(mukyu_cablin)
if (MSVC)
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
add_definitions("/wd4267 /wd4244 /wd4305 /Zc:strictStrings /utf-8")
endif()
add_subdirectory(third_party/yaml-cpp)
include_directories(third_party/yaml-cpp/include)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
include_directories(include)
set(CMAKE_CXX_STANDARD 17)
set(cablin_core_src
src/core/controller.cpp
"src/core/script.cpp")
set(cablin_common_src
src/common/yamlutil.cpp)
set(cablin_command_src
"src/command/factory.cpp"
"src/command/if.cpp"
"src/command/block.cpp"
"src/command/call.cpp"
"src/command/var.cpp"
"src/command/globalvar.cpp"
"src/command/while.cpp"
"src/command/assign.cpp")
set(cablin_function_src
src/function/print.cpp
src/function/node.cpp)
set(cablin_expr_src
src/expr/call.cpp
src/expr/getvar.cpp
src/expr/factory.cpp)
set(cablin_package_src
src/package/builtin_io.cpp
src/package/builtin_op.cpp
src/package/builtin_cast.cpp
src/package/factory.cpp
src/package/userdefine.cpp)
add_library(cablin
${cablin_core_src}
${cablin_command_src}
${cablin_common_src}
${cablin_function_src}
${cablin_package_src}
${cablin_expr_src})
target_link_libraries(cablin
PRIVATE
yaml-cpp
Threads::Threads)
# ----------
# Installation
install(TARGETS cablin
DESTINATION lib
COMPONENT cablin)
install(DIRECTORY include/mukyu
DESTINATION include
COMPONENT cablin)
# ----------
# Interpreter
add_subdirectory(interpreter)
# ----------
# Example
add_subdirectory(example)
# ----------
# Unit Test
add_subdirectory(tests)
# ----------
# Archive support
set(CPACK_ARCHIVE_FILE_NAME "mukyu-cablin")
set(CPACK_ARCHIVE_COMPONENT_INSTALL 1)
set(CPACK_COMPONENTS_ALL cablin)
set(CPACK_GENERATOR "ZIP")
include(CPack)