-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
28 lines (25 loc) · 1.11 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
cmake_minimum_required(VERSION 3.1.0)
project(lua-deepspeech)
add_library(lua-deepspeech MODULE lua_deepspeech.c)
set_target_properties(lua-deepspeech PROPERTIES PREFIX "")
if(DEEPSPEECH_PATH)
add_library(deepspeech SHARED IMPORTED GLOBAL)
target_include_directories(lua-deepspeech PRIVATE "${DEEPSPEECH_PATH}")
target_link_libraries(lua-deepspeech PRIVATE deepspeech)
if(WIN32)
set_target_properties(deepspeech PROPERTIES IMPORTED_IMPLIB "${DEEPSPEECH_PATH}/libdeepspeech.so.if.lib")
set_target_properties(deepspeech PROPERTIES IMPORTED_LOCATION "${DEEPSPEECH_PATH}/libdeepspeech.so")
else()
set_target_properties(deepspeech PROPERTIES IMPORTED_LOCATION "${DEEPSPEECH_PATH}/libdeepspeech.so")
endif()
else()
message(FATAL_ERROR "Deepspeech path not found. Set DEEPSPEECH_PATH to the path to the deepspeech native client library.")
endif()
if(LOVR)
set(LOVR_PLUGIN_TARGETS lua-deepspeech deepspeech)
else()
include(FindLua)
find_package(Lua REQUIRED)
target_include_directories(lua-deepspeech PRIVATE "${LUA_INCLUDE_DIR}")
target_link_libraries(lua-deepspeech PRIVATE "${LUA_LIBRARIES}")
endif()