2017-06-27 04:31:09 +08:00
|
|
|
cmake_minimum_required (VERSION 3.8.0)
|
2017-06-29 06:27:08 +08:00
|
|
|
project (libspeex C)
|
|
|
|
|
2017-06-27 04:31:09 +08:00
|
|
|
option(USE_SSE "USE_SSE used Note: USE_SSE and FIXED_POINT are mutually exclusive." ON)
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(-DHAVE_CONFIG_H)
|
|
|
|
if(USE_SSE)
|
|
|
|
add_definitions(-DUSE_SSE -DFLOATING_POINT)
|
|
|
|
else()
|
|
|
|
add_definitions(-DFIXED_POINT)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-06-29 06:27:08 +08:00
|
|
|
include_directories(win32 include)
|
|
|
|
|
|
|
|
set(CMAKE_DEBUG_POSTFIX d)
|
2017-06-27 04:31:09 +08:00
|
|
|
|
2017-12-03 15:57:17 +08:00
|
|
|
file(READ "win32/libspeex.def" _contents)
|
2017-12-10 09:17:10 +08:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
string(REPLACE "LIBRARY libspeex" "LIBRARY libspeexd" _contents "${_contents}")
|
|
|
|
endif()
|
2017-12-03 15:57:17 +08:00
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def"
|
|
|
|
"${_contents}\n"
|
|
|
|
"speex_nb_mode\n"
|
|
|
|
"speex_wb_mode\n"
|
|
|
|
"speex_uwb_mode\n"
|
2017-12-10 09:19:12 +08:00
|
|
|
"speex_mode_list\n"
|
|
|
|
"speex_header_free\n"
|
2017-12-03 15:57:17 +08:00
|
|
|
)
|
|
|
|
|
2017-06-27 04:31:09 +08:00
|
|
|
set(SRC
|
2017-06-29 06:27:08 +08:00
|
|
|
"libspeex/bits.c"
|
|
|
|
"libspeex/cb_search.c"
|
|
|
|
"libspeex/exc_10_16_table.c"
|
|
|
|
"libspeex/exc_10_32_table.c"
|
|
|
|
"libspeex/exc_20_32_table.c"
|
|
|
|
"libspeex/exc_5_256_table.c"
|
|
|
|
"libspeex/exc_5_64_table.c"
|
|
|
|
"libspeex/exc_8_128_table.c"
|
|
|
|
"libspeex/fftwrap.c"
|
|
|
|
"libspeex/filters.c"
|
|
|
|
"libspeex/gain_table.c"
|
|
|
|
"libspeex/gain_table_lbr.c"
|
|
|
|
"libspeex/hexc_10_32_table.c"
|
|
|
|
"libspeex/hexc_table.c"
|
|
|
|
"libspeex/high_lsp_tables.c"
|
|
|
|
"libspeex/kiss_fft.c"
|
|
|
|
"libspeex/kiss_fftr.c"
|
|
|
|
"libspeex/lpc.c"
|
|
|
|
"libspeex/lsp.c"
|
|
|
|
"libspeex/lsp_tables_nb.c"
|
|
|
|
"libspeex/ltp.c"
|
|
|
|
"libspeex/modes.c"
|
|
|
|
"libspeex/modes_wb.c"
|
|
|
|
"libspeex/nb_celp.c"
|
|
|
|
"libspeex/quant_lsp.c"
|
|
|
|
"libspeex/sb_celp.c"
|
|
|
|
"libspeex/smallft.c"
|
|
|
|
"libspeex/speex.c"
|
|
|
|
"libspeex/speex_callbacks.c"
|
|
|
|
"libspeex/speex_header.c"
|
|
|
|
"libspeex/stereo.c"
|
|
|
|
"libspeex/vbr.c"
|
|
|
|
"libspeex/vq.c"
|
|
|
|
"libspeex/window.c"
|
2017-12-03 15:57:17 +08:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/libspeex.def"
|
2017-06-27 04:31:09 +08:00
|
|
|
)
|
|
|
|
|
2017-06-29 06:27:08 +08:00
|
|
|
add_library(libspeex ${SRC})
|
2017-06-27 04:31:09 +08:00
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS libspeex
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT DISABLE_INSTALL_HEADERS)
|
2017-06-29 06:27:08 +08:00
|
|
|
install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
|
2017-06-27 04:31:09 +08:00
|
|
|
endif()
|