Fix Mediastreamer plugin loading[ci skip]

This commit is contained in:
Julien Wadel 2020-02-14 19:14:27 +01:00
parent 0d89be9cd9
commit 44041b5d94
2 changed files with 22 additions and 6 deletions

View file

@ -411,8 +411,15 @@ else()
# ------------------------------------------------------------------------------
# Create config.h file
# ------------------------------------------------------------------------------
if(APPLE)
if(MS2_PLUGINS_LOCATION)
set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION})
else()
set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries")
endif()
else()
set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins")
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
# ------------------------------------------------------------------------------

View file

@ -113,15 +113,19 @@ static inline string getWritableFilePath (const QString &filename) {
// lib64/
// share/
// On Mac, we have :
// Contents/
// Frameworks/
// MacOs/linphone
// Plugins/
// Resources/
// share/
static inline QDir getAppPackageDir () {
QDir dir(QCoreApplication::applicationDirPath());
if (dir.dirName() == QLatin1String("MacOS")) {
dir.cdUp();
if (!dir.cd("Resources"))
{
dir.mkdir("Resources");
dir.cd("Resources");
}
} else if( !dir.exists("lib") && !dir.exists("lib64")){// Check if these folders are in the current path
dir.cdUp();
if(!dir.exists("lib") && !dir.exists("lib64"))
@ -132,6 +136,11 @@ static inline QDir getAppPackageDir () {
static inline QString getAppPackageDataDirPath() {
QDir dir = getAppPackageDir();
if (!dir.cd("Resources"))
{
dir.mkdir("Resources");
dir.cd("Resources");
}
if (!dir.cd("share"))
{
dir.mkdir("share");