File: BuildCodec2.cmake

package info (click to toggle)
freedv 1.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 2,440 kB
  • sloc: cpp: 8,723; ansic: 3,564; python: 42; makefile: 10; sh: 7
file content (29 lines) | stat: -rw-r--r-- 1,112 bytes parent folder | download
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
set(SPEEXDSP_CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist)

if(USE_STATIC_SPEEXDSP)
    list(APPEND SPEEXDSP_CMAKE_ARGS 
        -DSPEEXDSP_LIBRARIES=${CMAKE_BINARY_DIR}/external/dist/lib/libspeexdsp.a
        -DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
endif()

set(CODEC2_CMAKE_ARGS -DUNITTEST=FALSE)

if(CMAKE_CROSSCOMPILING)
    set(CODEC2_CMAKE_ARGS ${CODEC2_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
endif()

include(ExternalProject)
ExternalProject_Add(codec2
   SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2/tags/0.8.1
   CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS} 
   CMAKE_CACHE_ARGS -DCMAKE_OSX_DEPLOYMENT_TARGET:string=10.7
   INSTALL_COMMAND ""
)
set(CODEC2_LIBRARIES
    ${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2-build/src/libcodec2.a)
ExternalProject_Get_Property(codec2 BINARY_DIR)
include_directories(${CMAKE_BINARY_DIR}/codec2-prefix/src/codec2/src 
                    ${BINARY_DIR}
)
list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARIES})
list(APPEND FREEDV_STATIC_DEPS codec2)