-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
126 lines (86 loc) · 2.86 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
project(pea)
cmake_minimum_required(VERSION 3.1)
# Setting C++ Standard to C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(SOURCE_LIST
main.cpp
main_args.h
main_args.cpp
lib/filesystem.h
lib/char_utility.h
lib/scanner.h
lib/string_scanning.h
lib/string_building.h
lib/error/sscan_error.h
lib/ssource/string_source.h
lib/ssource/stream_string_source.h
lib/ssource/filter_string_source.h
lib/ssource/functional_filter_string_source.h
lib/ssource/string_string_source.h
lib/ssource/file_string_source.h
option/parameter_interface.h
option/parameter_interface.cpp
lang/config.h
lang/types.h
lang/error/include_error.h
lang/error/directive_error.h
lang/error/macro_error.h
lang/error/tool_error.h
lang/pp/macro/macro_scanning.h
lang/pp/macro/macro_signature.h
lang/pp/macro/macro_signature.cpp
lang/pp/macro/macro.h
lang/pp/macro/macro.cpp
lang/pp/macro/macro_library.h
lang/pp/macro/macro_library.cpp
lang/pp/include/pp_included_base.h
lang/pp/include/pp_included_base.cpp
lang/pp/include/pp_included_file_ssource.h
lang/pp/include/pp_included_file_ssource.cpp
lang/pp/include/pp_tool_ssource.h
lang/pp/include/pp_tool_ssource.cpp
lang/pp/include/pp_binary_tool_ssource.h
lang/pp/include/pp_binary_tool_ssource.cpp
lang/pp/ssource/pp_nocomment_ssource.h
lang/pp/ssource/pp_nocomment_ssource.cpp
lang/pp/ssource/pp_including_ssource.h
lang/pp/ssource/pp_including_ssource.cpp
lang/pp/directive/pp_directive_base.h
lang/pp/directive/pp_macro_directives.h
lang/pp/directive/pp_macro_directives.cpp
lang/pp/directive/pp_selection_directives.h
lang/pp/directive/pp_selection_directives.cpp
lang/pp/directive/pp_conditional_macro_directives.h
lang/pp/directive/pp_conditional_macro_directives.cpp
lang/pp/directive/pp_include_directives.h
lang/pp/directive/pp_include_directives.cpp
lang/pp/directive/pp_binary_directives.h
lang/pp/directive/pp_binary_directives.cpp
lang/pp/pp_selection_stack.h
lang/pp/pp_selection_stack.cpp
lang/pp/pp_directive_processor.h
lang/pp/pp_directive_processor.cpp
lang/pp/pp_include_observer.h
lang/pp/pp_include_observer.cpp
lang/pp/pp_dependency_observer.h
lang/pp/pp_dependency_observer.cpp
lang/pp/pp_main_directive_processor.h
lang/pp/pp_main_directive_processor.cpp
)
add_executable(${PROJECT_NAME} ${SOURCE_LIST})
# this is to ensure inclusion relative to base directory is allowed
include_directories(${CMAKE_SOURCE_DIR})
# link statically
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
# find, include & link boost (filesystem & process)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost COMPONENTS system filesystem)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} -lpthread)
if (WIN32)
target_link_libraries(${PROJECT_NAME} -lws2_32)
endif()
endif()