forked from AMDmi3/streetmangler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
76 lines (58 loc) · 1.8 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
PROJECT(streetmangler)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
ENABLE_TESTING()
# options
OPTION(WITH_PYTHON "Enable python bindings" OFF)
OPTION(WITH_PERL "Enable perl bindings" OFF)
# depends
FIND_PACKAGE(EXPAT REQUIRED)
FIND_PACKAGE(ICU REQUIRED)
# common sources
SET(LOCALE_SRCS
lib/locales/ru.cc
lib/locales/en.cc
lib/locales/uk.cc
)
SET(LIBRARY_SRCS
${LOCALE_SRCS}
lib/database.cc
lib/locale.cc
lib/name.cc
lib/stringlistparser.cc
)
SET(PROCESS_NAMES_SRCS
utils/process_names.cc
utils/osm_name_extractor.cc
utils/name_aggregator.cc
)
# definitions
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib ${PROJECT_SOURCE_DIR}/contrib/tspell)
ADD_DEFINITIONS(-DDATADIR="${PROJECT_SOURCE_DIR}/data")
ADD_DEFINITIONS(-Wall -Wextra -pedantic)
ADD_DEFINITIONS(-std=c++11)
# library
INCLUDE_DIRECTORIES(${ICU_INCLUDE_DIR})
ADD_LIBRARY(streetmangler SHARED ${LIBRARY_SRCS})
TARGET_LINK_LIBRARIES(streetmangler ${ICU_LIBRARY})
# bindings
IF(WITH_PYTHON OR WITH_PERL)
ADD_SUBDIRECTORY(swig)
ENDIF(WITH_PYTHON OR WITH_PERL)
# utilities
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS})
ADD_EXECUTABLE(process_names ${PROCESS_NAMES_SRCS})
TARGET_LINK_LIBRARIES(process_names streetmangler ${EXPAT_LIBRARY})
# tests
ADD_EXECUTABLE(locale_test tests/locale_test.cc)
TARGET_LINK_LIBRARIES(locale_test streetmangler)
ADD_EXECUTABLE(tokenizer_test tests/tokenizer_test.cc)
TARGET_LINK_LIBRARIES(tokenizer_test streetmangler)
ADD_EXECUTABLE(database_test tests/database_test.cc)
TARGET_LINK_LIBRARIES(database_test streetmangler)
ADD_EXECUTABLE(canonical_test tests/canonical_test.cc)
TARGET_LINK_LIBRARIES(canonical_test streetmangler)
ADD_TEST(locale_test locale_test)
ADD_TEST(tokenizer_test tokenizer_test)
ADD_TEST(database_test database_test)
ADD_TEST(canonical_test canonical_test)