Commit afff6143 authored by Vincent Pinon's avatar Vincent Pinon
Browse files

Find MLT on Mac, add debug

parent 5808e862
Pipeline #80230 passed with stage
in 8 minutes and 34 seconds
......@@ -6,7 +6,13 @@ set_package_properties(LibV4L2 PROPERTIES
TYPE RUNTIME
PURPOSE "Required for better webcam support")
if(NOT WIN32)
if(WIN32)
set(MLT_MELTBIN "melt.exe")
set(MLT_DATADIR "../share/mlt")
elseif(APPLE)
set(MLT_MELTBIN "melt")
set(MLT_DATADIR "../Resources/mlt")
else()
find_package(PkgConfig QUIET)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=mltdatadir mlt-framework-7
......@@ -23,9 +29,6 @@ if(NOT WIN32)
if(NOT MLT_MELTBIN_failed)
string(REGEX REPLACE "[\r\n]" "" MLT_MELTBIN "${MLT_MELTBIN}")
endif()
else()
set(MLT_MELTBIN "melt.exe")
set(MLT_DATADIR "../share/mlt")
endif()
configure_file(mlt_config.h.in ${CMAKE_BINARY_DIR}/mlt_config.h)
......
......@@ -440,7 +440,7 @@ void Wizard::checkMltComponents()
i18n("<li>Missing package: <b>Frei0r</b> effects (frei0r-plugins)<br/>provides many effects and transitions. Install recommended</li>"));
}
#ifndef Q_OS_WIN
#if(!(defined(Q_OS_WIN)||defined(Q_OS_MAC)))
// Check that we have the breeze icon theme installed
const QStringList iconPaths = QIcon::themeSearchPaths();
bool hasBreeze = false;
......
......@@ -108,7 +108,7 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
QString profilePath = mltPath;
QString appName;
QString libName;
#ifdef Q_OS_WIN
#if(defined(Q_OS_WIN)||defined(Q_OS_MAC))
appName = QStringLiteral("melt");
libName = QStringLiteral("mlt");
#else
......@@ -118,24 +118,45 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
// environment variables should override other settings
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PROFILES_PATH")) {
profilePath = qgetenv("MLT_PROFILES_PATH");
qWarning() << "profilePath from $MLT_PROFILES_PATH: " << profilePath;
}
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_DATA")) {
profilePath = qgetenv("MLT_DATA") + QStringLiteral("/profiles");
qWarning() << "profilePath from $MLT_DATA: " << profilePath;
}
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PREFIX")) {
profilePath = qgetenv("MLT_PREFIX") + QStringLiteral("/share/%1/profiles").arg(libName);
qWarning() << "profilePath from $MLT_PREFIX/share: " << profilePath;
}
#ifdef Q_OS_MAC
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && qEnvironmentVariableIsSet("MLT_PREFIX")) {
profilePath = qgetenv("MLT_PREFIX") + QStringLiteral("/Resources/%1/profiles").arg(libName);
qWarning() << "profilePath from $MLT_PREFIX/Resources: " << profilePath;
}
#ifndef Q_OS_WIN
#endif
#if(!(defined(Q_OS_WIN)||defined(Q_OS_MAC)))
// stored setting should not be considered on windows as MLT is distributed with each new Kdenlive version
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !KdenliveSettings::mltpath().isEmpty()) profilePath = KdenliveSettings::mltpath();
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !KdenliveSettings::mltpath().isEmpty()) {
profilePath = KdenliveSettings::mltpath();
qWarning() << "profilePath from KdenliveSetting::mltPath: " << profilePath;
}
#endif
// try to automatically guess MLT path if installed with the same prefix as kdenlive with default data path
if (profilePath.isEmpty() || !QFile::exists(profilePath)) {
profilePath = QDir::cleanPath(qApp->applicationDirPath() + QStringLiteral("/../share/%1/profiles").arg(libName));
qWarning() << "profilePath from appDir/../share: " << profilePath;
}
#ifdef Q_OS_MAC
// try to automatically guess MLT path if installed with the same prefix as kdenlive with default data path
if (profilePath.isEmpty() || !QFile::exists(profilePath)) {
profilePath = QDir::cleanPath(qApp->applicationDirPath() + QStringLiteral("/../Resources/%1/profiles").arg(libName));
qWarning() << "profilePath from appDir/../Resources: " << profilePath;
}
#endif
// fallback to build-time definition
if ((profilePath.isEmpty() || !QFile::exists(profilePath)) && !QStringLiteral(MLT_DATADIR).isEmpty()) {
profilePath = QStringLiteral(MLT_DATADIR) + QStringLiteral("/profiles");
qWarning() << "profilePath from build-time MLT_DATADIR: " << profilePath;
}
KdenliveSettings::setMltpath(profilePath);
......@@ -147,17 +168,38 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
QString meltPath;
if (qEnvironmentVariableIsSet("MLT_PREFIX")) {
meltPath = qgetenv("MLT_PREFIX") + QStringLiteral("/bin/%1").arg(appName) + exeSuffix;
} else {
qWarning() << "meltPath from $MLT_PREFIX/bin: " << meltPath;
}
#ifdef Q_OS_MAC
if ((meltPath.isEmpty() || !QFile::exists(meltPath)) && qEnvironmentVariableIsSet("MLT_PREFIX")) {
meltPath = qgetenv("MLT_PREFIX") + QStringLiteral("/MacOS/%1").arg(appName);
qWarning() << "meltPath from MLT_PREFIX/MacOS: " << meltPath;
}
#endif
#if(!(defined(Q_OS_WIN)||defined(Q_OS_MAC)))
// stored setting should not be considered on windows as MLT is distributed with each new Kdenlive version
if ((meltPath.isEmpty() || !QFile::exists(meltPath))) {
meltPath = KdenliveSettings::rendererpath();
qWarning() << "meltPath from KdenliveSetting::rendererPath: " << profilePath;
}
if (!QFile::exists(meltPath)) {
#endif
if ((meltPath.isEmpty() || !QFile::exists(meltPath))) {
meltPath = QDir::cleanPath(profilePath + QStringLiteral("/../../../bin/%1").arg(appName)) + exeSuffix;
if (!QFile::exists(meltPath)) {
meltPath = QStandardPaths::findExecutable(appName);
if (meltPath.isEmpty()) {
meltPath = QStandardPaths::findExecutable("mlt-melt");
}
}
qWarning() << "meltPath from profilePath/.../bin: " << profilePath;
}
#ifdef Q_OS_MAC
if ((meltPath.isEmpty() || !QFile::exists(meltPath))) {
meltPath = QDir::cleanPath(profilePath + QStringLiteral("/../../../MacOS/%1").arg(appName));
qWarning() << "meltPath from profilePath/.../MacOS: " << profilePath;
}
#endif
if ((meltPath.isEmpty() || !QFile::exists(meltPath))) {
meltPath = QStandardPaths::findExecutable(appName);
qWarning() << "meltPath from findExe: " << profilePath;
}
if ((meltPath.isEmpty() || !QFile::exists(meltPath))) {
meltPath = QStandardPaths::findExecutable("mlt-melt");
qWarning() << "meltPath from findExe: " << profilePath;
}
KdenliveSettings::setRendererpath(meltPath);
......
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