diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-05-05 09:25:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 09:25:32 +0200 |
commit | 2384465fab889004d38e0ddd593d68eb23c9a5e8 (patch) | |
tree | df2f1a8e1d40260710f7447289a41c44458f49b3 /CMakeLists.txt | |
parent | 212b1988402b810d92d9049966b4a6008ded2d1f (diff) | |
parent | f7b1ae2bd8dc289bce60c9637e0e924ee1c96407 (diff) |
Merge pull request #2714 from daschuer/lp1875013
Add the fallback to the internal libShout to cmake as well
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bd4a74a2d1..013ece6483 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1884,11 +1884,29 @@ if(LILV) endif() # Live Broadcasting (Shoutcast) -find_package(Shout) -cmake_dependent_option(BROADCAST "Live Broadcasting (Shoutcast) support" ON "Shout_FOUND" OFF) +option(BROADCAST "Live Broadcasting (Shoutcast) support" ON) if(BROADCAST) - if(NOT Shout_FOUND) + find_package(Shout) + if(UNIX AND NOT APPLE) + # Check if system lib is at least 2.4.4 and not suffering bug + # https://bugs.launchpad.net/mixxx/+bug/1833225 + if(Shout_FOUND AND Shout_VERSION VERSION_LESS 2.4.4) + message(STATUS "Installed libshout version is suffering from bug lp1833225") + endif() + if(NOT Shout_FOUND OR Shout_VERSION VERSION_LESS 2.4.4) + # Fall back to internal libraray in the lib tree + message(STATUS "Using internal libshout") + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout") + target_include_directories(mixxx-lib PUBLIC lib/libshout/include) + target_link_libraries(mixxx-lib PUBLIC shout_mixxx) + else() + target_link_libraries(mixxx-lib PUBLIC Shout::Shout) + endif() + else() + if(NOT Shout_FOUND) message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") + endif() + target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() target_sources(mixxx-lib PRIVATE src/preferences/dialog/dlgprefbroadcastdlg.ui @@ -1897,7 +1915,6 @@ if(BROADCAST) src/engine/sidechain/shoutconnection.cpp ) target_compile_definitions(mixxx-lib PUBLIC __BROADCAST__) - target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() # Locale Aware Compare for SQLite |