cmake: fix regression in finding wx from 2efcb620
Clear FindwxWidgets module variables from the cache after each unsuccessful try with WX_CONFIG_EXECUTABLE set, otherwise the succeeding find_package(wxWidgets) call with WX_CONFIG_EXECUTABLE unset will fail, as it does with cmake on gentoo.
This commit is contained in:
parent
594ecc3947
commit
f78d45c038
|
@ -65,6 +65,14 @@ function(normalize_wx_paths)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(clear_wx_vars)
|
||||||
|
unset(wxWidgets_FOUND PARENT_SCOPE CACHE FORCE)
|
||||||
|
unset(wxWidgets_INCLUDE_DIRS PARENT_SCOPE CACHE FORCE)
|
||||||
|
unset(wxWidgets_LIBRARIES PARENT_SCOPE CACHE FORCE)
|
||||||
|
unset(wxWidgets_LIBRARY_DIRS PARENT_SCOPE CACHE FORCE)
|
||||||
|
unset(wxWidgets_CXX_FLAGS PARENT_SCOPE CACHE FORCE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
if(CMAKE_PREFIX_PATH)
|
if(CMAKE_PREFIX_PATH)
|
||||||
set(wxWidgets_CONFIG_OPTIONS "--prefix=${CMAKE_PREFIX_PATH}")
|
set(wxWidgets_CONFIG_OPTIONS "--prefix=${CMAKE_PREFIX_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
@ -87,6 +95,7 @@ if("$ENV{WX_CONFIG}" STREQUAL "")
|
||||||
if(wxWidgets_FOUND)
|
if(wxWidgets_FOUND)
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
|
clear_wx_vars()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(NOT wxWidgets_FOUND)
|
if(NOT wxWidgets_FOUND)
|
||||||
|
|
Loading…
Reference in New Issue