Update wxWidgets bootstrap process to be more simple and other tweaks to USE_STATIC_...
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 13 Jun 2013 15:40:39 +0000 (15:40 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 13 Jun 2013 15:40:39 +0000 (15:40 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1317 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/CMakeLists.txt
fdmdv2/README.cmake
fdmdv2/README.txt
fdmdv2/cmake/BuildPortaudio.cmake
fdmdv2/cmake/BuildSndfile.cmake
fdmdv2/cmake/BuildSox.cmake

index 4bfa1751c6a37fe72a53b26c3c7a02b41b6375fd..81180a8f3458e9bf3b6b31b0671ec66de62e75f7 100644 (file)
@@ -38,8 +38,6 @@ endif(NOT CMAKE_BUILD_TYPE)
 
 message(STATUS "FreeDV version: ${FREEDV_VERSION}")
 
-#set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
-
 # Work around for not using a svn working copy.
 add_definitions(-DSVN_REVISION="Unversioned directory")
 add_definitions(-D_NO_AUTOTOOLS_)
@@ -67,11 +65,13 @@ set(USE_STATIC_CODEC2 FALSE CACHE BOOL
     "Download and build static codec2 instead of the system library.")
 set(BOOTSTRAP_WXWIDGETS FALSE CACHE BOOL
     "Download and build static wxWidgets instead of the system library.")
-set(USE_STATIC_WXWIDGETS FALSE CACHE BOOL
-    "Perform bootstrap build of wxWidgets, see README.cmake for more details.")
 # If we're bootstrapping wxWidgets then this must be set true.
 if(BOOTSTRAP_WXWIDGETS)
-    set(USE_STATIC_WXWIDGETS TRUE)
+    set(USE_STATIC_WXWIDGETS TRUE CACHE BOOL
+    "Perform bootstrap build of wxWidgets, see README.cmake for more details.")
+else(BOOTSTRAP_WXWIDGETS)
+    set(USE_STATIC_WXWIDGETS FALSE CACHE BOOL
+    "Perform bootstrap build of wxWidgets, see README.cmake for more details.")
 endif(BOOTSTRAP_WXWIDGETS)
 
 if(USE_STATIC_DEPS)
@@ -83,11 +83,23 @@ if(USE_STATIC_DEPS)
     set(USE_STATIC_CODEC2 TRUE FORCE)
 endif(USE_STATIC_DEPS)
 
+#
+# Pull in external wxWidgets target if performing static build.
+#
+if(BOOTSTRAP_WXWIDGETS)
+    include(cmake/BuildWxWidgets.cmake)
+endif(BOOTSTRAP_WXWIDGETS)
 
+#
+# Perform bootstrap build of wxWidgets
+#
+if(BOOTSTRAP_WXWIDGETS AND NOT TARGET wxWidgets)
+    message(STATUS "Will perform bootstrap build of wxWidgets.
+   After make step completes, re-run cmake and make again to perform FreeDV build.")
 #
 # Continue normal build if not bootstrapping wxWidgets or already built it.
 #
-if(NOT BOOTSTRAP_WXWIDGETS)
+else(BOOTSTRAP_WXWIDGETS AND NOT TARGET wxWidgets)
 
 # Setup empty list to append to.
 set(FREEDV_LINK_LIBS "")
@@ -326,7 +338,7 @@ set(WXRC "" CACHE FILEPATH "Location of wxrc binary.")
 if(USE_STATIC_WXWIDGETS)
     set(WXCONFIG "${CMAKE_BINARY_DIR}/external/dist/bin/wx-config")
     set(WXRC "${CMAKE_BINARY_DIR}/external/dist/bin/wxrc")
-    set(wxWidgets_CONFIG_OPTIONS --linkdeps)
+    #set(wxWidgets_CONFIG_OPTIONS --linkdeps)
     list(APPEND FREEDV_STATIC_DEPS wxWidgets)
 endif(USE_STATIC_WXWIDGETS)
 message(STATUS "Looking for wxWidgets...")
@@ -459,11 +471,4 @@ if(WIN32)
     include(CPack)
 endif(WIN32)
 
-#
-# Perform bootstrap build of wxWidgets
-#
-else(NOT BOOTSTRAP_WXWIDGETS)
-    message(STATUS "Will perform bootstrap build of wxWidgets.
-After make step completes, re-run cmake and make to perform FreeDV build.")
-    include(cmake/BuildWxWidgets.cmake)
-endif(NOT BOOTSTRAP_WXWIDGETS)
+endif(BOOTSTRAP_WXWIDGETS AND NOT TARGET wxWidgets)
index 6b7fb97eb113a6c7c1af52b47c757e41f86e76f0..2848648c1e6bd877a66b9b165559519156d2135e 100644 (file)
@@ -4,16 +4,17 @@ well on most *nix systems and has many advanages over the autotools config.
 
 - Builds against system libraries (by default).
 - Or optionally download, build, and statically link with required libraries on
-  an individual basis. See USE_STATIC_??? options.
+  an individual basis. See USE_STATIC_??? options. 
+  NOTE: We need test reports on mingw/Windows, not all dependencies will build.
 - Has experimental NSIS packaing support for Windows (WIN32) targets. *nix
-  systems should rely on 'make install' as the packages (RPM & DEB) created by
-  CPack are questionable.
+  systems should rely on 'make install' or tradional packaing methods as the
+  packages (RPM & DEB) created by CPack are questionable.
 
-==========================
- Building and installing
-==========================
+==================================
+ Building and installing on Linux
+==================================
 
-    To test the cmake build make a directory anywhere underneath (or outside of)
+To perform a cmake build create a directory anywhere underneath (or outside of)
 the source directory.
 
 Linux command line example:
@@ -27,6 +28,20 @@ $ make
 (as root)
 $ make install
 
+====================================
+ Building and installing on Windows
+====================================
+
+The windows build is similar to linux and follows the same basic workflow.
+
+Only MinGW is supported. While it is likely possible to perform a pure MinGW
+build, installing MSYS will make your life easier.
+
+CMake may not automatically detect that you're in the MSYS environment. If this
+occurs you need to pass cmake the proper generator:
+
+cmake -G"MSYS Makefiles" [other options] </path/to/source>
+
 ===============================
  Bootstrapping wxWidgets build
 ===============================
@@ -40,16 +55,17 @@ normally done at configure time, not during "make", it is not possible for CMake
 to have this information prior to building wxWidgets.
 
 In order to work around this issue you can "bootstrap" the wxWidgets build using
-the CMake "BOOTSTRAP_WXWIDGETS" option. wxWidgets will be built using static 
+the CMake option, "BOOTSTRAP_WXWIDGETS". wxWidgets will be built using static 
 libraries.
 
-NOTE: This forces "USE_STATIC_WXWIDGETS" to be true.
+NOTE: This forces "USE_STATIC_WXWIDGETS" to be true internally regarless of the
+value set manually.
 
 (from any prefered directory outside of the source)
 $ cmake -DBOOTSTRAP_WXWIDGETS=TRUE <path to source>
 $ make
 (wxWidgets is downloaded and built)
-$ cmake -DBOOTSTRAP_WXWIDGETS=FALSE .
+$ cmake .
 $ make
 (if all goes well, as root)
 $ make install
index c75fef2d2da81618156bfd691da792706b75f68b..89d115610936012c69290f50b58feece8d24a7ee 100644 (file)
@@ -2,6 +2,7 @@ README.txt for FDMDV2
 \r
 README.Win32 contains instructions for building on Windows.\r
 README.linux contains instructions for building on Linux.\r
+README.cmake contains instructions for building on Windows or Linux using cmake.\r
 \r
 Editing\r
 -------\r
index c610168acce093a5eb9dd4da7de21ea8b4429b93..15aa7b2c1c19c42f599e6cd4329119462026823a 100644 (file)
@@ -1,5 +1,16 @@
 set(PORTAUDIO_TARBALL "pa_stable_v19_20111121")
 
+# required linking libraries on linux. Not sure about windows.
+find_library(ALSA_LIBRARIES asound)
+
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library which is required for portaudio.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif(UNIX AND NOT ALSA_LIBRARIES)
+
 include(ExternalProject)
 ExternalProject_Add(portaudio
     URL http://www.portaudio.com/archives/${PORTAUDIO_TARBALL}.tgz
@@ -16,6 +27,7 @@ else(WIN32)
     find_library(ASOUND asound)
     set(PORTAUDIO_LIBRARIES
         ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudio.a
+        ${CMAKE_BINARY_DIR}/external/dist/lib/libportaudiocpp.a
         ${RT}
         ${ASOUND}
     )
index 58265413c56e4d9369d299254d793d07bae5a6bc..c5b13364ed4656b898d67735488ddcf907547190 100644 (file)
@@ -5,7 +5,7 @@ ExternalProject_Add(sndfile
     URL http://www.mega-nerd.com/libsndfile/files/${SNDFILE_TARBALL}.tar.gz
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist
+    CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/dist --disable-external-libs
     BUILD_COMMAND $(MAKE)
     INSTALL_COMMAND $(MAKE) install
 )
index 535b538099cbd14b552c39ec8e2dee3c9d31969f..8dae3adf6dc76f2489d68dff8d6d454dcfa0bf6f 100644 (file)
@@ -4,12 +4,29 @@ set(SOX_TARBALL "sox-14.4.1")
 find_library(ALSA_LIBRARIES asound)
 find_library(AO_LIBRARIES ao)
 
+if(UNIX AND NOT ALSA_LIBRARIES)
+    message(ERROR "Could not find alsa library.
+On Linux systems try installing:
+    alsa-lib-devel  (RPM based systems)
+    libasound2-dev  (DEB based systems)"
+    )
+endif(UNIX AND NOT ALSA_LIBRARIES)
+
+if(UNIX AND NOT AO_LIBRARIES)
+    message(ERROR "Could not find libao.
+On Linux systems try installing:
+    libao-devel  (RPM based systems)
+    libao-dev    (DEB based systems)"
+    )
+endif(UNIX AND NOT AO_LIBRARIES)
+
+
 include(ExternalProject)
 ExternalProject_Add(sox
     URL http://downloads.sourceforge.net/sox/${SOX_TARBALL}.tar.gz
     BUILD_IN_SOURCE 1
     INSTALL_DIR external/dist
-    CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --prefix=${CMAKE_BINARY_DIR}/external/dist
+    CONFIGURE_COMMAND ./configure --enable-shared=no --without-id3tag --without-png --disable-gomp --with-oggvorbis=no --with-oss=no --with-flac=no --with-amrnb=no --with-amrwb=no --with-mp3=no --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --prefix=${CMAKE_BINARY_DIR}/external/dist
     BUILD_COMMAND $(MAKE)
     INSTALL_COMMAND $(MAKE) install
 )