include(cmake/BuildSamplerate.cmake)
endif(NOT USE_STATIC_SAMPLERATE)
-#
-# sndfile Library
-#
-if(NOT USE_STATIC_SNDFILE)
- message(STATUS "Looking for sndfile...")
- find_library(LIBSNDFILE sndfile)
- find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
- message(STATUS " sndfile library: ${LIBSNDFILE}")
- message(STATUS " sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
- if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
- list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
- else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
- message(FATAL_ERROR "sndfile library not found.
-On Linux systems try installing:
- libsndfile-devel (RPM based systems)
- libsndfile-dev (DEB based systems)
-On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
- )
- endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
-else(NOT USE_STATIC_SNDFILE)
- message(STATUS "Will attempt static build of sndfile.")
- include(cmake/BuildSndfile.cmake)
-endif(NOT USE_STATIC_SNDFILE)
-
#
# Find sox library
#
include(cmake/BuildSox.cmake)
endif(NOT USE_STATIC_SOX)
+#
+# sndfile Library
+#
+if(NOT USE_STATIC_SNDFILE)
+ message(STATUS "Looking for sndfile...")
+ find_library(LIBSNDFILE sndfile)
+ find_path(LIBSNDFILE_INCLUDE_DIR sndfile.h)
+ message(STATUS " sndfile library: ${LIBSNDFILE}")
+ message(STATUS " sndfile headers: ${LIBSNDFILE_INCLUDE_DIR}")
+ if(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+ list(APPEND FREEDV_LINK_LIBS ${LIBSNDFILE})
+ else(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+ message(FATAL_ERROR "sndfile library not found.
+On Linux systems try installing:
+ libsndfile-devel (RPM based systems)
+ libsndfile-dev (DEB based systems)
+On Windows it's easiest to use the cmake option: USE_STATIC_SNDFILE"
+ )
+ endif(LIBSNDFILE AND LIBSNDFILE_INCLUDE_DIR)
+else(NOT USE_STATIC_SNDFILE)
+ message(STATUS "Will attempt static build of sndfile.")
+ include(cmake/BuildSndfile.cmake)
+endif(NOT USE_STATIC_SNDFILE)
+
#
# Find wxWidgets
#
)
endif(UNIX AND NOT AO_LIBRARIES)
-# For some reason libsox is not linked against linsndfile. We workaround it
-# here but need to know if we're using the system provided library or not.
-#if(USE_STATIC_SNDFILE)
-# # Use known location of internal build.
-# set(SNDFILE_LIB ${SNDFILE_LIBRARIES})
-#else()
-# # Use found system library.
-# set(SNDFILE_LIB ${LIBSNDFILE})
-#endif()
-
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 --with-wavpack=no --disable-dl-sndfile --with-pulseaudio=no --without-magic --prefix=${CMAKE_BINARY_DIR}/external/dist
- BUILD_COMMAND $(MAKE) V=1 LIBS=${SNDFILE_LIB}
+ BUILD_COMMAND $(MAKE) V=1
INSTALL_COMMAND $(MAKE) install
)
set(SOX_LIBRARIES ${CMAKE_BINARY_DIR}/external/dist/lib/libsox.a)
set(WXWIDGETS_TARBALL "wxWidgets-3.0.2")
-# If we're crosscompiling then we need to set the target hose correctly.
+# 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)
endif()
endif()
+# If not cross-compiling then use the built-in makefile, otherwise use standard configure.
if(MINGW AND NOT CMAKE_CROSSCOMPILING)
- set(CONFIGURE_COMMAND mingw32-make -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+# set(CONFIGURE_COMMAND "true")
+# set(MAKE_COMMAND $(MAKE) -C build/msw -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release PREFIX=${CMAKE_BINARY_DIR}/external/dist)
+ set(CONFIGURE_COMMAND ./configure --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+ set(MAKE_COMMAND $(MAKE))
else()
set(CONFIGURE_COMMAND ./configure --host=${HOST} --target=${HOST} --disable-shared --prefix=${CMAKE_BINARY_DIR}/external/dist)
+ set(MAKE_COMMAND $(MAKE))
endif()
include(ExternalProject)
BUILD_IN_SOURCE 1
INSTALL_DIR external/dist
CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
- BUILD_COMMAND $(MAKE)
+ BUILD_COMMAND ${MAKE_COMMAND}
INSTALL_COMMAND $(MAKE) install
)