Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TextToSpeech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Accelerators
System
TextToSpeech
Commits
011c695b
Commit
011c695b
authored
7 years ago
by
Stuart Mark James
Browse files
Options
Downloads
Patches
Plain Diff
Reversed horrid formatting of tts_library/CMakeLists
parent
3d852b8c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tts_library/CMakeLists.txt
+109
-113
109 additions, 113 deletions
tts_library/CMakeLists.txt
with
109 additions
and
113 deletions
tts_library/CMakeLists.txt
+
109
−
113
View file @
011c695b
#Start Build Config-- ---------------------------------
cmake_minimum_required
(
VERSION 3.0
)
message
(
STATUS
"Configuring TTS Static Library"
)
#Need to make sure we have a good enough compiler for filesystem
#https: // stackoverflow.com/questions/33149878/experimentalfilesystem-linker-error
if
(
CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.3
)
message
(
FATAL_ERROR
"Require at least gcc-5.3"
)
endif
()
project
(
tts_test
)
project
(
tts_static_library
)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
set
(
CMAKE_COLOR_MAKEFILE ON
)
#These inherit from the parent, clear them to be certain they are fresh
unset
(
INCLUDE_PATHS
)
unset
(
LIBRARIES
)
unset
(
LIBRARY_PATHS
)
#Options
option
(
TTS_ENABLE_TRACING
"Enable tracing on all function calls"
OFF
)
option
(
TTS_ENABLE_DEBUG
"Enable debugging output"
ON
)
if
(
TTS_ENABLE_TRACING
)
message
(
STATUS
"Enabled function tracing for tts_library"
)
endif
(
TTS_ENABLE_TRACING
)
if
(
TTS_ENABLE_DEBUG
)
message
(
STATUS
"Enabled debug output for tts_library"
)
endif
(
TTS_ENABLE_DEBUG
)
#AWS Config-- ---------------------------------
#find the AWS SDK package files to setup the project
find_package
(
AWSSDK REQUIRED
)
#Use the AWS macro to find the link aws - sdk libraries required
set
(
LIBRARY_REQUESTS polly
)
AWSSDK_DETERMINE_LIBS_TO_LINK
(
LIBRARY_REQUESTS AWS_LIBRARIES
)
message
(
STATUS
"Using AWS SDK libraries:
${
AWS_LIBRARIES
}
"
)
#add the aws include path
set
(
INCLUDE_PATHS
${
INCLUDE_PATHS
}
${
AWSSDK_INCLUDE_DIR
}
)
set
(
LIBRARIES
${
LIBRARIES
}
${
AWS_LIBRARIES
}
)
set
(
LIBRARY_PATHS
${
LIBRARY_PATHS
}
${
AWS_LIBRARY_DIR
}
)
#Pulse Audio-- ---------------------------------
find_package
(
PkgConfig REQUIRED
)
pkg_search_module
(
PULSE_SIMPLE libpulse - simple REQUIRED
)
set
(
INCLUDE_PATHS
${
INCLUDE_PATHS
}
${
PULSE_SIMPLE_INCLUDEDIR
}
)
set
(
LIBRARIES
${
LIBRARIES
}
${
PULSE_SIMPLE_LIBRARIES
}
)
set
(
LIBRARY_PATHS
${
LIBRARY_PATHS
}
${
PULSE_SIMPLE_LIBRARY_DIR
}
)
#Other-- ---------------------------------
set
(
LIBRARIES $ { LIBRARIES }
"pthread"
)
#Enforce Libraries-- ---------------------------------
unset
(
FOUND_LIBS
)
foreach
(
LIB
${
LIBRARIES
}
)
#try the user provided paths first
find_library
(
FOUND_LIB_
${
LIB
}
${
LIB
}
PATHS
${
LIBRARY_PATHS
}
NO_DEFAULT_PATH
)
#if we could not find it, drop to the system paths
if
(
NOT FOUND_LIB_
${
LIB
}
)
find_library
(
FOUND_LIB_
${
LIB
}
${
LIB
}
)
endif
()
list
(
APPEND FOUND_LIBS
${
FOUND_LIB_
${
LIB
}}
)
if
(
FOUND_LIB_
${
LIB
}
)
message
(
STATUS
"Found "
$ {
LIB
}
" at: "
${
FOUND_LIB_
${
LIB
}}
)
else
()
message
(
FATAL
"Could not find "
${
LIB
}
)
endif
()
endforeach
(
LIB
)
#Finally our source
set
(
POLLY_TTS_SRC
${
CMAKE_CURRENT_SOURCE_DIR
}
/
FileTTSCache.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/
PulseAudioSink.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/
JingleMgr.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/
TTSDataTypes.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/
TTSRunner.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/
PollyTTSDriver.cpp
)
#Build Targets-- ---------------------------------
#Target is a static library that can be shared with the other binaries
add_library
(
tts_static_library STATIC
${
POLLY_TTS_SRC
}
)
target_compile_options
(
tts_static_library PUBLIC -
std = c++ 14 -
Wall - Wextra
)
target_link_libraries
(
tts_static_library PUBLIC
${
FOUND_LIBS
}
-
lstdc++ fs
)
if
(
TTS_ENABLE_TRACING
)
target_compile_definitions
(
tts_static_library PRIVATE -
DTRACE_ENABLED
)
endif
(
TTS_ENABLE_TRACING
)
if
(
TTS_ENABLE_DEBUG
)
target_compile_definitions
(
tts_static_library PRIVATE -
DDEBUG_ENABLED
)
endif
(
TTS_ENABLE_DEBUG
)
target_include_directories
(
tts_static_library PUBLIC
${
INCLUDE_PATHS
}
PUBLIC
${
CMAKE_CURRENT_LIST_DIR
}
PRIVATE
"
${
PROJECT_BINARY_DIR
}
"
)
# Start Build Config -----------------------------------
cmake_minimum_required
(
VERSION 3.0
)
message
(
STATUS
"Configuring TTS Static Library"
)
# Need to make sure we have a good enough compiler for filesystem
# https://stackoverflow.com/questions/33149878/experimentalfilesystem-linker-error
if
(
CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.3
)
message
(
FATAL_ERROR
"Require at least gcc-5.3"
)
endif
()
project
(
tts_test
)
project
(
tts_static_library
)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
set
(
CMAKE_COLOR_MAKEFILE ON
)
# These inherit from the parent, clear them to be certain they are fresh
unset
(
INCLUDE_PATHS
)
unset
(
LIBRARIES
)
unset
(
LIBRARY_PATHS
)
# Options
option
(
TTS_ENABLE_TRACING
"Enable tracing on all function calls"
OFF
)
option
(
TTS_ENABLE_DEBUG
"Enable debugging output"
ON
)
if
(
TTS_ENABLE_TRACING
)
message
(
STATUS
"Enabled function tracing for tts_library"
)
endif
(
TTS_ENABLE_TRACING
)
if
(
TTS_ENABLE_DEBUG
)
message
(
STATUS
"Enabled debug output for tts_library"
)
endif
(
TTS_ENABLE_DEBUG
)
# AWS Config -----------------------------------
# find the AWS SDK package files to setup the project
find_package
(
AWSSDK REQUIRED
)
# Use the AWS macro to find the link aws-sdk libraries required
set
(
LIBRARY_REQUESTS polly
)
AWSSDK_DETERMINE_LIBS_TO_LINK
(
LIBRARY_REQUESTS AWS_LIBRARIES
)
message
(
STATUS
"Using AWS SDK libraries:
${
AWS_LIBRARIES
}
"
)
# add the aws include path
set
(
INCLUDE_PATHS
${
INCLUDE_PATHS
}
${
AWSSDK_INCLUDE_DIR
}
)
set
(
LIBRARIES
${
LIBRARIES
}
${
AWS_LIBRARIES
}
)
set
(
LIBRARY_PATHS
${
LIBRARY_PATHS
}
${
AWS_LIBRARY_DIR
}
)
# Pulse Audio -----------------------------------
find_package
(
PkgConfig REQUIRED
)
pkg_search_module
(
PULSE_SIMPLE libpulse-simple REQUIRED
)
set
(
INCLUDE_PATHS
${
INCLUDE_PATHS
}
${
PULSE_SIMPLE_INCLUDEDIR
}
)
set
(
LIBRARIES
${
LIBRARIES
}
${
PULSE_SIMPLE_LIBRARIES
}
)
set
(
LIBRARY_PATHS
${
LIBRARY_PATHS
}
${
PULSE_SIMPLE_LIBRARY_DIR
}
)
# Other -----------------------------------
set
(
LIBRARIES
${
LIBRARIES
}
"pthread"
)
# Enforce Libraries -----------------------------------
unset
(
FOUND_LIBS
)
foreach
(
LIB
${
LIBRARIES
}
)
# try the user provided paths first
find_library
(
FOUND_LIB_
${
LIB
}
${
LIB
}
PATHS
${
LIBRARY_PATHS
}
NO_DEFAULT_PATH
)
# if we could not find it, drop to the system paths
if
(
NOT FOUND_LIB_
${
LIB
}
)
find_library
(
FOUND_LIB_
${
LIB
}
${
LIB
}
)
endif
()
list
(
APPEND FOUND_LIBS
${
FOUND_LIB_
${
LIB
}}
)
if
(
FOUND_LIB_
${
LIB
}
)
message
(
STATUS
"Found "
${
LIB
}
" at: "
${
FOUND_LIB_
${
LIB
}}
)
else
()
message
(
FATAL
"Could not find "
${
LIB
}
)
endif
()
endforeach
(
LIB
)
# Finally our source
set
(
POLLY_TTS_SRC
${
CMAKE_CURRENT_SOURCE_DIR
}
/FileTTSCache.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/PulseAudioSink.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/JingleMgr.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/TTSDataTypes.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/TTSRunner.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/PollyTTSDriver.cpp
)
# Build Targets -----------------------------------
# Target is a static library that can be shared with the other binaries
add_library
(
tts_static_library STATIC
${
POLLY_TTS_SRC
}
)
target_compile_options
(
tts_static_library PUBLIC -std=c++14 -Wall -Wextra
)
target_link_libraries
(
tts_static_library PUBLIC
${
FOUND_LIBS
}
-lstdc++fs
)
if
(
TTS_ENABLE_TRACING
)
target_compile_definitions
(
tts_static_library PRIVATE -DTRACE_ENABLED
)
endif
(
TTS_ENABLE_TRACING
)
if
(
TTS_ENABLE_DEBUG
)
target_compile_definitions
(
tts_static_library PRIVATE -DDEBUG_ENABLED
)
endif
(
TTS_ENABLE_DEBUG
)
target_include_directories
(
tts_static_library
PUBLIC
${
INCLUDE_PATHS
}
PUBLIC
${
CMAKE_CURRENT_LIST_DIR
}
PRIVATE
"
${
PROJECT_BINARY_DIR
}
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment