clean up wxgtk3 finding cmake code
Use a loop to check for wx-config-gtk4 then wx-config-gtk3 and unset the config executable variable otherwise. Also remove gl from the initial wx libraries list.
This commit is contained in:
parent
2efcb620bd
commit
437b366e39
|
@ -73,19 +73,21 @@ SET(wxWidgets_USE_UNICODE ON)
|
||||||
# adv is for wxAboutBox
|
# adv is for wxAboutBox
|
||||||
# xml, html is for xrc
|
# xml, html is for xrc
|
||||||
# do not include gl at first
|
# do not include gl at first
|
||||||
set(wxWidgets_USE_LIBS xrc xml html adv net core base gl)
|
set(wxWidgets_USE_LIBS xrc xml html adv net core base)
|
||||||
#list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8)
|
#list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8)
|
||||||
|
|
||||||
# check for gtk4 then gtk3 packages first, some dists like arch rename the
|
# check for gtk4 then gtk3 packages first, some dists like arch rename the
|
||||||
# wx-config utility for these packages
|
# wx-config utility for these packages
|
||||||
set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk4)
|
foreach(gtk_ver 4 3)
|
||||||
find_package(wxWidgets QUIET)
|
set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk${gtk_ver})
|
||||||
if(NOT wxWidgets_FOUND)
|
|
||||||
set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk3)
|
|
||||||
find_package(wxWidgets QUIET)
|
find_package(wxWidgets QUIET)
|
||||||
if(NOT wxWidgets_FOUND)
|
if(wxWidgets_FOUND)
|
||||||
unset(wxWidgets_CONFIG_EXECUTABLE)
|
break()
|
||||||
endif()
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
if(NOT wxWidgets_FOUND)
|
||||||
|
unset(wxWidgets_CONFIG_EXECUTABLE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# the gl lib may not be available, and if it looks like it is we still have to
|
# the gl lib may not be available, and if it looks like it is we still have to
|
||||||
|
|
Loading…
Reference in New Issue