Kaynağa Gözat

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`.
Maarten Bent 3 yıl önce
ebeveyn
işleme
7d6e01801d
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      Modules/FindwxWidgets.cmake

+ 4 - 2
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)