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_)
"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)
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 "")
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...")
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)
- 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:
(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
===============================
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
\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
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
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}
)
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
)
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
)