Skip to content
Snippets Groups Projects
Commit dea2eede authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Steve Lhomme
Browse files

contrib: qtvlcdeps: use cmake to generate dependencies instead of qmake

parent 7f47f0f6
No related branches found
No related tags found
1 merge request!5367contrib: qtvlcdeps: use cmake to generate dependencies instead of qmake
Pipeline #470586 passed with warnings with stage
in 45 minutes and 7 seconds
cmake_minimum_required(VERSION 3.16)
project(qtvlcdeps VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.2 REQUIRED COMPONENTS Core Gui Qml Svg Quick Widgets QuickControls2)
qt_standard_project_setup(REQUIRES 6.2)
qt_add_executable(qtvlcdeps)
qt_add_qml_module(qtvlcdeps
URI qtvlcdeps
RESOURCE_PREFIX qtvlcdeps
QML_FILES
Imports.qml
)
qt_import_plugins(qtvlcdeps
INCLUDE Qt::QSvgIconPlugin Qt::QSvgPlugin Qt::QJpegPlugin Qt::QICOPlugin
)
if (WIN32)
qt_import_plugins(qtvlcdeps
INCLUDE Qt::QWindowsIntegrationPlugin Qt::QModernWindowsStylePlugin
)
endif (WIN32)
if (UNIX)
qt_import_plugins(qtvlcdeps
INCLUDE Qt::QXcbGlxIntegrationPlugin Qt::QXcbEglIntegrationPlugin Qt::QXcbIntegrationPlugin Qt::QWaylandIntegrationPlugin Qt::QWaylandEglPlatformIntegrationPlugin Qt::QGtk3ThemePlugin Qt::QXdgDesktopPortalThemePlugin Qt::QWaylandXdgShellPlatformIntegrationPlugin
)
endif (UNIX)
if (APPLE)
qt_import_plugins(qtvlcdeps
INCLUDE Qt::QCocoaIntegrationPlugin Qt::QMacStylePlugin
)
endif (APPLE)
set_target_properties(qtvlcdeps PROPERTIES
WIN32_EXECUTABLE TRUE
qt_no_entrypoint TRUE
)
target_link_libraries(qtvlcdeps
PRIVATE Qt6::Core Qt6::Gui Qt6::Qml Qt6::Svg Qt6::Quick Qt6::Widgets Qt6::QuickControls2
)
<RCC>
<qresource prefix="/">
<file>Imports.qml</file>
</qresource>
</RCC>
......@@ -14,7 +14,7 @@ ifeq ($(call need_pkg,"qtvlcdeps >= 0.1"),)
PKGS_FOUND += qtvlcdeps
endif
QT_VLC_DEP_SOURCES := Imports.qml Imports.qrc qtvlcdeps.pc.in vlcdeps.pro
QT_VLC_DEP_SOURCES := Imports.qml qtvlcdeps.pc.in CMakeLists.txt
.sum-qtvlcdeps:
touch $@
......@@ -28,9 +28,9 @@ qtvlcdeps:
$(MOVE)
.qtvlcdeps: qtvlcdeps
rm -rf $</Makefile.Release
$(BUILDPREFIX)/bin/qmake6 -qtconf $(PREFIX)/bin/target_qt.conf $(SRC)/qtvlcdeps -o $<
QT_LIBS=$$(awk -F '=' '/LIBS/ {print $$2; exit}' $</Makefile.Release); \
$(CMAKECLEAN)
$(HOSTVARS) $(CMAKE) -G Ninja -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake
QT_LIBS=$$(awk -F '=' '/LINK_LIBRARIES/ {print $$2; exit}' $(BUILD_DIR)/build.ninja); \
cat $</qtvlcdeps.pc.in | \
sed "s|%1|$$QT_LIBS|" | \
sed "s|$(PREFIX)/lib/|$$\{libdir\}/|g" | \
......
TEMPLATE = app
QT = core gui qml svg quick widgets quickcontrols2
QTPLUGIN = qsvgicon qsvg qjpeg qico
CONFIG -= entrypoint
win32 {
QTPLUGIN += qwindows qmodernwindowsstyle
}
linux {
QTPLUGIN += qxcb-glx-integration qxcb-egl-integration qxcb qwayland-generic qwayland-egl qgtk3 qxdgdesktopportal xdg-shell
}
macx {
QTPLUGIN += qcocoa qmacstyle
}
# qmake will run qmlimportscanner,
# which will make it generate correct qml plugin
# dependencies
RESOURCES = imports.qrc
# These are not needed now, but may be required in the future:
# CONFIG += import_plugins staticlib create_pc create_prl no_install_prl link_prl
# QMAKE_PKGCONFIG_NAME = vlcdeps
# QMAKE_PKGCONFIG_DESCRIPTION = Dependencies for VLC
# QMAKE_PKGCONFIG_LIBDIR = $$target.path
# QMAKE_PKGCONFIG_INCDIR = $$headers.path
# QMAKE_PKGCONFIG_DESTDIR = pkgconfig
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment