diff --git a/CMakeLists.txt b/CMakeLists.txt index b4ba2f93..3cfbe617 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.24) +# Use cmake scripts provided by boost, not the cmake itself +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30.0") + cmake_policy(SET CMP0167 NEW) +endif() + project( beefweb VERSION 0.11 @@ -35,9 +40,9 @@ local_library_option(catch ENABLE_LOCAL_CATCH "ENABLE_TESTS") local_library_option(stringencoders ENABLE_LOCAL_STRINGENCODERS "") if(OS_POSIX) - if(NOT OS_MAC) - option(ENABLE_STATIC_STDLIB "Build with static libstdc++" OFF) - endif() + if(NOT OS_MAC) + option(ENABLE_STATIC_STDLIB "Build with static libstdc++" OFF) + endif() option(ENABLE_DEADBEEF "Build plugin for deadbeef player" ON) option( diff --git a/cpp/extlibs/catch/CMakeLists.txt b/cpp/extlibs/catch/CMakeLists.txt index bc1b08aa..3cd94c6c 100644 --- a/cpp/extlibs/catch/CMakeLists.txt +++ b/cpp/extlibs/catch/CMakeLists.txt @@ -14,7 +14,7 @@ ExternalProject_Add( CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND - ${CMAKE_COMMAND} -E copy_if_different ${EXTLIB_INSTALL_DIR}/include/catch.hpp + ${CMAKE_COMMAND} -E copy_if_different ${EXTLIB_INSTALL_DIR}/include/catch2/catch.hpp LOG_DOWNLOAD 0 LOG_UPDATE 0 LOG_CONFIGURE 0 LOG_BUILD 0 LOG_INSTALL 1 ) diff --git a/cpp/extlibs/catch/system/FindCatch.cmake b/cpp/extlibs/catch/system/FindCatch.cmake index 8302b70a..7fa24768 100644 --- a/cpp/extlibs/catch/system/FindCatch.cmake +++ b/cpp/extlibs/catch/system/FindCatch.cmake @@ -1,13 +1,13 @@ find_path( CATCH_INCLUDE_DIRS - NAMES catch.hpp - DOC "catch include directory" + NAMES catch2/catch.hpp + DOC "catch2 include directory" ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - CATCH REQUIRED_VARS CATCH_INCLUDE_DIRS + Catch REQUIRED_VARS CATCH_INCLUDE_DIRS ) mark_as_advanced(CATCH_INCLUDE_DIRS) diff --git a/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake b/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake index 3ac66387..c39faf0e 100644 --- a/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake +++ b/cpp/extlibs/deadbeef/local/FindDeadbeef.cmake @@ -1 +1,2 @@ +set(DEADBEEF_ARTWORK_LEGACY ON) set(DEADBEEF_INCLUDE_DIRS ${EXTLIB_INSTALL_DIR}/include) diff --git a/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake b/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake index 1deb8e45..f486d17b 100644 --- a/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake +++ b/cpp/extlibs/deadbeef/system/FindDeadbeef.cmake @@ -1,3 +1,5 @@ +set(DEADBEEF_ARTWORK_LEGACY OFF) + find_path( DEADBEEF_INCLUDE_DIRS NAMES deadbeef/deadbeef.h @@ -8,7 +10,7 @@ find_path( include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - DEADBEEF REQUIRED_VARS DEADBEEF_INCLUDE_DIRS + Deadbeef REQUIRED_VARS DEADBEEF_INCLUDE_DIRS ) mark_as_advanced(DEADBEEF_INCLUDE_DIRS) diff --git a/cpp/extlibs/nljson/system/FindNljson.cmake b/cpp/extlibs/nljson/system/FindNljson.cmake index ca06e92f..ce3bf0c0 100644 --- a/cpp/extlibs/nljson/system/FindNljson.cmake +++ b/cpp/extlibs/nljson/system/FindNljson.cmake @@ -1,13 +1,13 @@ find_path( NLJSON_INCLUDE_DIRS - NAMES nlohmann/json.h + NAMES nlohmann/json.hpp DOC "nlohmann json include directory" ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( - NLJSON REQUIRED_VARS NLJSON_INCLUDE_DIR + Nljson REQUIRED_VARS NLJSON_INCLUDE_DIRS ) mark_as_advanced(NLJSON_INCLUDE_DIRS) diff --git a/cpp/server/deadbeef/CMakeLists.txt b/cpp/server/deadbeef/CMakeLists.txt index 3c426a50..5c287bdb 100644 --- a/cpp/server/deadbeef/CMakeLists.txt +++ b/cpp/server/deadbeef/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories( set( PLUGIN_SOURCES add_items_scope.cpp add_items_scope.hpp - artwork_fetcher_v1.cpp artwork_fetcher_v2.cpp artwork_fetcher.hpp + artwork_fetcher_v2.cpp artwork_fetcher.hpp common.cpp common.hpp player.hpp player_control.cpp @@ -19,6 +19,16 @@ set( utils.cpp utils.hpp ) +if(DEADBEEF_ARTWORK_LEGACY) + add_definitions(-DDEADBEEF_ARTWORK_LEGACY) + + set( + PLUGIN_SOURCES + ${PLUGIN_SOURCES} + artwork_fetcher_v1.cpp + ) +endif() + add_library( deadbeef_plugin MODULE ${PLUGIN_SOURCES} diff --git a/cpp/server/deadbeef/artwork_fetcher.hpp b/cpp/server/deadbeef/artwork_fetcher.hpp index c35f32a1..5fd5280a 100644 --- a/cpp/server/deadbeef/artwork_fetcher.hpp +++ b/cpp/server/deadbeef/artwork_fetcher.hpp @@ -13,7 +13,10 @@ class ArtworkFetcher virtual boost::unique_future fetchArtwork(PlaylistPtr playlist, PlaylistItemPtr item) = 0; +#ifdef DEADBEEF_ARTWORK_LEGACY static std::unique_ptr createV1(); +#endif + static std::unique_ptr createV2(); }; diff --git a/cpp/server/deadbeef/player_misc.cpp b/cpp/server/deadbeef/player_misc.cpp index 2f02af52..b28df608 100644 --- a/cpp/server/deadbeef/player_misc.cpp +++ b/cpp/server/deadbeef/player_misc.cpp @@ -82,10 +82,12 @@ void PlayerImpl::connect() artworkFetcher_ = ArtworkFetcher::createV2(); +#ifdef DEADBEEF_ARTWORK_LEGACY if (!artworkFetcher_) { artworkFetcher_ = ArtworkFetcher::createV1(); } +#endif } void PlayerImpl::disconnect() diff --git a/cpp/server/tests/base64_tests.cpp b/cpp/server/tests/base64_tests.cpp index 515f0d45..b57a9816 100644 --- a/cpp/server/tests/base64_tests.cpp +++ b/cpp/server/tests/base64_tests.cpp @@ -1,6 +1,6 @@ #include "base64.hpp" -#include +#include namespace msrv { namespace base64_tests { diff --git a/cpp/server/tests/fnv_hash_tests.cpp b/cpp/server/tests/fnv_hash_tests.cpp index 46336149..b1b88657 100644 --- a/cpp/server/tests/fnv_hash_tests.cpp +++ b/cpp/server/tests/fnv_hash_tests.cpp @@ -1,6 +1,6 @@ #include "fnv_hash.hpp" -#include +#include namespace msrv { namespace fnv_hash_tests { diff --git a/cpp/server/tests/parsing_tests.cpp b/cpp/server/tests/parsing_tests.cpp index 0c5aa220..19bfe007 100644 --- a/cpp/server/tests/parsing_tests.cpp +++ b/cpp/server/tests/parsing_tests.cpp @@ -1,6 +1,6 @@ #include "parsing.hpp" -#include +#include namespace msrv { namespace base64_tests { diff --git a/cpp/server/tests/router_tests.cpp b/cpp/server/tests/router_tests.cpp index 24980253..d53f3560 100644 --- a/cpp/server/tests/router_tests.cpp +++ b/cpp/server/tests/router_tests.cpp @@ -1,6 +1,6 @@ #include "router.hpp" -#include +#include namespace msrv { namespace router_tests { diff --git a/cpp/server/tests/runner.cpp b/cpp/server/tests/runner.cpp index 09ef9404..3ecd3450 100644 --- a/cpp/server/tests/runner.cpp +++ b/cpp/server/tests/runner.cpp @@ -1,7 +1,7 @@ #include "test_main.hpp" #define CATCH_CONFIG_RUNNER -#include "catch.hpp" +#include namespace msrv { diff --git a/cpp/server/tests/server_tests.cpp b/cpp/server/tests/server_tests.cpp index a4db6630..e3400f49 100644 --- a/cpp/server/tests/server_tests.cpp +++ b/cpp/server/tests/server_tests.cpp @@ -5,7 +5,7 @@ #include "settings.hpp" #include "project_info.hpp" -#include +#include #include namespace msrv { diff --git a/cpp/server/tests/string_utils_tests.cpp b/cpp/server/tests/string_utils_tests.cpp index 132cb28d..15044321 100644 --- a/cpp/server/tests/string_utils_tests.cpp +++ b/cpp/server/tests/string_utils_tests.cpp @@ -1,6 +1,6 @@ #include "string_utils.hpp" -#include +#include namespace msrv::string_utils_tests { diff --git a/cpp/server/tests/timers_tests.cpp b/cpp/server/tests/timers_tests.cpp index 09647ee3..277682a6 100644 --- a/cpp/server/tests/timers_tests.cpp +++ b/cpp/server/tests/timers_tests.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace msrv { namespace timers_tests {