-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
112 lines (100 loc) · 2.05 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
cmake_minimum_required(VERSION 2.8.3)
project(bing)
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall -Wextra")
# Qt
find_package(Qt5Core)
find_package(Qt5Concurrent)
find_package(Qt5Gui)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBSOUP libsoup-2.4)
include_directories(
include
${LIBSOUP_INCLUDE_DIRS}
)
qt5_wrap_cpp(
all_moc
speech.hpp
qnamaker.hpp
customvision.hpp
)
# Library
add_library(
bing
SHARED
speech.cpp
qnamaker.cpp
customvision.cpp
${all_moc}
)
target_link_libraries(
bing
Qt5::Core
Qt5::Gui
)
# Bing Speech (Recognition)
add_executable(
bingspeech_recognition_example
examples/bingspeech_recognition_example.cpp
${all_moc}
)
target_link_libraries(
bingspeech_recognition_example
bing
${LIBSOUP_LIBRARIES}
Qt5::Core
)
# Bing Speech (Synthesis)
add_executable(
bingspeech_synthesis_example
examples/bingspeech_synthesis_example.cpp
${all_moc}
)
target_link_libraries(
bingspeech_synthesis_example
bing
${LIBSOUP_LIBRARIES}
Qt5::Core
)
# Bing QnaMaker
add_executable(
bingqnamaker_example
examples/bingqnamaker_example.cpp
${all_moc}
)
target_link_libraries(
bingqnamaker_example
bing
${LIBSOUP_LIBRARIES}
Qt5::Core
Qt5::Concurrent
)
# Bing Custom Vision
add_executable(
bingcustomvision_example
examples/bingcustomvision_example.cpp
${all_moc}
)
target_link_libraries(
bingcustomvision_example
bing
${LIBSOUP_LIBRARIES}
Qt5::Core
Qt5::Gui
)
# Generate pkg-config
set(DEST_DIR "${CMAKE_INSTALL_PREFIX}")
set(PRIVATE_LIBS "-lbing")
CONFIGURE_FILE("bing.pc.in" "bing.pc" @ONLY)
# Install
install(TARGETS bing DESTINATION lib)
install(TARGETS bingspeech_recognition_example DESTINATION bin)
install(TARGETS bingspeech_synthesis_example DESTINATION bin)
install(
FILES "bing.hpp" "qnamaker.hpp" "speech.hpp" "customvision.hpp" "exception.hpp" DESTINATION include/bing
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install(
FILES "bing.pc" DESTINATION lib/pkgconfig
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)