-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
129 lines (102 loc) · 2.99 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
project(utils)
cmake_minimum_required(VERSION 3.6)
cmake_policy(SET CMP0052 NEW)
include(cmake/DefineForFiles.cmake)
include(cmake/ConfigureVS.cmake)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
#find possible includes
if (NOT "$ENV{LUA_PATH}" STREQUAL "")
include_directories($ENV{LUA_PATH}/include)
endif ($ENV{LUA_PATH})
configure_msvc_runtime()
list(APPEND UtilsLibraries "rapidjson|RAPIDJSON")
list(APPEND UtilsLibraries "lua.h|LUA")
list(APPEND UtilsLibraries "blockingconcurrentqueue.h|ATOMIC_QUEUE")
DefineForFiles(UtilsLibraries)
set(FILESYSTEM_SRC filesystem/filesystem.hpp filesystem/extra.hpp)
set(PROCESS_SRC
process/cli_arguments.hpp
process/cli_arguments.cpp
process/process.hpp
process/process.cpp
)
include_directories(. ..)
if (UNIX)
set(FILESYSTEM_SRC ${FILESYSTEM_SRC}
filesystem/platform/linux/filesystem.cpp
filesystem/extra.cpp
)
set(PROCESS_SRC ${PROCESS_SRC}
process/platform/linux/process.hpp
process/platform/linux/process.cpp
)
endif(UNIX)
if (MSVC)
set(FILESYSTEM_SRC ${FILESYSTEM_SRC}
filesystem/platform/windows/filesystem.cpp
filesystem/extra.cpp
)
set(PROCESS_SRC ${PROCESS_SRC}
process/platform/windows/process.hpp
process/platform/windows/process.cpp
)
set(TIME_SRC
time/time.hpp
time/time_win.cpp
)
endif(MSVC)
if (RAPIDJSON)
message(STATUS "Use Rapidjson")
set(RAPIDJSON_GENERATOR
reflection/json/iterator_stream.hpp
reflection/json/rj_reading_visitor.cpp
reflection/json/rj_reading_visitor.hpp
reflection/json/rj_writing_visitor.cpp
reflection/json/rj_writing_visitor.hpp
reflection/json/std_stream.hpp
)
endif(RAPIDJSON)
if (LUA)
message(STATUS "Use LUA")
set(LUA_CODE
reflection/lua/reading_visitor.cpp
reflection/lua/reading_visitor.hpp
reflection/lua/writing_visitor.cpp
reflection/lua/writing_visitor.hpp
reflection/lua/helper.hpp
reflection/lua/helper.cpp
reflection/lua/execute.cpp
reflection/lua/execute.hpp
)
endif(LUA)
set(STRING_SRC
string/build.hpp
string/size_for_output_containers.hpp
string/size_for_output.hpp
string/string.cpp
string/string.hpp
string/string_streambuf.cpp
string/string_streambuf.hpp
string/sha1sum.hpp
string/sha1sum.cpp
string/narrow.hpp
)
set (NUMBERS
numbers/bcd.hpp
numbers/bcd.cpp
numbers/int.hpp
numbers/int.cpp
)
set(SRC iostream/datetime.hpp
iostream/datetime.cpp
${PROCESS_SRC}
${FILESYSTEM_SRC}
${STRING_SRC}
${RAPIDJSON_GENERATOR}
${LUA_CODE}
${NUMBERS}
${TIME_SRC})
group_files(SRC)
add_library(utils
${SRC}
)