2017-08-26 20:22:53 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
2019-10-08 01:35:13 +08:00
|
|
|
option(USE_SSE "Use SSE" ON)
|
2017-08-26 20:22:53 +08:00
|
|
|
project (libspeexdsp)
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
file(GLOB_RECURSE LIBSPEEXDSP_SOURCES "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/*.c")
|
|
|
|
list(FILTER LIBSPEEXDSP_SOURCES EXCLUDE REGEX "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/test.*\\.c")
|
|
|
|
file(GLOB_RECURSE LIBSPEEXDSP_HEADERS "${CMAKE_CURRENT_LIST_DIR}/libspeexdsp/*.h")
|
|
|
|
file(GLOB_RECURSE LIBSPEEXDSP_HEADERS_PUBLIC "${CMAKE_CURRENT_LIST_DIR}/include/**/*.h")
|
2017-08-26 20:22:53 +08:00
|
|
|
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-D_WINDOWS -D_USRDLL)
|
2019-10-08 01:35:13 +08:00
|
|
|
list(APPEND LIBSPEEXDSP_SOURCES "${CMAKE_CURRENT_LIST_DIR}/win32/libspeexdsp.def")
|
2017-08-26 20:22:53 +08:00
|
|
|
else ()
|
|
|
|
add_definitions(-D_LIB)
|
|
|
|
endif ()
|
|
|
|
|
2017-11-22 23:18:45 +08:00
|
|
|
add_definitions(-DHAVE_CONFIG_H -D_WIN32)
|
|
|
|
|
2018-03-06 04:19:27 +08:00
|
|
|
if (USE_SSE)
|
|
|
|
add_definitions(-D_USE_SSE -D_USE_SSE2)
|
2017-11-22 23:18:45 +08:00
|
|
|
endif()
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
include_directories("${CMAKE_CURRENT_LIST_DIR}/include"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/win32")
|
2017-08-26 20:22:53 +08:00
|
|
|
add_library(libspeexdsp ${LIBSPEEXDSP_SOURCES} ${LIBSPEEXDSP_HEADERS})
|
|
|
|
|
|
|
|
set_target_properties(libspeexdsp PROPERTIES PUBLIC_HEADER "${LIBSPEEXDSP_HEADERS_PUBLIC}")
|
|
|
|
|
|
|
|
install(TARGETS libspeexdsp
|
|
|
|
ARCHIVE DESTINATION "lib"
|
|
|
|
RUNTIME DESTINATION "bin"
|
|
|
|
PUBLIC_HEADER DESTINATION "include/speex")
|