do not prefer wxgtk3 if $ENV{WX_CONFIG} is set

Skip the check for wx-config-gtk3 if the WX_CONFIG environment variable
is set, indicating that the user wants to override the version of wx to
build against.
This commit is contained in:
Rafael Kitover 2018-06-18 04:04:47 -07:00
parent 437b366e39
commit 46f5294129
1 changed files with 15 additions and 11 deletions

View File

@ -76,18 +76,22 @@ SET(wxWidgets_USE_UNICODE ON)
set(wxWidgets_USE_LIBS xrc xml html adv net core base)
#list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8)
# check for gtk4 then gtk3 packages first, some dists like arch rename the
# wx-config utility for these packages
foreach(gtk_ver 4 3)
# Check for gtk4 then gtk3 packages first, some dists like arch rename the
# wx-config utility for these packages to e.g. wx-config-gtk3
#
# Do not do the check if the WX_CONFIG env var is set.
if(NOT $ENV{WX_CONFIG})
foreach(gtk_ver 4 3)
set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk${gtk_ver})
find_package(wxWidgets QUIET)
if(wxWidgets_FOUND)
break()
endif()
endforeach()
endforeach()
if(NOT wxWidgets_FOUND)
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