-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
83 lines (61 loc) · 1.95 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
cmake_minimum_required(VERSION 3.1)
set(CMAKE_BUILD_TYPE Release)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
project("AjnaSpeak")
################################
# Add additional compiler flags #
#################################
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -Wno-deprecated-declarations -Wno-unused-function")
ENDIF()
IF(NOT WIN32)
SET(CFLAGS_WARN "-Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing")
SET(CMAKE_CXX_FLAGS "-fPIC -O3 -march=native ${CFLAGS_WARN} ${CMAKE_CXX_FLAGS}")
#SET(CMAKE_CXX_FLAGS "-fPIC -g ${CFLAGS_WARN} ${CMAKE_CXX_FLAGS}")
ENDIF()
#########################
# Suppress auto-linking #
#########################
IF(WIN32)
ADD_DEFINITIONS(-DUSING_CMAKE=1)
ENDIF()
############# Find ESPEAK TTS ############
find_path(LIBESPEAK_INCLUDE_DIRS
NAMES speak_lib.h
HINTS /usr/local/include/espeak
$CMAKE_CURRENT_SOURCE_DIR )
link_directories(/usr/lib/x86_64-linux-gnu)
#########################################
include_directories(include)
#include_directories($LIBESPEAK_INCLUDE_DIRS)
file(GLOB SOURCES_CPP "src/*.cpp")
file(GLOB SOURCES_H "include/*.h")
add_library(AjnaSpeak
SHARED
${SOURCES_CPP}
${SOURCES_H}
)
target_compile_definitions(AjnaSpeak PRIVATE LIB_WITH_UNITY=1)
target_link_libraries(AjnaSpeak
${eSpeak_LIBRARIES}
espeak
-lpthread
)
#########################################
include_directories(include)
#include_directories($LIBESPEAK_INCLUDE_DIRS)
file(GLOB SOURCES_CPP "src/*.cpp")
file(GLOB SOURCES_H "include/*.h")
add_executable(AjnaSpeakApp
${SOURCES_CPP}
${SOURCES_H}
)
target_link_libraries(AjnaSpeakApp
${eSpeak_LIBRARIES}
espeak
-lpthread
)