Skip to content
Permalink
Browse files

simplify check for renamed wx-config, fix gentoo

Use find_program() to check for the existance of wx-config-gtk4, then
wx-config-gtk3 and finally wx-config, instead of calling find_package()
for each separately, FindwxWidgets module does not like being called
multiple times, it screws up some cache variables.
  • Loading branch information...
rkitover committed Aug 6, 2018
1 parent 3b44a29 commit be508eb2fd31ee39011d4622567395a655b0e4c8
Showing with 2 additions and 21 deletions.
  1. +2 −21 src/wx/CMakeLists.txt
@@ -65,14 +65,6 @@ function(normalize_wx_paths)
endif()
endfunction()

macro(clear_wx_vars)
unset(wxWidgets_FOUND CACHE)
unset(wxWidgets_INCLUDE_DIRS CACHE)
unset(wxWidgets_LIBRARIES CACHE)
unset(wxWidgets_LIBRARY_DIRS CACHE)
unset(wxWidgets_CXX_FLAGS CACHE)
endmacro()

if(CMAKE_PREFIX_PATH)
set(wxWidgets_CONFIG_OPTIONS "--prefix=${CMAKE_PREFIX_PATH}")
endif()
@@ -88,19 +80,8 @@ set(wxWidgets_USE_LIBS xrc xml html adv net core base)
# 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("$ENV{WX_CONFIG}" STREQUAL "")
foreach(gtk_ver 4 3)
set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk${gtk_ver})
find_package(wxWidgets QUIET)
if(wxWidgets_FOUND)
break()
endif()
clear_wx_vars()
endforeach()

if(NOT wxWidgets_FOUND)
unset(wxWidgets_CONFIG_EXECUTABLE)
endif()
if(NOT WIN32 AND NOT APPLE AND "$ENV{WX_CONFIG}" STREQUAL "")
find_program(wxWidgets_CONFIG_EXECUTABLE NAMES wx-config-gtk4 wx-config-gtk3 wx-config)
endif()

# the gl lib may not be available, and if it looks like it is we still have to

0 comments on commit be508eb

Please sign in to comment.
You can’t perform that action at this time.