Building wxWidgets

A short guide on how to build wxWidgets (the cross-platform GUI toolkit) from source (the recommended way), on Windows, by using CMake and Visual Studio.

  1. Download the source code for the latest stable release
    (by the way: For version 3.2.8 the ZIP file is ~40 MiB in size, while the 7z file is only ~22 MiB).

  2. Extract the downloaded archive file (for example to C:\temp\wxWidgets).

  3. Configure (prepare) the buildsystem.
    And define the installation destination directory, for later (wxWidgets can’t handle cmake –install yet).

     C:\temp\wxWidgets> cmake -DCMAKE_INSTALL_PREFIX=C:\install\to\wxWidgets\3.2.8 -S . -B .\_build -G "Visual Studio 17 2022" -A x64
    
  4. Trigger the build process; at the end, the built artifacts will be installed to the previously defined destination path:

     C:\temp\wxWidgets> cmake --build .\_build --target install 
    

Done!

Further Reading

And for writing programs based on wxWidgets, I’ve recently discovered an interesting page (but not yet read fully):