[vlc-commits] [Git][videolan/vlc][master] contrib: qtvlcdeps: use cmake to generate dependencies instead of qmake

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu May 16 11:47:51 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
dea2eede by Fatih Uzunoglu at 2024-05-16T09:54:16+00:00
contrib: qtvlcdeps: use cmake to generate dependencies instead of qmake

- - - - -


4 changed files:

- + contrib/src/qtvlcdeps/CMakeLists.txt
- − contrib/src/qtvlcdeps/imports.qrc
- contrib/src/qtvlcdeps/rules.mak
- − contrib/src/qtvlcdeps/vlcdeps.pro


Changes:

=====================================
contrib/src/qtvlcdeps/CMakeLists.txt
=====================================
@@ -0,0 +1,50 @@
+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
+)


=====================================
contrib/src/qtvlcdeps/imports.qrc deleted
=====================================
@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/">
-        <file>Imports.qml</file>
-    </qresource>
-</RCC>


=====================================
contrib/src/qtvlcdeps/rules.mak
=====================================
@@ -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"         | \


=====================================
contrib/src/qtvlcdeps/vlcdeps.pro deleted
=====================================
@@ -1,32 +0,0 @@
-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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/dea2eede25647f8a8e340898fb7d1bfb03285a41

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/dea2eede25647f8a8e340898fb7d1bfb03285a41
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list