-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
92 lines (81 loc) · 2.85 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
# add_executable(example_g3syslog g3syslog_main.cpp)
# target_link_libraries(syslog_g3log_example g3syslog)
project(examples)
# Demonstrates LogRotate and LogRotateWithFilter
if(CHOICE_SINK_LOGROTATE)
include_directories(${g3sinks_SOURCE_DIR}/sink_logrotate/src
${g3sinks_SOURCE_DIR}/test ${G3LOG_INCLUDE_DIR})
add_executable(
example_logrotate_and_filter
logrotate_main.cpp ${g3sinks_SOURCE_DIR}/test/RotateTestHelper.cpp)
target_link_libraries(
example_logrotate_and_filter
PRIVATE gtest_main
PRIVATE ${G3LOG_LIBRARY}
PRIVATE g3logrotate)
if(UNIX)
target_compile_options(example_logrotate_and_filter PRIVATE)
endif()
# add_example(example_logrotate test_logrotate)
endif()
if(CHOICE_SINK_SYSLOG)
verifysyslogdependencies(SYSLOG_SINK_ERROR)
if(NOT SYSLOG_SINK_ERROR)
include_directories(${g3sinks_SOURCE_DIR}/sink_syslog/src
${G3LOG_INCLUDE_DIR})
add_executable(example_syslog syslog_main.cpp)
target_link_libraries(
example_syslog
PRIVATE gtest_main
PRIVATE ${G3LOG_LIBRARY}
PRIVATE g3syslog)
if(UNIX)
target_compile_options(example_syslog PRIVATE)
endif()
# add_example(example_logrotate test_logrotate)
endif()
endif()
if(CHOICE_SINK_SNIPPETS)
# Log with color formatting to std::cout
include_directories(${g3sinks_SOURCE_DIR}/sink_snippets/src
${G3LOG_INCLUDE_DIR})
add_executable(example_coloredcout snippet_coloredcout_main.cpp)
target_link_libraries(
example_coloredcout
PRIVATE gtest_main
PRIVATE ${G3LOG_LIBRARY})
target_compile_options(example_coloredcout PRIVATE)
# shared memory, file descriptor sink.
verifyfilelogdependencies(FILE_LOG_SINK_ERROR)
if(NOT FILE_LOG_SINK_ERROR)
include_directories(${g3sinks_SOURCE_DIR}/sink_snippets/src
${G3LOG_INCLUDE_DIR})
add_executable(example_filedescriptor snippet_filelog_main.cpp)
target_link_libraries(
example_filedescriptor
PRIVATE gtest_main
PRIVATE ${G3LOG_LIBRARY})
if(UNIX)
target_compile_options(example_filedescriptor PRIVATE)
endif()
endif()
endif()
if(WIN32)
# WIN32 tracelogging verifytraceloggingdependencies(TRACELOGGING_SINK_ERROR)
# if(NOT TRACELOGGING_SINK_ERROR)
include_directories(${g3sinks_SOURCE_DIR}/sink_snippets/src
${G3LOG_INCLUDE_DIR})
add_executable(example_tracelogging snippet_tracelogging_main.cpp)
target_link_libraries(
example_tracelogging
PRIVATE gtest_main
PRIVATE ${G3LOG_LIBRARY}
PRIVATE advapi32.lib)
if(UNIX)
target_compile_options(example_tracelogging PRIVATE)
endif()
# endif()
endif()
# KjellKod TODO add_custom_target(run COMMAND ./TextMiningCompiler <pathword>
# totoro.txt COMMAND cat test.txt | time ./TextMiningApp totoro.txt )
# add_dependencies(run TextMiningCompiler TextMiningApp)