-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
132 lines (116 loc) · 4.92 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
130
131
132
cmake_minimum_required(VERSION 2.8)
project(data_structures)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLibs)
include(CheckCXXCompilerFlag)
include(AddCXXCompilerFlag)
add_cxx_compiler_flag(--std=c++11)
add_cxx_compiler_flag(-Wall)
if (DEFINED USING_CLANG)
add_cxx_compiler_flag(-stdlib=libstdc++)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googlemock/include
${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/include
${CMAKE_CURRENT_SOURCE_DIR}/external/mirror_utf8cpp/source
/usr/local/include
)
set(GTEST_LIB
${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/build/libgtest.a
)
set(GMOCK_LIB
${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googlemock/build/libgmock.a
)
link_directories(/usr/local/lib)
set(COMMON_LINK_LIBS
folly
wangle
boost_thread
boost_system
boost_filesystem
glog
gflags
atomic
pthread
)
set(TEST_LIBS
${GTEST_LIB}
${GMOCK_LIB}
${COMMON_LINK_LIBS}
)
set(LIB_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/Language.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Detector.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/Profile.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/ProfileGroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/detection/DetectionRunner.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ngrams/NGramExtractor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/af.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/bg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/bn.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ca.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/cs.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/cy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/da.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/de.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/el.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/en.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/es.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/et.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/fa.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/fi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/fr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/gu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/he.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/hi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/hr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/hu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/id.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/it.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ja.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/kn.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ko.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/lt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/lv.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/mk.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ml.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/mr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ne.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/nl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/no.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/pa.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/pl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/pt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ro.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ru.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/sk.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/sl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/so.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/sq.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/sv.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/sw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ta.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/te.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/th.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/tl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/tr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/uk.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/ur.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/vi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/zh_cn.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/profiles/langs/zh_tw.cpp
)
add_library(langdetectpp
${LIB_SOURCES}
)
target_link_libraries(langdetectpp ${COMMON_LINK_LIBS})
set(FUNC_TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/functional_test.cpp
)
add_executable(func_test_runner
${FUNC_TEST_SOURCES}
)
add_dependencies(func_test_runner langdetectpp)
target_link_libraries(func_test_runner langdetectpp ${COMMON_LINK_LIBS})