diff --git a/cmake/Modules/AXBuildHelpers.cmake b/cmake/Modules/AXBuildHelpers.cmake index a398652e90f4..a1e8c29152c7 100644 --- a/cmake/Modules/AXBuildHelpers.cmake +++ b/cmake/Modules/AXBuildHelpers.cmake @@ -207,6 +207,14 @@ function(ax_copy_target_dll ax_target) $) endif() endif() + + # copy libvlc plugins dir for windows + if(AX_ENABLE_VLC_MEDIA) + add_custom_command(TARGET ${ax_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${_AX_ROOT_PATH}/${_AX_THIRDPARTY_NAME}/vlc/win/lib/vlc/plugins + $/plugins + ) + endif() endfunction() function(ax_copy_lua_dlls ax_target) diff --git a/thirdparty/vlc/CMakeLists.txt b/thirdparty/vlc/CMakeLists.txt index 2a89ee906ac0..c4b9f3b0b4a8 100644 --- a/thirdparty/vlc/CMakeLists.txt +++ b/thirdparty/vlc/CMakeLists.txt @@ -5,6 +5,15 @@ project(${lib_name}) include(AXPlatform) +if (NOT (IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${platform_name}")) + if (NOT EXISTS libvlc-dev-${platform_name}.zip) + message(STATUS "Downloading libvlc-dev-${platform_name}.zip ...") + file(DOWNLOAD https://github.com/halx99/build-vlc/releases/download/v3.0.18/libvlc-dev-${platform_name}.zip ${CMAKE_CURRENT_LIST_DIR}/libvlc-dev-${platform_name}.zip) + endif() + file(ARCHIVE_EXTRACT INPUT ${CMAKE_CURRENT_LIST_DIR}/libvlc-dev-${platform_name}.zip DESTINATION ${CMAKE_CURRENT_LIST_DIR}/) + file(RENAME ${CMAKE_CURRENT_LIST_DIR}/libvlc-dev-${platform_name} ${CMAKE_CURRENT_LIST_DIR}/${platform_name}) +endif() + # -----macro: set vlc sub target----- macro(set_vlc_sub_target sub_target_name sub_lib_name) add_library(${sub_target_name} SHARED IMPORTED GLOBAL) @@ -20,8 +29,8 @@ macro(set_vlc_sub_target sub_target_name sub_lib_name) ) elseif(WINDOWS) set_target_properties(${sub_target_name} PROPERTIES - IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/${platform_name}/lib/lib${sub_lib_name}.dll" - IMPORTED_IMPLIB "${CMAKE_CURRENT_LIST_DIR}/${platform_name}/lib/lib${sub_lib_name}.lib" + IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/${platform_name}/bin/lib${sub_lib_name}.dll" + IMPORTED_IMPLIB "${CMAKE_CURRENT_LIST_DIR}/${platform_name}/lib/lib${sub_lib_name}.dll.a" ) endif() endmacro()