Permalink
Browse files

Merge pull request #7286 from orbea/cubeb

cmake: Support shared cubeb builds.
  • Loading branch information...
lioncash committed Aug 8, 2018
2 parents 9cd7dfc + 227807d commit 7be818a354aa3d0a0f4d9786c413032da36d5568
Showing with 22 additions and 1 deletion.
  1. +15 −0 CMake/FindCubeb.cmake
  2. +7 −1 CMakeLists.txt
View
@@ -0,0 +1,15 @@
find_path(CUBEB_INCLUDE_DIR cubeb.h PATH_SUFFIXES cubeb)
find_library(CUBEB_LIBRARY cubeb)
mark_as_advanced(CUBEB_INCLUDE_DIR CUBEB_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUBEB DEFAULT_MSG
CUBEB_INCLUDE_DIR CUBEB_LIBRARY)
if(CUBEB_FOUND AND NOT TARGET CUBEB)
add_library(cubeb::cubeb UNKNOWN IMPORTED)
set_target_properties(cubeb::cubeb PROPERTIES
IMPORTED_LOCATION "${CUBEB_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CUBEB_INCLUDE_DIR}"
)
endif()
View
@@ -611,7 +611,13 @@ endif()
add_subdirectory(Externals/soundtouch)
include_directories(Externals)
add_subdirectory(Externals/cubeb EXCLUDE_FROM_ALL)
find_package(Cubeb)
if(CUBEB_FOUND)
message(STATUS "Using the system cubeb")
else()
message(STATUS "Using static cubeb from Externals")
add_subdirectory(Externals/cubeb EXCLUDE_FROM_ALL)
endif()
if(NOT ANDROID)
add_definitions(-D__LIBUSB__)

0 comments on commit 7be818a

Please sign in to comment.