forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: build qml plugin. fix cmake install dir
[skip ci]
- Loading branch information
Showing
7 changed files
with
133 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
set(MODULE QmlAV) | ||
set(EXTRA_DEFS -DBUILD_QMLAV_LIB) | ||
|
||
#URI = QtAV #uri used in QtAVQmlPlugin::registerTypes(uri) | ||
#qtAtLeast(5, 3): QMAKE_MOC_OPTIONS += -Muri=$$URI # not sure what moc does | ||
set(HEADERS | ||
QmlAV/Export.h | ||
QmlAV/MediaMetaData.h | ||
QmlAV/SGVideoNode.h | ||
QmlAV/QQuickItemRenderer.h | ||
QmlAV/QuickFilter.h | ||
QmlAV/QmlAVPlayer.h | ||
QmlAV/QuickSubtitle.h | ||
QmlAV/QuickSubtitleItem.h | ||
QmlAV/QuickVideoPreview.h | ||
) | ||
set(SOURCES | ||
plugin.cpp | ||
QQuickItemRenderer.cpp | ||
SGVideoNode.cpp | ||
QmlAVPlayer.cpp | ||
QuickFilter.cpp | ||
QuickSubtitle.cpp | ||
MediaMetaData.cpp | ||
QuickSubtitleItem.cpp | ||
QuickVideoPreview.cpp | ||
) | ||
if(NOT Qt5Qml_VERSION VERSION_LESS 5.2.0) | ||
list(APPEND HEADERS QmlAV/QuickFBORenderer.h) | ||
list(APPEND SOURCES QuickFBORenderer.cpp) | ||
endif() | ||
# add HEADERS for moc | ||
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS}) | ||
target_link_libraries(${MODULE} | ||
LINK_PRIVATE ${EXTRA_LIBS} | ||
LINK_PUBLIC QtAV Qt5::Qml Qt5::Quick | ||
) | ||
set_target_properties(${MODULE} PROPERTIES | ||
OUTPUT_NAME ${MODULE} | ||
CLEAN_DIRECT_OUTPUT 1 | ||
#LINK_SEARCH_START_STATIC 1 | ||
MACOSX_RPATH ON | ||
FRAMEWORK OFF | ||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/QtAV | ||
) | ||
|
||
#http://stackoverflow.com/questions/19866424/cmake-and-qt5-automoc-error | ||
#http://doc.qt.io/qt-5/cmake-manual.html | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) # for .moc | ||
target_include_directories(${MODULE} | ||
PUBLIC $<INSTALL_INTERFACE:include> | ||
PUBLIC $<INSTALL_INTERFACE:include/${MODULE}> | ||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}> | ||
PRIVATE ${EXTRA_INCLUDE} | ||
) | ||
target_compile_definitions(${MODULE} PRIVATE ${EXTRA_DEFS}) | ||
set(QML_FILES qmldir Video.qml plugins.qmltypes) | ||
add_custom_command(TARGET ${MODULE} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/QtAV | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QML_FILES} ${CMAKE_BINARY_DIR}/bin/QtAV | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
|
||
install(TARGETS ${MODULE} | ||
EXPORT ${MODULE}-targets | ||
RUNTIME DESTINATION ${QTAV_INSTALL_QML}/QtAV | ||
LIBRARY DESTINATION ${QTAV_INSTALL_QML}/QtAV | ||
ARCHIVE DESTINATION ${QTAV_INSTALL_QML}/QtAV | ||
FRAMEWORK DESTINATION ${QTAV_INSTALL_LIBS} | ||
) | ||
install(EXPORT ${MODULE}-targets | ||
DESTINATION ${QTAV_INSTALL_LIBS}/cmake/${MODULE} | ||
FILE ${MODULE}-config.cmake | ||
) | ||
install( | ||
FILES ${QML_FILES} | ||
DESTINATION ${QTAV_INSTALL_QML}/QtAV | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/****************************************************************************** | ||
QtAV: Multimedia framework based on Qt and FFmpeg | ||
Copyright (C) 2012-2016 Wang Bin <[email protected]> | ||
Copyright (C) 2012-2017 Wang Bin <[email protected]> | ||
* This file is part of QtAV (from 2015) | ||
|
@@ -31,7 +31,8 @@ | |
#include <QtGui/QOpenGLFramebufferObject> | ||
#include <QtQuick/QQuickWindow> | ||
// for dynamicgl. qglfunctions before qt5.3 does not have portable gl functions | ||
#ifdef QT_OPENGL_DYNAMIC | ||
// use qt gl func if possible to avoid linking to opengl directly | ||
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) | ||
#include <QtGui/QOpenGLFunctions> | ||
#define DYGL(glFunc) QOpenGLContext::currentContext()->functions()->glFunc | ||
#else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters