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

@@ -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