FindwxWidgets should check if paths are valid
FYI the following behavior was experienced on windows 10. As this module has a different chain of logic for win32 vs non-win32 it is highly probably this only affects win32.
The following configuration has an odd pitfall and some minor feature tweaks would save an intrepid user such as myself a ton of time...
set(wxWidgets_ROOT_DIR E:/wxWidgets-3.0.4)
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/vc_x64_lib)
The LIB_DIR has a typo - note that it is missing /lib/
. However, the module will succeed on the first run of Cmake if there is no cache. It appears to use the ROOT_DIR and ignore the (faulty) LIB_DIR. On any subsequent runs, the module notices that the specified LIB_DIR does not equal the cached (previously derived & correct) LIB_DIR and forcibly sets all relevant wx variables to NOTFOUND.
Two things would make this much better -
- check if a path exists, and print a warning if it does not
- provide a wxWidgets_DEBUG feature to enable all of the DBG macros in FindwxWidgets and UsewxWidgets
PS - This is particularly nasty in visual studio, which has a horrid habit of running Cmake twice back-to-back, with the first run being a foreground process showing output and the second run being the cmake-server and by default not displaying any output. That's not the fault of wxWidgets, but it made this pretty tough to debug without some output or warning about the issue