Better support for cross-compiling of dependencies.
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 30 Jun 2015 18:02:47 +0000 (18:02 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 30 Jun 2015 18:02:47 +0000 (18:02 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2230 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/cmake/BuildCodec2.cmake
fdmdv2-dev/cmake/BuildPortaudio.cmake
fdmdv2-dev/cmake/BuildSpeex.cmake
fdmdv2-dev/cmake/BuildWxWidgets.cmake
fdmdv2-dev/cmake/MinGW.cmake [new file with mode: 0644]

index a1cd95c28f6bda126d30362ad43793c856d21142..471eef8d1d37499fe77cb2f0287367ae3dba1c4c 100644 (file)
@@ -6,10 +6,14 @@ if(USE_STATIC_SPEEXDSP)
         -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
index 60e9660c30889b9098e020372fab8518c332b103..cc33d061bce79381ceb52872c52ee31b887b1ff2 100644 (file)
@@ -13,6 +13,7 @@ endif()
 
 # 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)
index b46c6e17e9d56db805955ab278f45bfe8936f7aa..262d558f2357e41e83907211fa2e99e1dffb04c7 100644 (file)
@@ -1,6 +1,7 @@
 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)
index 82b6a02141128bf5847be359587b95685a2d75ff..901d80629da916fdddfd6b0c9b9140c19d27f3ad 100644 (file)
@@ -2,11 +2,7 @@ set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
 
 # 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.
diff --git a/fdmdv2-dev/cmake/MinGW.cmake b/fdmdv2-dev/cmake/MinGW.cmake
new file mode 100644 (file)
index 0000000..333c1dc
--- /dev/null
@@ -0,0 +1,8 @@
+# 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()