Make static portaudio build cross-compiling aware.
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 16 Jun 2015 03:00:07 +0000 (03:00 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 16 Jun 2015 03:00:07 +0000 (03:00 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2195 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/cmake/BuildPortaudio.cmake

index c058061d797f8e78c1e1757a76797a256d4c3b82..60e9660c30889b9098e020372fab8518c332b103 100644 (file)
@@ -11,12 +11,19 @@ On Linux systems try installing:
     )
 endif()
 
+# Make sure that configure knows what system we're using when cross-compiling.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+    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)
+endif()
+
 include(ExternalProject)
 ExternalProject_Add(portaudio
     URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --enable-cxx --without-jack --prefix=${CMAKE_BINARY_DIR}/external/dist
+    CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
     BUILD_COMMAND $(MAKE)
     INSTALL_COMMAND $(MAKE) install
 )