summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2019-09-08 17:24:11 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2019-10-24 18:55:01 +0200
commit1b5aa7b97a8ac4fd29cb6370791eb9640c43c700 (patch)
treeed31bb9f136bdba8fa97426c092fb64d0d9c34aa /cmake
parent34878bccbb58e7b35bdeaa298c4e8c988f189ef2 (diff)
CMake: Add initial CMakeLists.txt
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindChromaprint.cmake85
-rw-r--r--cmake/modules/FindFLAC.cmake84
-rw-r--r--cmake/modules/FindHIDAPI.cmake85
-rw-r--r--cmake/modules/FindLAME.cmake75
-rw-r--r--cmake/modules/FindOggVorbis.cmake89
-rw-r--r--cmake/modules/FindPortAudio.cmake52
-rw-r--r--cmake/modules/FindPortMidi.cmake77
-rw-r--r--cmake/modules/FindRubberband.cmake84
-rw-r--r--cmake/modules/FindSndFile.cmake85
-rw-r--r--cmake/modules/FindTaglib.cmake133
-rw-r--r--cmake/modules/FindUpower.cmake85
-rw-r--r--cmake/modules/Findffmpeg.cmake84
12 files changed, 1018 insertions, 0 deletions
diff --git a/cmake/modules/FindChromaprint.cmake b/cmake/modules/FindChromaprint.cmake
new file mode 100644
index 0000000000..fe13ff921b
--- /dev/null
+++ b/cmake/modules/FindChromaprint.cmake
@@ -0,0 +1,85 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindChromaprint
+---------------
+
+Finds the Chromaprint library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``Chromaprint::Chromaprint``
+ The Chromaprint library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``Chromaprint_FOUND``
+ True if the system has the Chromaprint library.
+``Chromaprint_INCLUDE_DIRS``
+ Include directories needed to use Chromaprint.
+``Chromaprint_LIBRARIES``
+ Libraries needed to link to Chromaprint.
+``Chromaprint_DEFINITIONS``
+ Compile defitions needed to use Chromaprint.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Chromaprint_INCLUDE_DIR``
+ The directory containing ``chromaprint.h``.
+``Chromaprint_LIBRARY``
+ The path to the Chromaprint library.
+
+#]=======================================================================]
+
+find_package(PkgConfig)
+pkg_check_modules(PC_CHROMAPRINT QUIET libchromaprint)
+
+find_path(Chromaprint_INCLUDE_DIR
+ NAMES chromaprint.h
+ PATHS ${PC_Chromaprint_INCLUDE_DIRS}
+ PATH_SUFFIXES chromaprint
+ DOC "Chromaprint include directory")
+mark_as_advanced(Chromaprint_INCLUDE_DIR)
+
+find_library(Chromaprint_LIBRARY
+ NAMES chromaprint
+ PATHS ${PC_Chromaprint_LIBRARY_DIRS}
+ DOC "Chromaprint library"
+)
+mark_as_advanced(Chromaprint_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ Chromaprint
+ DEFAULT_MSG
+ Chromaprint_LIBRARY
+ Chromaprint_INCLUDE_DIR
+)
+
+if(Chromaprint_FOUND)
+ set(Chromaprint_LIBRARIES "${Chromaprint_LIBRARY}")
+ set(Chromaprint_INCLUDE_DIRS "${Chromaprint_INCLUDE_DIR}")
+ set(Chromaprint_DEFINITIONS ${PC_Chromaprint_CFLAGS_OTHER})
+
+ if(NOT TARGET Chromaprint::Chromaprint)
+ add_library(Chromaprint::Chromaprint UNKNOWN IMPORTED)
+ set_target_properties(Chromaprint::Chromaprint
+ PROPERTIES
+ IMPORTED_LOCATION "${Chromaprint_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_Chromaprint_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Chromaprint_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/FindFLAC.cmake b/cmake/modules/FindFLAC.cmake
new file mode 100644
index 0000000000..09d16343d5
--- /dev/null
+++ b/cmake/modules/FindFLAC.cmake
@@ -0,0 +1,84 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindFLAC
+--------
+
+Finds the FLAC library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``FLAC::FLAC``
+ The FLAC library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``FLAC_FOUND``
+ True if the system has the FLAC library.
+``FLAC_INCLUDE_DIRS``
+ Include directories needed to use FLAC.
+``FLAC_LIBRARIES``
+ Libraries needed to link to FLAC.
+``FLAC_DEFINITIONS``
+ Compile defitions needed to use FLAC.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``FLAC_INCLUDE_DIR``
+ The directory containing ``FLAC/all.h``.
+``FLAC_LIBRARY``
+ The path to the FLAC library.
+
+#]=======================================================================]
+
+find_package(PkgConfig)
+pkg_check_modules(PC_FLAC QUIET flac)
+
+find_path(FLAC_INCLUDE_DIR
+ NAMES FLAC/all.h
+ PATHS ${PC_FLAC_INCLUDE_DIRS}
+ DOC "FLAC include directory")
+mark_as_advanced(FLAC_INCLUDE_DIR)
+
+find_library(FLAC_LIBRARY
+ NAMES FLAC
+ PATHS ${PC_FLAC_LIBRARY_DIRS}
+ DOC "FLAC library"
+)
+mark_as_advanced(FLAC_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ FLAC
+ DEFAULT_MSG
+ FLAC_LIBRARY
+ FLAC_INCLUDE_DIR
+)
+
+if(FLAC_FOUND)
+ set(FLAC_LIBRARIES "${FLAC_LIBRARY}")
+ set(FLAC_INCLUDE_DIRS "${FLAC_INCLUDE_DIR}")
+ set(FLAC_DEFINITIONS ${PC_FLAC_CFLAGS_OTHER})
+
+ if(NOT TARGET FLAC::FLAC)
+ add_library(FLAC::FLAC UNKNOWN IMPORTED)
+ set_target_properties(FLAC::FLAC
+ PROPERTIES
+ IMPORTED_LOCATION "${FLAC_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_FLAC_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/FindHIDAPI.cmake b/cmake/modules/FindHIDAPI.cmake
new file mode 100644
index 0000000000..86e3ca6670
--- /dev/null
+++ b/cmake/modules/FindHIDAPI.cmake
@@ -0,0 +1,85 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindHIDAPI
+----------
+
+Finds the HIDAPI library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``HIDAPI::libusb``
+ The hidapi-libusb library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``HIDAPI_FOUND``
+ True if the system has the HIDAPI library.
+``HIDAPI_INCLUDE_DIRS``
+ Include directories needed to use HIDAPI.
+``HIDAPI_LIBRARIES``
+ Libraries needed to link to HIDAPI.
+``HIDAPI_DEFINITIONS``
+ Compile defitions needed to use HIDAPI.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``HIDAPI_INCLUDE_DIR``
+ The directory containing ``hidapi/hidapi.h``.
+``HIDAPI_LIBRARY``
+ The path to the hidapi-lbusb library.
+
+#]=======================================================================]
+
+find_package(PkgConfig)
+pkg_check_modules(PC_HIDAPI QUIET hidapi-libusb)
+
+find_path(HIDAPI_INCLUDE_DIR
+ NAMES hidapi.h
+ PATHS ${PC_HIDAPI_INCLUDE_DIRS}
+ PATH_SUFFIXES hidapi
+ DOC "HIDAPI include directory")
+mark_as_advanced(HIDAPI_INCLUDE_DIR)
+
+find_library(HIDAPI_LIBRARY
+ NAMES hidapi-libusb
+ PATHS ${PC_HIDAPI_LIBRARY_DIRS}
+ DOC "HIDAPI library"
+)
+mark_as_advanced(HIDAPI_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ HIDAPI
+ DEFAULT_MSG
+ HIDAPI_LIBRARY
+ HIDAPI_INCLUDE_DIR
+)
+
+if(HIDAPI_FOUND)
+ set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
+ set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
+ set(HIDAPI_DEFINITIONS ${PC_HIDAPI_CFLAGS_OTHER})
+
+ if(NOT TARGET HIDAPI::LibUSB)
+ add_library(HIDAPI::LibUSB UNKNOWN IMPORTED)
+ set_target_properties(HIDAPI::LibUSB
+ PROPERTIES
+ IMPORTED_LOCATION "${HIDAPI_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_HIDAPI_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${HIDAPI_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/FindLAME.cmake b/cmake/modules/FindLAME.cmake
new file mode 100644
index 0000000000..95e1ee453e
--- /dev/null
+++ b/cmake/modules/FindLAME.cmake
@@ -0,0 +1,75 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindLAME
+--------
+
+Finds the LAME library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``LAME::LAME``
+ The LAME library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``LAME_FOUND``
+ True if the system has the LAME library.
+``LAME_INCLUDE_DIRS``
+ Include directories needed to use LAME.
+``LAME_LIBRARIES``
+ Libraries needed to link to LAME.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LAME_INCLUDE_DIR``
+ The directory containing ``lame/lame.h``.
+``LAME_LIBRARY``
+ The path to the LAME library.
+
+#]=======================================================================]
+
+find_path(LAME_INCLUDE_DIR
+ NAMES lame/lame.h
+ DOC "LAME include directory")
+mark_as_advanced(LAME_INCLUDE_DIR)
+
+find_library(LAME_LIBRARY
+ NAMES mp3lame mp3lame-static
+ DOC "LAME library"
+)
+mark_as_advanced(LAME_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ LAME
+ DEFAULT_MSG
+ LAME_LIBRARY
+ LAME_INCLUDE_DIR
+)
+
+if(LAME_FOUND)
+ set(LAME_LIBRARIES "${LAME_LIBRARY}")
+ set(LAME_INCLUDE_DIRS "${LAME_INCLUDE_DIR}")
+
+ if(NOT TARGET LAME::LAME)
+ add_library(LAME::LAME UNKNOWN IMPORTED)
+ set_target_properties(LAME::LAME
+ PROPERTIES
+ IMPORTED_LOCATION "${LAME_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LAME_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/FindOggVorbis.cmake b/cmake/modules/FindOggVorbis.cmake
new file mode 100644
index 0000000000..82b7922bd9
--- /dev/null
+++ b/cmake/modules/FindOggVorbis.cmake
@@ -0,0 +1,89 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindOggVorbis
+---------------
+
+Finds the OggVorbis library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``OggVorbis_FOUND``
+ True if the system has the OggVorbis library.
+``OggVorbis_INCLUDE_DIRS``
+ Include directories needed to use OggVorbis.
+``OggVorbis_LIBRARIES``
+ Libraries needed to link to OggVorbis.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Ogg_INCLUDE_DIR``
+ The directory containing ``ogg/ogg.h``.
+``Ogg_LIBRARY``
+ The path to the OggVorbis library.
+``Vorbis_INCLUDE_DIR``
+ The directory containing ``vorbis/vorbisfile.h``.
+``Vorbis_LIBRARY``
+ The path to the vorbis library.
+``VorbisFile_LIBRARY``
+ The path to the vorbisfile library.
+``VorbisEnc_LIBRARY``
+ The path to the vorbisenc library.
+``Vorbis_LIBRARIES``
+ Libraries needed to link to vorbis.
+
+#]=======================================================================]
+find_path(Ogg_INCLUDE_DIR NAMES ogg/ogg.h DOC "Ogg include directory")
+mark_as_advanced(Ogg_INCLUDE_DIR)
+
+find_library(Ogg_LIBRARY NAMES ogg DOC "Ogg library")
+mark_as_advanced(Ogg_LIBRARY)
+
+find_path(Vorbis_INCLUDE_DIR
+ NAMES vorbis/vorbisfile.h
+ DOC "Vorbis include directory"
+)
+mark_as_advanced(Vorbis_INCLUDE_DIR)
+
+find_library(Vorbis_LIBRARY NAMES vorbis DOC "Vorbis library")
+mark_as_advanced(Vorbis_LIBRARY)
+
+find_library(VorbisFile_LIBRARY NAMES vorbisfile DOC "Vorbisfile library")
+mark_as_advanced(VorbisFile_LIBRARY)
+
+if(NOT MSVC)
+ find_library(VorbisEnc_LIBRARY NAMES vorbisenc DOC "Vorbisenc library")
+ mark_as_advanced(VorbisEnc_LIBRARY)
+ set(Vorbis_LIBRARIES
+ ${VorbisEnc_LIBRARY}
+ ${VorbisFile_LIBRARY}
+ ${Vorbis_LIBRARY}
+ )
+else()
+ set(Vorbis_LIBRARIES ${VorbisFile_LIBRARY} ${Vorbis_LIBRARY})
+endif()
+mark_as_advanced(Vorbis_LIBRARIES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ OggVorbis
+ REQUIRED_VARS
+ Ogg_INCLUDE_DIR
+ Vorbis_INCLUDE_DIR
+ Ogg_LIBRARY
+ Vorbis_LIBRARIES
+)
+
+if(OggVorbis_FOUND)
+ set(OggVorbis_LIBRARIES ${Ogg_LIBRARY} ${Vorbis_LIBRARIES})
+ set(OggVorbis_INCLUDE_DIRS ${Ogg_INCLUDE_DIR} ${Vorbis_INCLUDE_DIR})
+endif()
diff --git a/cmake/modules/FindPortAudio.cmake b/cmake/modules/FindPortAudio.cmake
new file mode 100644
index 0000000000..8aa17d4448
--- /dev/null
+++ b/cmake/modules/FindPortAudio.cmake
@@ -0,0 +1,52 @@
+# - Try to find Portaudio
+# Once done this will define
+#
+# PORTAUDIO_FOUND - system has Portaudio
+# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
+# PORTAUDIO_LIBRARIES - Link these to use Portaudio
+
+include(FindPkgConfig)
+pkg_check_modules(PC_PORTAUDIO portaudio-2.0)
+
+find_path(PORTAUDIO_INCLUDE_DIRS
+ NAMES
+ portaudio.h
+ PATHS
+ /usr/local/include
+ /usr/include
+ HINTS
+ ${PC_PORTAUDIO_INCLUDEDIR}
+)
+
+find_library(PORTAUDIO_LIBRARIES
+ NAMES
+ portaudio
+ PATHS
+ /usr/local/lib
+ /usr/lib
+ /usr/lib64
+ HINTS
+ ${PC_PORTAUDIO_LIBDIR}
+)
+
+mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+
+# Found PORTAUDIO, but it may be version 18 which is not acceptable.
+if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h)
+ include(CheckCXXSourceCompiles)
+ set(CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES})
+ set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
+ CHECK_CXX_SOURCE_COMPILES(
+ "#include <portaudio.h>\nPaDeviceIndex pa_find_device_by_name(const char *name); int main () {return 0;}"
+ PORTAUDIO2_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED})
+ unset(CMAKE_REQUIRED_INCLUDES_SAVED)
+ if(PORTAUDIO2_FOUND)
+ INCLUDE(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+ else(PORTAUDIO2_FOUND)
+ message(STATUS
+ " portaudio.h not compatible (requires API 2.0)")
+ set(PORTAUDIO_FOUND FALSE)
+ endif(PORTAUDIO2_FOUND)
+endif()
diff --git a/cmake/modules/FindPortMidi.cmake b/cmake/modules/FindPortMidi.cmake
new file mode 100644
index 0000000000..9f9b705664
--- /dev/null
+++ b/cmake/modules/FindPortMidi.cmake
@@ -0,0 +1,77 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindPortMidi
+---------------
+
+Finds the PortMidi library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``PortMidi_FOUND``
+ True if the system has the PortMidi library.
+``PortMidi_INCLUDE_DIRS``
+ Include directories needed to use PortMidi.
+``PortMidi_LIBRARIES``
+ Libraries needed to link to PortMidi.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``PortMidi_INCLUDE_DIR``
+ The directory containing ``portmidi.h``.
+``PortTime_INCLUDE_DIR``
+ The directory containing ``porttime.h``.
+``PortMidi_LIBRARY``
+ The path to the PortMidi library.
+``PortTime_LIBRARY``
+ The path to the PortTime library.
+
+#]=======================================================================]
+
+find_path(PortMidi_INCLUDE_DIR
+ NAMES portmidi.h
+ PATH_SUFFIXES portmidi
+ DOC "PortMidi include directory")
+mark_as_advanced(PortMidi_INCLUDE_DIR)
+
+find_path(PortTime_INCLUDE_DIR
+ NAMES porttime.h
+ PATH_SUFFIXES portmidi porttime
+ DOC "PortTime include directory")
+mark_as_advanced(PortTime_INCLUDE_DIR)
+
+find_library(PortMidi_LIBRARY
+ NAMES portmidi portmidi_s
+ DOC "PortMidi library"
+)
+mark_as_advanced(PortMidi_LIBRARY)
+
+find_library(PortTime_LIBRARY
+ NAMES porttime
+ DOC "PortTime library"
+)
+mark_as_advanced(PortTime_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ PortMidi
+ DEFAULT_MSG
+ PortMidi_LIBRARY
+ PortMidi_INCLUDE_DIR
+ PortTime_LIBRARY
+ PortTime_INCLUDE_DIR
+)
+
+if(PortMidi_FOUND)
+ set(PortMidi_LIBRARIES ${PortMidi_LIBRARY} ${PortTime_LIBRARY})
+ set(PortMidi_INCLUDE_DIRS ${PortMidi_INCLUDE_DIR} ${PortTime_INCLUDE_DIR})
+endif()
diff --git a/cmake/modules/FindRubberband.cmake b/cmake/modules/FindRubberband.cmake
new file mode 100644
index 0000000000..548cd4c0fb
--- /dev/null
+++ b/cmake/modules/FindRubberband.cmake
@@ -0,0 +1,84 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindRubberband
+--------------
+
+Finds the Rubberband library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``Rubberband::Rubberband``
+ The Rubberband library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``Rubberband_FOUND``
+ True if the system has the Rubberband library.
+``Rubberband_INCLUDE_DIRS``
+ Include directories needed to use Rubberband.
+``Rubberband_LIBRARIES``
+ Libraries needed to link to Rubberband.
+``Rubberband_DEFINITIONS``
+ Compile defitions needed to use Rubberband.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Rubberband_INCLUDE_DIR``
+ The directory containing ``rubberband/RubberBandStretcher.h``.
+``Rubberband_LIBRARY``
+ The path to the Rubberband library.
+
+#]=======================================================================]
+
+find_package(PkgConfig)
+pkg_check_modules(PC_Rubberband QUIET rubberband)
+
+find_path(Rubberband_INCLUDE_DIR
+ NAMES rubberband/RubberBandStretcher.h
+ PATHS ${PC_Rubberband_INCLUDE_DIRS}
+ DOC "Rubberband include directory")
+mark_as_advanced(Rubberband_INCLUDE_DIR)
+
+find_library(Rubberband_LIBRARY
+ NAMES rubberband
+ PATHS ${PC_Rubberband_LIBRARY_DIRS}
+ DOC "Rubberband library"
+)
+mark_as_advanced(Rubberband_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ Rubberband
+ DEFAULT_MSG
+ Rubberband_LIBRARY
+ Rubberband_INCLUDE_DIR
+)
+
+if(Rubberband_FOUND)
+ set(Rubberband_LIBRARIES "${Rubberband_LIBRARY}")
+ set(Rubberband_INCLUDE_DIRS "${Rubberband_INCLUDE_DIR}")
+ set(Rubberband_DEFINITIONS ${PC_Rubberband_CFLAGS_OTHER})
+
+ if(NOT TARGET Rubberband::Rubberband)
+ add_library(Rubberband::Rubberband UNKNOWN IMPORTED)
+ set_target_properties(Rubberband::Rubberband
+ PROPERTIES
+ IMPORTED_LOCATION "${Rubberband_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_Rubberband_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Rubberband_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/FindSndFile.cmake b/cmake/modules/FindSndFile.cmake
new file mode 100644
index 0000000000..843ae15633
--- /dev/null
+++ b/cmake/modules/FindSndFile.cmake
@@ -0,0 +1,85 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindSndFile
+-----------
+
+Finds the SndFile library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``SndFile::SndFile``
+ The SndFile library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``SndFile_FOUND``
+ True if the system has the SndFile library.
+``SndFile_INCLUDE_DIRS``
+ Include directories needed to use SndFile.
+``SndFile_LIBRARIES``
+ Libraries needed to link to SndFile.
+``SndFile_DEFINITIONS``
+ Compile defitions needed to use SndFile.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``SndFile_INCLUDE_DIR``
+ The directory containing ``sndfile.h``.
+``SndFile_LIBRARY``
+ The path to the SndFile library.
+
+#]=======================================================================]
+
+find_package(PkgConfig)
+pkg_check_modules(PC_SndFile QUIET sndfile)
+
+find_path(SndFile_INCLUDE_DIR
+ NAMES sndfile.h
+ PATHS ${PC_SndFile_INCLUDE_DIRS}
+ PATH_SUFFIXES sndfile
+ DOC "SndFile include directory")
+mark_as_advanced(SndFile_INCLUDE_DIR)
+
+find_library(SndFile_LIBRARY
+ NAMES sndfile sndfile-1
+ PATHS ${PC_SndFile_LIBRARY_DIRS}
+ DOC "SndFile library"
+)
+mark_as_advanced(SndFile_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ SndFile
+ DEFAULT_MSG
+ SndFile_LIBRARY
+ SndFile_INCLUDE_DIR
+)
+
+if(SndFile_FOUND)
+ set(SndFile_LIBRARIES "${SndFile_LIBRARY}")
+ set(SndFile_INCLUDE_DIRS "${SndFile_INCLUDE_DIR}")
+ set(SndFile_DEFINITIONS ${PC_SndFile_CFLAGS_OTHER})
+
+ if(NOT TARGET SndFile::SndFile)
+ add_library(SndFile::SndFile UNKNOWN IMPORTED)
+ set_target_properties(SndFile::SndFile
+ PROPERTIES
+ IMPORTED_LOCATION "${SndFile_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_SndFile_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/FindTaglib.cmake b/cmake/modules/FindTaglib.cmake
new file mode 100644
index 0000000000..958f0d02d2
--- /dev/null
+++ b/cmake/modules/FindTaglib.cmake
@@ -0,0 +1,133 @@
+# - Try to find the Taglib library
+# Once done this will define
+#
+# TAGLIB_FOUND - system has the taglib library
+# TAGLIB_CFLAGS - the taglib cflags
+# TAGLIB_LIBRARIES - The libraries needed to use taglib
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(NOT TAGLIB_MIN_VERSION)
+ set(TAGLIB_MIN_VERSION "1.7")
+endif()
+
+if(NOT WIN32)
+ find_program(TAGLIBCONFIG_EXECUTABLE
+ NAMES taglib-config
+ PATHS ${BIN_INSTALL_DIR}
+ )
+endif()
+
+#reset vars
+set(TAGLIB_LIBRARIES)
+set(TAGLIB_CFLAGS)
+
+# if taglib-config has been found
+if(TAGLIBCONFIG_EXECUTABLE)
+
+ exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION)
+
+ if(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
+ message(STATUS "TagLib version too old: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}")
+ set(TAGLIB_FOUND FALSE)
+ else()
+
+ exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES)
+
+ exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_CFLAGS)
+
+ if(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
+ set(TAGLIB_FOUND TRUE)
+ endif()
+
+ string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDE_DIRS "${TAGLIB_CFLAGS}")
+ string(SUBSTRING ${TAGLIB_INCLUDE_DIRS} 0 -1 TAGLIB_INCLUDE_DIRS) #we remove the initial ;
+endif()
+
+mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES)
+
+else()
+
+ find_path(TAGLIB_INCLUDE_DIRS
+ NAMES tag.h
+ PATH_SUFFIXES taglib
+ PATHS ${INCLUDE_INSTALL_DIR}
+ )
+
+ if(NOT WIN32)
+ # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX
+ find_library(TAGLIB_LIBRARIES tag PATHS ${LIB_INSTALL_DIR})
+
+ else()
+
+ # 1. get all possible libnames
+ set(args PATHS ${LIB_INSTALL_DIR})
+ set(newargs "")
+ set(libnames_release "")
+ set(libnames_debug "")
+
+ list(LENGTH args listCount)
+
+ # just one name
+ list(APPEND libnames_release "tag")
+ list(APPEND libnames_debug "tagd")
+
+ set(newargs ${args})
+
+ # search the release lib
+ find_library(TAGLIB_LIBRARIES_RELEASE
+ NAMES ${libnames_release}
+ ${newargs}
+ )
+
+ # search the debug lib
+ find_library(TAGLIB_LIBRARIES_DEBUG
+ NAMES ${libnames_debug}
+ ${newargs}
+ )
+
+ if(TAGLIB_LIBRARIES_RELEASE AND TAGLIB_LIBRARIES_DEBUG)
+
+ # both libs found
+ set(TAGLIB_LIBRARIES optimized ${TAGLIB_LIBRARIES_RELEASE}
+ debug ${TAGLIB_LIBRARIES_DEBUG}
+ )
+
+ else()
+
+ if(TAGLIB_LIBRARIES_RELEASE)
+ # only release found
+ set(TAGLIB_LIBRARIES ${TAGLIB_LIBRARIES_RELEASE})
+
+ else()
+ # only debug (or nothing) found
+ set(TAGLIB_LIBRARIES ${TAGLIB_LIBRARIES_DEBUG})
+
+ endif()
+
+ endif()
+
+ mark_as_advanced(TAGLIB_LIBRARIES_RELEASE)
+ mark_as_advanced(TAGLIB_LIBRARIES_DEBUG)
+
+ endif()
+
+ include(FindPackageMessage)
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Taglib DEFAULT_MSG TAGLIB_INCLUDE_DIRS_ TAGLIB_LIBRARIES)
+
+endif()
+
+
+if(TAGLIB_FOUND)
+ if(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
+ message(STATUS "Taglib found: ${TAGLIB_LIBRARIES}")
+ endif()
+else()
+ if(Taglib_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Taglib")
+ endif()
+endif()
diff --git a/cmake/modules/FindUpower.cmake b/cmake/modules/FindUpower.cmake
new file mode 100644
index 0000000000..4d7b91aa9c
--- /dev/null
+++ b/cmake/modules/FindUpower.cmake
@@ -0,0 +1,85 @@
+# This file is part of Mixxx, Digital DJ'ing software.
+# Copyright (C) 2001-2019 Mixxx Development Team
+# Distributed under the GNU General Public Licence (GPL) version 2 or any later
+# later version. See the LICENSE file for details.
+
+#[=======================================================================[.rst:
+FindUpower
+----------
+
+Finds the Upower library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following imported targets, if found:
+
+``Upower::Upower``
+ The Upower library
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``Upower_FOUND``
+ True if the system has the Upower library.
+``Upower_INCLUDE_DIRS``
+ Include directories needed to use Upower.
+``Upower_LIBRARIES``
+ Libraries needed to link to Upower.
+``Upower_DEFINITIONS``
+ Compile defitions needed to use Upower.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Upower_INCLUDE_DIR``
+ The directory containing ``libupower-glib/upower.h``.
+``Upower_LIBRARY``
+ The path to the Upower library.
+
+#]=======================================================================]
+
+find_package(PkgConfig)
+pkg_check_modules(PC_Upower QUIET upower-glib)
+
+find_path(Upower_INCLUDE_DIR
+ NAMES upower.h
+ PATH_SUFFIXES upower-glib libupower-glib
+ PATHS ${PC_Upower_INCLUDE_DIRS}
+ DOC "Upower include directory")
+mark_as_advanced(Upower_INCLUDE_DIR)
+
+find_library(Upower_LIBRARY
+ NAMES upower-glib
+ PATHS ${PC_Upower_LIBRARY_DIRS}
+ DOC "Upower library"
+)
+mark_as_advanced(Upower_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ Upower
+ DEFAULT_MSG
+ Upower_LIBRARY
+ Upower_INCLUDE_DIR
+)
+
+if(Upower_FOUND)
+ set(Upower_LIBRARIES "${Upower_LIBRARY}")
+ set(Upower_INCLUDE_DIRS "${Upower_INCLUDE_DIR}")
+ set(Upower_DEFINITIONS ${PC_Upower_CFLAGS_OTHER})
+
+ if(NOT TARGET Upower::Upower)
+ add_library(Upower::Upower UNKNOWN IMPORTED)
+ set_target_properties(Upower::Upower
+ PROPERTIES
+ IMPORTED_LOCATION "${Upower_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${PC_Upower_CFLAGS_OTHER}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Upower_INCLUDE_DIR}"
+ )
+ endif()
+endif()
diff --git a/cmake/modules/Findffmpeg.cmake b/cmake/modules/Findffmpeg.cmake
new file mode 100644
index 0000000000..52637a2b95
--- /dev/null
+++ b/cmake/modules/Findffmpeg.cmake
@@ -0,0 +1,84 @@
+# Copyright (c) 2014 Andrew Kelley
+# This file is MIT licensed.
+# See http://opensource.org/licenses/MIT
+
+# FFMPEG_FOUND
+# FFMPEG_INCLUDE_DIRS
+# FFMPEG_LIBRARIES
+
+# AVFILTER_FOUND
+# AVFILTER_INCLUDE_DIRS
+# AVFILTER_LIBRARIES
+
+# AVFORMAT_FOUND
+# AVFORMAT_INCLUDE_DIRS
+# AVFORMAT_LIBRARIES
+
+# AVCODEC_FOUND
+# AVCODEC_INCLUDE_DIRS
+# AVCODEC_LIBRARIES
+
+# AVUTIL_FOUND
+# AVUTIL_INCLUDE_DIRS
+# AVUTIL_LIBRARIES
+
+find_path(AVFILTER_INCLUDE_DIRS NAMES libavfilter/avfilter.h)
+find_library(AVFILTER_LIBRARIES NAMES avfilter)
+if(AVFILTER_LIBRARIES AND AVFILTER_INCLUDE_DIRS)
+ set(AVFILTER_FOUND TRUE)
+else()
+ set(AVFILTER_FOUND FALSE)
+endif()
+
+find_path(AVFORMAT_INCLUDE_DIRS NAMES libavformat/avformat.h)
+find_library(AVFORMAT_LIBRARIES NAMES avformat)
+if(AVFORMAT_LIBRARIES AND AVFORMAT_INCLUDE_DIRS)
+ set(AVFORMAT_FOUND TRUE)
+else()
+ set(AVFORMAT_FOUND FALSE)
+endif()
+
+find_path(AVCODEC_INCLUDE_DIRS NAMES libavcodec/avcodec.h)
+find_library(AVCODEC_LIBRARIES NAMES avcodec)
+if(AVCODEC_LIBRARIES AND AVCODEC_INCLUDE_DIRS)
+ set(AVCODEC_FOUND TRUE)
+else()
+ set(AVCODEC_FOUND FALSE)
+endif()
+
+find_path(AVUTIL_INCLUDE_DIRS NAMES libavutil/avutil.h)
+find_library(AVUTIL_LIBRARIES NAMES avutil)
+if(AVUTIL_LIBRARIES AND AVUTIL_INCLUDE_DIRS)
+ set(AVUTIL_FOUND TRUE)
+else()
+ set(AVUTIL_FOUND FALSE)
+endif()
+
+if(AVFILTER_FOUND AND AVFORMAT_FOUND AND AVCODEC_FOUND AND AVUTIL_FOUND)
+ set(FFMPEG_FOUND TRUE)
+ set(FFMPEG_INCLUDE_DIRS
+ ${AVFILTER_INCLUDE_DIRS}
+ ${AVFORMAT_INCLUDE_DIRS}
+ ${AVCODEC_INCLUDE_DIRS}
+ ${AVUTIL_INCLUDE_DIRS})
+ set(FFMPEG_LIBRARIES
+ ${AVFILTER_LIBRARIES}
+ ${AVFORMAT_LIBRARIES}
+ ${AVCODEC_LIBRARIES}
+ ${AVUTIL_LIBRARIES})
+else()
+ set(FFMPEG_FOUND FALSE)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FFMPEG DEFAULT_MSG
+ AVFILTER_LIBRARIES AVFILTER_INCLUDE_DIRS