-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
56 lines (39 loc) · 1.43 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
cmake_minimum_required(VERSION 3.10)
project(paddlespeech_tts_cpp)
########## Global Options ##########
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(ABSL_PROPAGATE_CXX_STD ON)
########## Dependencies ##########
set(ENV{PKG_CONFIG_PATH} "${CMAKE_SOURCE_DIR}/third-party/build/lib/pkgconfig")
find_package(PkgConfig REQUIRED)
# It is hard to load xxx-config.cmake in a custom location, so use pkgconfig instead.
pkg_check_modules(ABSL REQUIRED absl_strings IMPORTED_TARGET)
pkg_check_modules(GFLAGS REQUIRED gflags IMPORTED_TARGET)
pkg_check_modules(GLOG REQUIRED libglog IMPORTED_TARGET)
# load header-only libraries
include_directories(
${CMAKE_SOURCE_DIR}/third-party/build/src/cppjieba/include
${CMAKE_SOURCE_DIR}/third-party/build/src/limonp/include
)
find_package(Threads REQUIRED)
########## paddlespeech_tts_front ##########
include_directories(src)
file(GLOB FRONT_SOURCES
./src/base/*.cpp
./src/front/*.cpp
)
add_library(paddlespeech_tts_front STATIC ${FRONT_SOURCES})
target_link_libraries(
paddlespeech_tts_front
PUBLIC
PkgConfig::GFLAGS
PkgConfig::GLOG
PkgConfig::ABSL
Threads::Threads
)
########## tts_front_demo ##########
file(GLOB FRONT_DEMO_SOURCES front_demo/*.cpp)
add_executable(tts_front_demo ${FRONT_DEMO_SOURCES})
target_include_directories(tts_front_demo PRIVATE ./front_demo)
target_link_libraries(tts_front_demo PRIVATE paddlespeech_tts_front)