From 7d6e01801d50d2960de3f5b269bf79951a48c42d Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 6 Jul 2022 01:09:34 +0200 Subject: FindwxWidgets: Do not reset wxWidgets_LIB_DIR unnecessarily Only reset it when `WX_ROOT_DIR` had a value. This change allows to set both `wxWidgets_LIB_DIR` and `wxWidgets_ROOT_DIR` at the same time when they where previously `-NOTFOUND`. --- Modules/FindwxWidgets.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 3b80b2d..19eba95 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -468,10 +468,12 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # If wxWidgets_ROOT_DIR changed, clear lib dir. if(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) + if(NOT wxWidgets_LIB_DIR OR WX_ROOT_DIR) + set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND" + CACHE PATH "Cleared." FORCE) + endif() set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR} CACHE INTERNAL "wxWidgets_ROOT_DIR") - set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND" - CACHE PATH "Cleared." FORCE) endif() if(WX_ROOT_DIR) -- cgit v0.12