CMake: fix building library with wxUSE_GUI 0

Actual toolkit should still be defined (e.g. WXMSW), before settings WXBASE.
Move Windows libraries outide toolkit so they are always linked to.
This commit is contained in:
Maarten Bent
2018-01-27 13:39:45 +01:00
parent 5017c6c8c2
commit 90369e9632
2 changed files with 35 additions and 27 deletions

View File

@@ -193,6 +193,33 @@ function(wx_set_target_properties target_name is_base)
target_include_directories(${target_name}
PUBLIC ${wxTOOLKIT_INCLUDE_DIRS})
endif()
if (WXMSW)
set(WXMSW_LIBRARIES
kernel32
user32
gdi32
comdlg32
winspool
winmm
shell32
shlwapi
comctl32
ole32
oleaut32
uuid
rpcrt4
advapi32
version
wsock32
wininet
oleacc
uxtheme
)
target_link_libraries(${target_name}
PUBLIC ${WXMSW_LIBRARIES})
endif()
if(wxTOOLKIT_LIBRARIES)
target_link_libraries(${target_name}
PUBLIC ${wxTOOLKIT_LIBRARIES})