-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
99 lines (67 loc) · 2.58 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
project(SmartTalkRobot)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
SET(CMAKE_BUILD_TYPE Release)
set(CMAKE_INSTALL_PREFIX ./lib)
# Create valoc cplusplus library
add_library(SmartTalkRobot SHARED lib
SmartTalkRobot/Audiocontroler.cpp
SmartTalkRobot/Timetool.hpp
SmartTalkRobot/Utils.hpp
SmartTalkRobot/Encoding.cpp
SmartTalkRobot/Vocieai-vcs-api.cpp
SmartTalkRobot/rtaudio/Rtaudio.cpp
)
if(WIN32)
add_definitions(-DVCS_API_EXPORTS)
target_compile_definitions(SmartTalkRobot PRIVATE __WINDOWS_WASAPI__)
target_link_directories(SmartTalkRobot PRIVATE SmartTalkRobot/xunFei/libs)
target_link_libraries(SmartTalkRobot PRIVATE
msc_x64
)
else()
target_compile_definitions(SmartTalkRobot PRIVATE __LINUX_ALSA__ __LINUX_PULSE__)
target_link_libraries(SmartTalkRobot PRIVATE
)
endif()
include_directories(SmartTalkRobot)
include_directories(include)
include_directories(SmartTalkRobot/rtaudio)
include_directories(SmartTalkRobot/json)
include_directories(SmartTalkRobot/xunFei/include)
include_directories(SmartTalkRobot/spark)
target_include_directories(SmartTalkRobot PRIVATE
SmartTalkRobot
include
SmartTalkRobot/rtaudio
SmartTalkRobot/xunFei/libs
SmartTalkRobot/spark
)
target_link_directories(SmartTalkRobot PRIVATE SmartTalkRobot/spark/lib)
target_link_libraries(SmartTalkRobot PRIVATE SparkChain)
install(TARGETS SmartTalkRobot LIBRARY DESTINATION lib)
add_executable(demo example/demo.cpp)
if(WIN32)
target_include_directories(demo PRIVATE include)
target_link_directories(demo PRIVATE lib)
target_link_libraries(demo PRIVATE SmartTalkRobot)
target_link_directories(demo PRIVATE SmartTalkRobot/xunFei/libs)
target_link_libraries(demo PRIVATE
msc_x64
)
target_link_directories(demo PRIVATE SmartTalkRobot/spark/lib)
target_link_libraries(demo PRIVATE SparkChain)
# Visual Studio中的调试工作目录(即exe程序内的“./”所指的目录,仅在VS调试中有效)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${ProjectDir}./Release")
else()
target_include_directories(demo PRIVATE include)
target_include_directories(demo PRIVATE include/)
target_link_directories(demo PRIVATE lib)
target_link_libraries(demo PRIVATE SmartTalkRobot)
target_link_libraries(demo PRIVATE pulse)
target_link_libraries(demo PRIVATE pulse-simple)
target_link_libraries(demo PRIVATE asound)
#classifier-release -lCollectorSecondGen -lqualitycheck-release -lpulse -lpulse-simple -lasound
endif()