Commit 366dd714 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Include a single copy of the FFmpeg libraries in the Python packages on Linux.

parent 4539ff3b
......@@ -93,13 +93,27 @@ if(WIN32)
list(APPEND _BUILDS "exe" "msi" "zip" "wheel")
endif()
if(UNIX AND NOT APPLE)
file(GLOB LINPHONE_DYNAMIC_LIBRARIES "${CMAKE_INSTALL_PREFIX}/lib/*.so*")
set(LINPHONE_DYNAMIC_LIBRARIES
"${CMAKE_INSTALL_PREFIX}/lib/libavcodec.so.53"
"${CMAKE_INSTALL_PREFIX}/lib/libavutil.so.51"
"${CMAKE_INSTALL_PREFIX}/lib/libswscale.so.2"
)
list(APPEND _BUILDS "zip" "wheel")
endif()
foreach(_BUILD ${_BUILDS})
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.cmake" "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone/__init__.py")
file(COPY ${LINPHONE_DYNAMIC_LIBRARIES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone")
if(UNIX AND NOT APPLE)
foreach(lib ${LINPHONE_DYNAMIC_LIBRARIES})
get_filename_component(libname ${lib} NAME)
file(GLOB reallib "${lib}.*")
get_filename_component(reallibname ${reallib} NAME)
file(COPY ${reallib} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone")
file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone/${reallibname}" "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone/${libname}")
endforeach()
else()
file(COPY ${LINPHONE_DYNAMIC_LIBRARIES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone")
endif()
if(MSVC AND NOT "${MSVC_VERSION}" STREQUAL "9")
file(COPY ${MSVCR_LIB} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/build_${_BUILD}/linphone/linphone")
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment