Unable to change 'Source Code Directory' for wxWidgets-3.1.15 installation


My 1st attempt at a wxWidgets-3.1.15 installation failed using source directory ‘demo’. On 2nd attempt I extracted wxWidget-3.1.5 to directory ‘wxWidgets-3.1.15’.

When I reran CMake, it thinks the source is located in the previous installation directory (demo). I changed the source directory to the NEW directory, but it’s still pointing at the old source directory which no longer exists. How do I remove the old directory from CMake files?

CMake Error: The source “C:/Users/Jim/wxWidgets-3.1.5/CMakeLists.txt” does not match the source “C:/Users/Jim/demo/CMakeLists.txt” used to generate cache. Re-run cmake with a different source directory.

If you need to change the source directory, delete the contents of the build directory as well (technically, you only need to delete the CMakeCache.txt file from the build directory). CMake caches the location of the source directory and doesn’t allow you to change it, as you’ve discovered.

Thanks, Craig!