forked from funcwj/setk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (37 loc) · 1.55 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
cmake_minimum_required(VERSION 3.0)
project("SETK: Speech Enhancement Tookit on Kaldi")
set(CMAKE_CXX_STANDARD 11)
MESSAGE(STATUS "detected OS: ${CMAKE_SYSTEM}")
set(KALDI_ROOT $ENV{KALDI_ROOT})
set(OPENFST_ROOT $ENV{OPENFST_ROOT})
if(NOT DEFINED KALDI_ROOT)
message(FATAL_ERROR "KALDI_ROOT not defined, export KALDI_ROOT=/path/to/kaldi")
endif()
if(NOT DEFINED OPENFST_ROOT)
message(FATAL_ERROR "OPENFST_ROOT not defined, export OPENFST_ROOT=/path/to/openfst")
endif()
message(STATUS "defined KALDI_ROOT=" $ENV{KALDI_ROOT})
set(DEPEND_LIBS kaldi-base kaldi-util kaldi-matrix kaldi-feat kaldi-transform pthread)
add_definitions(-O3 -g -std=c++11)
include_directories(${KALDI_ROOT}/src ${OPENFST_ROOT}/include ${CMAKE_SOURCE_DIR})
link_directories(${KALDI_ROOT}/src/lib ${CMAKE_SOURCE_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "-framework Accelerate")
add_definitions(-DHAVE_CLAPACK)
include_directories(${KALDI_ROOT}/tools/CLAPACK)
elseif(UNIX)
add_definitions(-DHAVE_OPENBLAS)
set(OPENBLAS_ROOT $ENV{OPENBLAS_ROOT})
if(NOT DEFINED OPENBLAS_ROOT)
message(FATAL_ERROR "OPENBLAS_ROOT not defined, export OPENBLAS_ROOT=/path/to/openblas")
endif()
include_directories(${OPENBLAS_ROOT}/include)
link_directories(${OPENBLAS_ROOT}/lib)
set(DEPEND_LIBS ${DEPEND_LIBS} openblas)
message(STATUS "defined OPENBLAS_ROOT=" $ENV{OPENBLAS_ROOT})
endif()
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(test)