Fix wxGTK/Win32 CMake build

This commit is contained in:
Kolya Kosenko
2018-02-27 23:47:27 +02:00
parent 9f77a4f674
commit d6a284783a
4 changed files with 43 additions and 5 deletions

View File

@@ -202,8 +202,8 @@ function(wx_set_target_properties target_name is_base)
PUBLIC ${wxTOOLKIT_INCLUDE_DIRS})
endif()
if (WXMSW)
set(WXMSW_LIBRARIES
if (WIN32)
set(WIN32_LIBRARIES
kernel32
user32
gdi32
@@ -225,7 +225,38 @@ function(wx_set_target_properties target_name is_base)
uxtheme
)
target_link_libraries(${target_name}
PUBLIC ${WXMSW_LIBRARIES})
PUBLIC ${WIN32_LIBRARIES})
if(WXGTK)
if(WXGTK4)
set(WXGTK_WIN32_LIBRARIES
libgtk-4.dll.a
libgdk-4.dll.a
)
elseif(WXGTK3)
set(WXGTK_WIN32_LIBRARIES
libgtk-3.dll.a
libgdk-3.dll.a
)
elseif(WXGTK2)
set(WXGTK_WIN32_LIBRARIES
gtk-win32-2.0.lib
gdk-win32-2.0.lib
)
endif()
set(WXGTK_WIN32_LIBRARIES ${WXGTK_WIN32_LIBRARIES}
gio-2.0.lib
pangocairo-1.0.lib
gdk_pixbuf-2.0.lib
cairo.lib
pango-1.0.lib
gobject-2.0.lib
gthread-2.0.lib
glib-2.0.lib
)
target_link_libraries(${target_name}
PUBLIC ${WXGTK_WIN32_LIBRARIES})
endif()
endif()
if(wxTOOLKIT_LIBRARIES)

View File

@@ -20,6 +20,9 @@ elseif(WXOSX_COCOA)
elseif(WXGTK)
wx_append_sources(ADV_FILES ADVANCED_GTK2)
wx_append_sources(ADV_FILES ADVANCED_GTK_NATIVE)
if(WIN32)
wx_append_sources(ADV_FILES ADVANCED_GTK_WIN32)
endif()
endif()
if(UNIX AND NOT APPLE AND NOT WIN32)

View File

@@ -28,7 +28,11 @@ elseif(WXGTK)
wx_append_sources(CORE_SRC GTK2_LOWLEVEL)
wx_append_sources(CORE_SRC GTK2)
wx_append_sources(CORE_SRC XWIN_LOWLEVEL)
if(UNIX)
wx_append_sources(CORE_SRC XWIN_LOWLEVEL)
elseif(WIN32)
wx_append_sources(CORE_SRC GTK_WIN32)
endif()
elseif(WXOSX_COCOA)
wx_append_sources(CORE_SRC BASE_AND_GUI_OSX_COCOA)
wx_append_sources(CORE_SRC OSX_LOWLEVEL)

View File

@@ -342,7 +342,7 @@ 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(WIN32)
if(WXMSW)
wx_option(wxUSE_ACCESSIBILITY "enable accessibility support")
endif()
wx_option(wxUSE_UIACTIONSIMULATOR "use wxUIActionSimulator (experimental)")