CMake Build: Add direct2d CMake build

Also fixed Direct 2D feature detection test for MinGW.

Task-number: QTBUG-83932
Change-Id: I8c89aaa953d34de40fdf7b51e0859c791aeb38ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Cristian Adam 2020-09-30 14:41:28 +02:00
parent 158aba25c9
commit 45271fb2ac
3 changed files with 280 additions and 2 deletions

View File

@ -574,7 +574,8 @@ qt_config_compile_test(d2d1
int main(int, char **)
{
void *factory = nullptr;
D2D1_FACTORY_OPTIONS options{0};
D2D1_FACTORY_OPTIONS options;
ZeroMemory(&options, sizeof(D2D1_FACTORY_OPTIONS));
D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, GUID{}, &options, &factory);
return 0;
}

View File

@ -22,7 +22,7 @@ if(WIN32)
add_subdirectory(windows)
endif()
if(QT_FEATURE_direct2d1_1 AND QT_FEATURE_directwrite)
# add_subdirectory(direct2d) # special case TODO
add_subdirectory(direct2d)
endif()
if(QNX)
# add_subdirectory(qnx) # special case TODO

View File

@ -0,0 +1,277 @@
# Generated from direct2d.pro.
#####################################################################
## QWindowsDirect2DIntegrationPlugin Plugin:
#####################################################################
qt_internal_add_plugin(QWindowsDirect2DIntegrationPlugin
OUTPUT_NAME qdirect2d
TYPE platforms
SOURCES
../windows/qtwindowsglobal.h
../windows/qwin10helpers.cpp ../windows/qwin10helpers.h
../windows/qwindowsapplication.cpp ../windows/qwindowsapplication.h
../windows/qwindowscombase.h
../windows/qwindowscontext.cpp ../windows/qwindowscontext.h
../windows/qwindowscursor.cpp ../windows/qwindowscursor.h
../windows/qwindowsdialoghelpers.cpp ../windows/qwindowsdialoghelpers.h
../windows/qwindowsdropdataobject.cpp ../windows/qwindowsdropdataobject.h
../windows/qwindowsinputcontext.cpp ../windows/qwindowsinputcontext.h
../windows/qwindowsintegration.cpp ../windows/qwindowsintegration.h
../windows/qwindowsinternalmimedata.cpp ../windows/qwindowsinternalmimedata.h
../windows/qwindowskeymapper.cpp ../windows/qwindowskeymapper.h
../windows/qwindowsmenu.cpp ../windows/qwindowsmenu.h
../windows/qwindowsmime.cpp ../windows/qwindowsmime.h
../windows/qwindowsmousehandler.cpp ../windows/qwindowsmousehandler.h
../windows/qwindowsnativeinterface.cpp ../windows/qwindowsnativeinterface.h
../windows/qwindowsole.cpp ../windows/qwindowsole.h
../windows/qwindowsopengltester.cpp ../windows/qwindowsopengltester.h
../windows/qwindowspointerhandler.cpp ../windows/qwindowspointerhandler.h
../windows/qwindowsscreen.cpp ../windows/qwindowsscreen.h
../windows/qwindowsservices.cpp ../windows/qwindowsservices.h
../windows/qwindowstheme.cpp ../windows/qwindowstheme.h
../windows/qwindowsthreadpoolrunner.h
../windows/qwindowswindow.cpp ../windows/qwindowswindow.h
qwindowsdirect2dbackingstore.cpp qwindowsdirect2dbackingstore.h
qwindowsdirect2dbitmap.cpp qwindowsdirect2dbitmap.h
qwindowsdirect2dcontext.cpp qwindowsdirect2dcontext.h
qwindowsdirect2ddevicecontext.cpp qwindowsdirect2ddevicecontext.h
qwindowsdirect2dhelpers.h
qwindowsdirect2dintegration.cpp qwindowsdirect2dintegration.h
qwindowsdirect2dnativeinterface.cpp qwindowsdirect2dnativeinterface.h
qwindowsdirect2dpaintdevice.cpp qwindowsdirect2dpaintdevice.h
qwindowsdirect2dpaintengine.cpp qwindowsdirect2dpaintengine.h
qwindowsdirect2dplatformpixmap.cpp qwindowsdirect2dplatformpixmap.h
qwindowsdirect2dplatformplugin.cpp
qwindowsdirect2dwindow.cpp qwindowsdirect2dwindow.h
DEFINES
QT_NO_CAST_FROM_ASCII
QT_NO_FOREACH
INCLUDE_DIRECTORIES
../windows
LIBRARIES
advapi32
d2d1 # special case
dwrite # special case
gdi32
ole32
shell32
user32
winmm
PUBLIC_LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
d3d11
dwmapi
dxgi
dxguid
imm32
oleaut32
shlwapi
version
winspool
wtsapi32
)
# Resources:
set_source_files_properties("../windows/openglblacklists/default.json"
PROPERTIES QT_RESOURCE_ALIAS "default.json"
)
set(openglblacklists_resource_files
"openglblacklists/default.json"
)
qt_internal_add_resource(QWindowsDirect2DIntegrationPlugin "openglblacklists"
PREFIX
"/qt-project.org/windows/openglblacklists"
BASE
"../windows"
FILES
${openglblacklists_resource_files}
)
#### Keys ignored in scope 1:.:.:direct2d.pro:<TRUE>:
# OTHER_FILES = "direct2d.json"
## Scopes:
#####################################################################
#### Keys ignored in scope 2:.:.:direct2d.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN:
# PLUGIN_EXTENDS = "-"
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl
PUBLIC_LIBRARIES
opengl32
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION MINGW
PUBLIC_LIBRARIES
uuid
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_opengl
SOURCES
../windows/qwindowsglcontext.cpp ../windows/qwindowsglcontext.h
../windows/qwindowsopenglcontext.h
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_systemtrayicon
SOURCES
../windows/qwindowssystemtrayicon.cpp ../windows/qwindowssystemtrayicon.h
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_vulkan
SOURCES
../windows/qwindowsvulkaninstance.cpp ../windows/qwindowsvulkaninstance.h
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_clipboard
SOURCES
../windows/qwindowsclipboard.cpp ../windows/qwindowsclipboard.h
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_clipboard AND QT_FEATURE_draganddrop
SOURCES
../windows/qwindowsdrag.cpp ../windows/qwindowsdrag.h
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_tabletevent
SOURCES
../windows/qwindowstabletsupport.cpp ../windows/qwindowstabletsupport.h
INCLUDE_DIRECTORIES
${QT_SOURCE_TREE}/src/3rdparty/wintab
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_sessionmanager
SOURCES
../windows/qwindowssessionmanager.cpp ../windows/qwindowssessionmanager.h
)
if(QT_FEATURE_imageformat_png)
# Resources:
set_source_files_properties("../windows/images/closedhandcursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/closedhandcursor_32.png"
)
set_source_files_properties("../windows/images/closedhandcursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/closedhandcursor_48.png"
)
set_source_files_properties("../windows/images/closedhandcursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/closedhandcursor_64.png"
)
set_source_files_properties("../windows/images/dragcopycursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/dragcopycursor_32.png"
)
set_source_files_properties("../windows/images/dragcopycursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/dragcopycursor_48.png"
)
set_source_files_properties("../windows/images/dragcopycursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/dragcopycursor_64.png"
)
set_source_files_properties("../windows/images/draglinkcursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/draglinkcursor_32.png"
)
set_source_files_properties("../windows/images/draglinkcursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/draglinkcursor_48.png"
)
set_source_files_properties("../windows/images/draglinkcursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/draglinkcursor_64.png"
)
set_source_files_properties("../windows/images/dragmovecursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/dragmovecursor_32.png"
)
set_source_files_properties("../windows/images/dragmovecursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/dragmovecursor_48.png"
)
set_source_files_properties("../windows/images/dragmovecursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/dragmovecursor_64.png"
)
set_source_files_properties("../windows/images/openhandcursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/openhandcursor_32.png"
)
set_source_files_properties("../windows/images/openhandcursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/openhandcursor_48.png"
)
set_source_files_properties("../windows/images/openhandcursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/openhandcursor_64.png"
)
set_source_files_properties("../windows/images/splithcursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/splithcursor_32.png"
)
set_source_files_properties("../windows/images/splithcursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/splithcursor_48.png"
)
set_source_files_properties("../windows/images/splithcursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/splithcursor_64.png"
)
set_source_files_properties("../windows/images/splitvcursor_32.png"
PROPERTIES QT_RESOURCE_ALIAS "images/splitvcursor_32.png"
)
set_source_files_properties("../windows/images/splitvcursor_48.png"
PROPERTIES QT_RESOURCE_ALIAS "images/splitvcursor_48.png"
)
set_source_files_properties("../windows/images/splitvcursor_64.png"
PROPERTIES QT_RESOURCE_ALIAS "images/splitvcursor_64.png"
)
set(cursors_resource_files
"images/closedhandcursor_32.png"
"images/closedhandcursor_48.png"
"images/closedhandcursor_64.png"
"images/dragcopycursor_32.png"
"images/dragcopycursor_48.png"
"images/dragcopycursor_64.png"
"images/draglinkcursor_32.png"
"images/draglinkcursor_48.png"
"images/draglinkcursor_64.png"
"images/dragmovecursor_32.png"
"images/dragmovecursor_48.png"
"images/dragmovecursor_64.png"
"images/openhandcursor_32.png"
"images/openhandcursor_48.png"
"images/openhandcursor_64.png"
"images/splithcursor_32.png"
"images/splithcursor_48.png"
"images/splithcursor_64.png"
"images/splitvcursor_32.png"
"images/splitvcursor_48.png"
"images/splitvcursor_64.png"
)
qt_internal_add_resource(QWindowsDirect2DIntegrationPlugin "cursors"
PREFIX
"/qt-project.org/windows/cursors"
BASE
"../windows"
FILES
${cursors_resource_files}
)
endif()
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_accessibility
SOURCES
../windows/uiautomation/qwindowsuiaaccessibility.cpp ../windows/uiautomation/qwindowsuiaaccessibility.h
../windows/uiautomation/qwindowsuiabaseprovider.cpp ../windows/uiautomation/qwindowsuiabaseprovider.h
../windows/uiautomation/qwindowsuiaexpandcollapseprovider.cpp ../windows/uiautomation/qwindowsuiaexpandcollapseprovider.h
../windows/uiautomation/qwindowsuiagriditemprovider.cpp ../windows/uiautomation/qwindowsuiagriditemprovider.h
../windows/uiautomation/qwindowsuiagridprovider.cpp ../windows/uiautomation/qwindowsuiagridprovider.h
../windows/uiautomation/qwindowsuiainvokeprovider.cpp ../windows/uiautomation/qwindowsuiainvokeprovider.h
../windows/uiautomation/qwindowsuiamainprovider.cpp ../windows/uiautomation/qwindowsuiamainprovider.h
../windows/uiautomation/qwindowsuiaprovidercache.cpp ../windows/uiautomation/qwindowsuiaprovidercache.h
../windows/uiautomation/qwindowsuiarangevalueprovider.cpp ../windows/uiautomation/qwindowsuiarangevalueprovider.h
../windows/uiautomation/qwindowsuiaselectionitemprovider.cpp ../windows/uiautomation/qwindowsuiaselectionitemprovider.h
../windows/uiautomation/qwindowsuiaselectionprovider.cpp ../windows/uiautomation/qwindowsuiaselectionprovider.h
../windows/uiautomation/qwindowsuiatableitemprovider.cpp ../windows/uiautomation/qwindowsuiatableitemprovider.h
../windows/uiautomation/qwindowsuiatableprovider.cpp ../windows/uiautomation/qwindowsuiatableprovider.h
../windows/uiautomation/qwindowsuiatextprovider.cpp ../windows/uiautomation/qwindowsuiatextprovider.h
../windows/uiautomation/qwindowsuiatextrangeprovider.cpp ../windows/uiautomation/qwindowsuiatextrangeprovider.h
../windows/uiautomation/qwindowsuiatoggleprovider.cpp ../windows/uiautomation/qwindowsuiatoggleprovider.h
../windows/uiautomation/qwindowsuiautils.cpp ../windows/uiautomation/qwindowsuiautils.h
../windows/uiautomation/qwindowsuiavalueprovider.cpp ../windows/uiautomation/qwindowsuiavalueprovider.h
../windows/uiautomation/qwindowsuiawindowprovider.cpp ../windows/uiautomation/qwindowsuiawindowprovider.h
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION MINGW AND QT_FEATURE_accessibility
PUBLIC_LIBRARIES
uuid
)