-DSPEEXDSP_INCLUDE_DIR=${CMAKE_BINARY_DIR}/external/dist/include)
endif()
+if(CMAKE_CROSSCOMPILING)
+ set(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-dev
- CMAKE_ARGS ${SPEEXDSP_CMAKE_ARGS}
+ CMAKE_ARGS ${CODEC2_CMAKE_ARGS} ${SPEEXDSP_CMAKE_ARGS}
INSTALL_COMMAND ""
)
set(CODEC2_LIBRARIES
# Make sure that configure knows what system we're using when cross-compiling.
if(MINGW AND CMAKE_CROSSCOMPILING)
+ include(cmake/MinGW.cmake)
set(CONFIGURE_COMMAND ./configure --build=${HOST} --host=${HOST} --target=${HOST} --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
else()
set(CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
set(SPEEXDSP_TARBALL "speexdsp-1.2rc3.tar.gz")
if(MINGW AND CMAKE_CROSSCOMPILING)
+ include(cmake/MinGW.cmake)
set(CONFIGURE_COMMAND ./configure --host=${HOST} --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
else()
set(CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-examples)
# If we're cross-compiling then we need to set the target host manually.
if(MINGW AND CMAKE_CROSSCOMPILING)
- if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
- set(HOST x86_64-w64-mingw32)
- else()
- set(HOST i686-w64-mingw32)
- endif()
+ include(cmake/MinGW.cmake)
endif()
# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
--- /dev/null
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+ set(HOST x86_64-w64-mingw32)
+ else()
+ set(HOST i686-w64-mingw32)
+ endif()
+endif()