Updates to allow static speex building.
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 6 Mar 2015 21:07:08 +0000 (21:07 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 6 Mar 2015 21:07:08 +0000 (21:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2058 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/CMakeLists.txt
fdmdv2-dev/cmake/BuildCodec2.cmake
fdmdv2-dev/src/CMakeLists.txt
fdmdv2/CMakeLists.txt

index 8c3789b65d05eec98ded446812a32be057af7ea9..4773359a0c05be11eed934994870c9498cb6e966 100644 (file)
@@ -88,6 +88,8 @@ set(USE_STATIC_SOX FALSE CACHE BOOL
     "Download and build static sox instead of the system library.")
 set(USE_STATIC_CODEC2 TRUE CACHE BOOL
     "Download and build static codec2 instead of the system library.")
+set(USE_STATIC_SPEEXDSP TRUE CACHE BOOL
+    "Download and build static speex instead of the system library.")
 set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
     "Download and build static wxWidgets instead of the system library.")
 
@@ -212,6 +214,40 @@ add_definitions(-DHAVE_CONFIG_H)
 find_package(Threads REQUIRED)
 message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
 
+#
+# Find codec2
+#
+if(NOT USE_STATIC_CODEC2)
+    message(STATUS "Looking for codec2...")
+    find_package(codec2 CONFIG QUIET)
+    if(codec2_FOUND)
+        get_target_property(CODEC2_BRARY codec2 LOCATION)
+        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
+    else()
+        # Try to find manually
+        find_path(CODEC2_INCLUDE_DIRS codec2.h
+                  PATH_SUFFIXES codec2)
+        find_library(CODEC2_LIBRARY NAMES codec2)
+        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
+            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
+            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
+            include_directories(${CODEC2_INCLUDE_DIRS})
+        else()
+            message(FATAL_ERROR "codec2 library not found.
+Linux: 
+Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
+Windws:
+It's easiest to use the cmake option: USE_STATIC_CODEC2"
+        )
+        endif()
+    endif()
+else(NOT USE_STATIC_CODEC2)
+    message(STATUS "Will attempt static build of codec2.")
+    include(cmake/BuildCodec2.cmake)
+endif(NOT USE_STATIC_CODEC2)
+
 #
 # Find or build portaudio Library
 #
@@ -376,56 +412,27 @@ if(wxWidgets_FOUND)
     list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
 endif(wxWidgets_FOUND)
 
-#
-# Find codec2
-#
-if(NOT USE_STATIC_CODEC2)
-    message(STATUS "Looking for codec2...")
-    find_package(codec2 CONFIG QUIET)
-    if(codec2_FOUND)
-        get_target_property(CODEC2_BRARY codec2 LOCATION)
-        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
-    else()
-        # Try to find manually
-        find_path(CODEC2_INCLUDE_DIRS codec2.h
-                  PATH_SUFFIXES codec2)
-        find_library(CODEC2_LIBRARY NAMES codec2)
-        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
-            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
-            include_directories(${CODEC2_INCLUDE_DIRS})
-        else()
-            message(FATAL_ERROR "codec2 library not found.
-Linux: 
-Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
-Windws:
-It's easiest to use the cmake option: USE_STATIC_CODEC2"
-        )
-        endif()
-    endif()
-else(NOT USE_STATIC_CODEC2)
-    message(STATUS "Will attempt static build of codec2.")
-    include(cmake/BuildCodec2.cmake)
-endif(NOT USE_STATIC_CODEC2)
-
 #
 # Find speex library
 #
-message(STATUS "Looking for Speex DSP library.")
-find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
-find_library(SPEEXDSP_LIBRARY speexdsp)
-message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
-message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
-if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-    include_directories(${SPEEXDSP_INCLUDE_DIR})
-    list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
-else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-    message(FATAL_ERROR "Speex DSP library not found!")
-endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
-
-# Freedv 
+if(NOT USE_STATIC_SPEEXDSP)
+    message(STATUS "Looking for Speex DSP library.")
+    find_path(SPEEXDSP_INCLUDE_DIR speex/speex.h)
+    find_library(SPEEXDSP_LIBRARY speexdsp)
+    message(STATUS "  Speex DSP headers: ${SPEEXDSP_INCLUDE_DIR}")
+    message(STATUS "  Speex DSP library: ${SPEEXDSP_LIBRARY}")
+    if(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        include_directories(${SPEEXDSP_INCLUDE_DIR})
+        list(APPEND FREEDV_LINK_LIBS ${SPEEXDSP_LIBRARY})
+    else(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+        message(FATAL_ERROR "Speex DSP library not found!")
+    endif(SPEEXDSP_INCLUDE_DIR AND SPEEXDSP_LIBRARY)
+else()
+    message(STATUS "Will attempt static build of speex.")
+    include(cmake/BuildSpeex.cmake)
+endif()
+    
+#Freedv 
 add_subdirectory(src)
 
 # Icons and desktop file
index 4c1357787bd11b34673707e160e21af34d9c51a4..dd2a585cd21654fdfd2ec50f2cc90539e2972798 100644 (file)
@@ -1,7 +1,7 @@
 include(ExternalProject)
 ExternalProject_Add(codec2
    SVN_REPOSITORY https://svn.code.sf.net/p/freetel/code/codec2-dev
-   CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE 
+   CMAKE_ARGS -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/dist
    INSTALL_COMMAND ""
 )
 set(CODEC2_LIBRARIES
index 4eaa27b67ca567632231986ea54aed38457b0808..ac30ad8b33bd5214f47229ea764bef5e22c33311 100644 (file)
@@ -30,8 +30,6 @@ set(FREEDV_SOURCES
     sox_biquad.h
     sox.h
     topFrame.h
-    #varicode.h
-    #varicode_table.h
     version.h
 )
 
index e9951141f70889ecdcf22d9251592d71ce2c4a1d..b6e232aca32a215981192104eea0166067664587 100644 (file)
@@ -211,6 +211,40 @@ add_definitions(-DHAVE_CONFIG_H)
 find_package(Threads REQUIRED)
 message(STATUS "Threads library flags: ${CMAKE_THREAD_LIBS_INIT}")
 
+#
+# Find codec2
+#
+if(NOT USE_STATIC_CODEC2)
+    message(STATUS "Looking for codec2...")
+    find_package(codec2 CONFIG QUIET)
+    if(codec2_FOUND)
+        get_target_property(CODEC2_BRARY codec2 LOCATION)
+        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
+    else()
+        # Try to find manually
+        find_path(CODEC2_INCLUDE_DIRS codec2.h
+                  PATH_SUFFIXES codec2)
+        find_library(CODEC2_LIBRARY NAMES codec2)
+        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
+            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
+            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
+            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
+            include_directories(${CODEC2_INCLUDE_DIRS})
+        else()
+            message(FATAL_ERROR "codec2 library not found.
+Linux: 
+Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
+Windws:
+It's easiest to use the cmake option: USE_STATIC_CODEC2"
+        )
+        endif()
+    endif()
+else(NOT USE_STATIC_CODEC2)
+    message(STATUS "Will attempt static build of codec2.")
+    include(cmake/BuildCodec2.cmake)
+endif(NOT USE_STATIC_CODEC2)
+
 #
 # Find or build portaudio Library
 #
@@ -375,40 +409,6 @@ if(wxWidgets_FOUND)
     list(APPEND FREEDV_LINK_LIBS ${wxWidgets_LIBRARIES})
 endif(wxWidgets_FOUND)
 
-#
-# Find codec2
-#
-if(NOT USE_STATIC_CODEC2)
-    message(STATUS "Looking for codec2...")
-    find_package(codec2 CONFIG QUIET)
-    if(codec2_FOUND)
-        get_target_property(CODEC2_BRARY codec2 LOCATION)
-        message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-        message(STATUS "  codec2 headers: ${codec2_INCLUDE_DIRS}")
-    else()
-        # Try to find manually
-        find_path(CODEC2_INCLUDE_DIRS codec2.h
-                  PATH_SUFFIXES codec2)
-        find_library(CODEC2_LIBRARY NAMES codec2)
-        if(CODEC2_LIBRARY AND CODEC2_INCLUDE_DIRS)
-            message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
-            message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-            list(APPEND FREEDV_LINK_LIBS ${CODEC2_LIBRARY})
-            include_directories(${CODEC2_INCLUDE_DIRS})
-        else()
-            message(FATAL_ERROR "codec2 library not found.
-Linux: 
-Codec2 may not be in your distribution so build yourself or use the cmake option to build statically into FreeDV.
-Windws:
-It's easiest to use the cmake option: USE_STATIC_CODEC2"
-        )
-        endif()
-    endif()
-else(NOT USE_STATIC_CODEC2)
-    message(STATUS "Will attempt static build of codec2.")
-    include(cmake/BuildCodec2.cmake)
-endif(NOT USE_STATIC_CODEC2)
-
 
 # Freedv 
 add_subdirectory(src)