Support WXQT in CMake

This commit is contained in:
Maarten Bent
2018-09-25 19:41:17 +02:00
parent 4c06c43f26
commit 1dfe088b4d
9 changed files with 60 additions and 13 deletions

View File

@@ -379,6 +379,14 @@ set(MEDIA_QT_SRC
src/qt/mediactrl.cpp
)
set(OPENGL_QT_HDR
wx/qt/glcanvas.h
)
set(OPENGL_QT_SRC
src/qt/glcanvas.cpp
)
set(BASE_CMN_SRC
src/common/any.cpp
src/common/appbase.cpp

View File

@@ -151,11 +151,21 @@ if(wxUSE_THREADS)
endif()
if(wxUSE_GUI)
if(WIN32 AND wxUSE_METAFILE)
if(WXMSW AND wxUSE_METAFILE)
# this one should probably be made separately configurable
set(wxUSE_ENH_METAFILE ON)
endif()
# WXQT checks
if(WXQT)
wx_option_force_value(wxUSE_WEBVIEW OFF)
wx_option_force_value(wxUSE_METAFILE OFF)
if(WIN32)
wx_option_force_value(wxUSE_ACCESSIBILITY OFF)
endif()
endif()
# extra dependencies
if(wxUSE_OPENGL)
find_package(OpenGL)
if(NOT OPENGL_FOUND)

View File

@@ -41,6 +41,11 @@ elseif(WXOSX_COCOA)
wx_append_sources(CORE_SRC OSX_LOWLEVEL)
wx_append_sources(CORE_SRC OSX_SHARED)
wx_append_sources(CORE_SRC OSX_COCOA)
elseif(WXQT)
wx_append_sources(CORE_SRC QT)
if(WIN32)
wx_append_sources(CORE_SRC QT_WIN32)
endif()
endif()
wx_add_library(core ${CORE_SRC})

View File

@@ -11,12 +11,14 @@ include(../../source_groups.cmake)
wx_append_sources(GL_FILES OPENGL_CMN)
if(WIN32)
if(WXMSW)
wx_append_sources(GL_FILES OPENGL_MSW)
elseif(WXGTK)
wx_append_sources(GL_FILES OPENGL_GTK)
elseif(APPLE)
wx_append_sources(GL_FILES OPENGL_OSX_SHARED)
elseif(WXQT)
wx_append_sources(GL_FILES OPENGL_QT)
endif()
wx_add_library(gl ${GL_FILES})

View File

@@ -17,6 +17,8 @@ elseif(WXOSX_COCOA)
wx_append_sources(MEDIA_FILES MEDIA_OSX_COCOA)
elseif(UNIX)
wx_append_sources(MEDIA_FILES MEDIA_UNIX)
elseif(WXQT)
wx_append_sources(MEDIA_FILES MEDIA_QT)
endif()
wx_add_library(media ${MEDIA_FILES})

View File

@@ -353,9 +353,6 @@ wx_option(wxUSE_HOTKEY "use wxWindow::RegisterHotKey()")
wx_option(wxUSE_JOYSTICK "use wxJoystick")
wx_option(wxUSE_METAFILE "use wxMetaFile")
wx_option(wxUSE_DRAGIMAGE "use wxDragImage")
if(WXMSW)
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support")
endif()
wx_option(wxUSE_UIACTIONSIMULATOR "use wxUIActionSimulator (experimental)")
wx_option(wxUSE_DC_TRANSFORM_MATRIX "use wxDC::SetTransformMatrix and related")
wx_option(wxUSE_WEBVIEW_WEBKIT "use wxWebView WebKit backend")
@@ -403,6 +400,7 @@ if(WIN32)
set(wxUSE_WINRT_DEFAULT OFF)
endif()
wx_option(wxUSE_WINRT "enable WinRT support" ${wxUSE_WINRT_DEFAULT})
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support")
endif()
# this one is not really MSW-specific but it exists mainly to be turned off

View File

@@ -264,13 +264,15 @@ if(WIN32)
wx_add_sample(dll sdk_exe.cpp my_dll.h NAME sdk_exe FOLDER dll LIBRARIES my_dll)
endif()
if(MSVC)
wx_add_sample(flash)
endif()
#TODO: reenable when sample is fixed
#wx_add_sample(mfc mfctest.cpp mfctest.h resource.h stdafx.h RES mfctest.rc)
wx_add_sample(nativdlg nativdlg.cpp nativdlg.h resource.h RES nativdlg.rc)
wx_add_sample(oleauto DEPENDS wxUSE_OLE)
wx_add_sample(regtest RES regtest.rc DEPENDS wxUSE_REGKEY)
wx_add_sample(taskbarbutton DEPENDS wxUSE_TASKBARBUTTON)
wx_add_sample(oleauto DEPENDS wxUSE_OLE)
if(WXMSW)
wx_add_sample(nativdlg nativdlg.cpp nativdlg.h resource.h RES nativdlg.rc)
#TODO: reenable when sample is fixed
#wx_add_sample(mfc mfctest.cpp mfctest.h resource.h stdafx.h RES mfctest.rc)
wx_add_sample(taskbarbutton DEPENDS wxUSE_TASKBARBUTTON)
wx_add_sample(flash DEPENDS wxUSE_ACTIVEX)
endif()
endif()

View File

@@ -46,6 +46,8 @@ if(wxBUILD_TOOLKIT MATCHES "^gtk*")
set(WXGTK ON)
elseif(wxBUILD_TOOLKIT MATCHES "^osx*")
set(WXOSX ON)
elseif(wxBUILD_TOOLKIT MATCHES "qt")
set(WXQT ON)
endif()
set(wxTOOLKIT_DEFINITIONS __WX${toolkit_upper}__)
@@ -113,7 +115,19 @@ if(WXGTK)
endif()
endif()
if(WXQT)
set(QT_COMPONENTS Core Widgets Gui OpenGL Test)
foreach(QT_COMPONENT ${QT_COMPONENTS})
find_package(Qt5 COMPONENTS ${QT_COMPONENT} REQUIRED)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${Qt5${QT_COMPONENT}_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${Qt5${QT_COMPONENT}_LIBRARIES})
list(APPEND wxTOOLKIT_DEFINITIONS ${Qt5${QT_COMPONENT}_COMPILE_DEFINITIONS})
endforeach()
set(wxTOOLKIT_VERSION ${Qt5Core_VERSION})
endif()
if(APPLE)
list(APPEND wxTOOLKIT_DEFINITIONS __WXMAC__ __WXOSX__)
endif()
endif() # wxUSE_GUI

View File

@@ -398,6 +398,12 @@ QT_SRC=
MEDIA_QT_SRC=
src/qt/mediactrl.cpp
OPENGL_QT_HDR=
wx/qt/glcanvas.h
OPENGL_QT_SRC=
src/qt/glcanvas.cpp
## Common
BASE_CMN_SRC =