This repository has been archived by the owner on Jan 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
108 lines (97 loc) · 4.47 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
# (c) 2017 Ben Jones JASL build
cmake_minimum_required (VERSION 2.6)
project (jasl)
# put all source code in one place for convenience
file(GLOB caching src/caching/*.cpp src/caching/*.hpp)
file(GLOB parser src/parser/*.cpp src/parser/*.hpp)
file(GLOB commands src/commands/*.cpp src/commands/*.hpp)
file(GLOB commands_expressions src/commands/expressions/*.cpp src/commands/expressions/*.hpp)
file(GLOB commands_fileio src/commands/fileio/*.cpp src/commands/fileio/*.hpp)
file(GLOB commands_net src/commands/net/*.cpp src/commands/net/*.hpp)
file(GLOB commands_string src/commands/string/*.cpp src/commands/string/*.hpp)
file(GLOB commands_list src/commands/list/*.cpp src/commands/list/*.hpp)
file(GLOB commands_flow src/commands/flow/*.cpp src/commands/flow/*.hpp)
file(GLOB commands_screenio src/commands/screenio/*.cpp src/commands/screenio/*.hpp)
file(GLOB commands_types src/commands/types/*.cpp src/commands/types/*.hpp)
file(GLOB other src/other/*.hpp)
file(GLOB core src/core/*.cpp src/core/*.hpp)
file(GLOB simpleprompt simpleprompt/*.hpp)
file(GLOB simpletest simpletest/*.hpp)
# ensure headers in the src folder are compiler-found
include_directories(src)
include_directories(simpleprompt)
include_directories(simpletest)
# annoyingly, lbs here aren't picked up automatically
link_directories(/usr/local/lib)
# break above sub-folders into individual libraries
add_library(caching_lib ${caching})
add_library(parser_lib ${parser})
add_library(commands_lib ${commands})
add_library(commands_expressions_lib ${commands_expressions})
add_library(commands_fileio_lib ${commands_fileio})
add_library(commands_net_lib ${commands_net})
add_library(commands_string_lib ${commands_string})
add_library(commands_list_lib ${commands_list})
add_library(commands_flow_lib ${commands_flow})
add_library(commands_screenio_lib ${commands_screenio})
add_library(commands_types_lib ${commands_types})
add_library(core_lib ${core})
# external lib deps. Need to make this generic. dylibs are mac-specifc
find_package(Boost COMPONENTS filesystem system REQUIRED)
find_package(CURL REQUIRED)
find_library(ICUUC_LIB NAMES icuuc REQUIRED)
# make sure boost headers can be found
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${CURL_INCLUDE_DIR})
# print some shit out...
message(${ICUUC_LIB})
message(${CURL_LIBRARIES})
# build the interpretor
add_executable(jasl src/bin/jasl.cpp)
set(EXT_DEPS ${Boost_LIBRARIES} ${CURL_LIBRARIES} ${ICUUC_LIB})
target_link_libraries(jasl
caching_lib
parser_lib
commands_lib
commands_expressions_lib
commands_fileio_lib
commands_net_lib
commands_string_lib
commands_list_lib
commands_flow_lib
commands_screenio_lib
commands_types_lib
core_lib
${EXT_DEPS})
# build test binary
add_executable(jtest src/bin/test.cpp)
target_link_libraries(jtest
caching_lib
parser_lib
commands_lib
commands_expressions_lib
commands_fileio_lib
commands_net_lib
commands_string_lib
commands_list_lib
commands_flow_lib
commands_screenio_lib
commands_types_lib
core_lib
${EXT_DEPS})
# compile options. Lots of redundancy here. Can prob clean up.
set(COMP_FLAGS -std=c++14 -O3 -ffast-math -funroll-loops -Wno-ctor-dtor-privacy -fno-pic)
target_compile_options(caching_lib PUBLIC ${COMP_FLAGS})
target_compile_options(parser_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_expressions_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_fileio_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_net_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_string_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_list_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_flow_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_screenio_lib PUBLIC ${COMP_FLAGS})
target_compile_options(commands_types_lib PUBLIC ${COMP_FLAGS})
target_compile_options(core_lib PUBLIC ${COMP_FLAGS})
target_compile_options(jasl PUBLIC ${COMP_FLAGS})
target_compile_options(jtest PUBLIC ${COMP_FLAGS})