wxWidgets-CMake

This project is simply to provide a CMake build system for wxWidgets.

The project’s code is hosted on launchpad.

Project Scope

The project was originally started to aid the building of the KiCad Open Source project. In order to get python scripting working on Windows without the need to compile with MSVC the python-a-mingw-us project was created to have a python install that used a consistent CRT to code that was compiled and linked with the python interpreter DLL using MinGW gcc.

Previous to the python-a-mingw-us project, all python extensions on Windows needed to be compiled with MSVC which is a poor dependency to have for open source software.

The KiCad project also required wxPython in order to provide interactive GUI elements in python plugins. So this project is also required to support building wxPython too. This support is already present.

Releases

wxPython 2.9.4 has been released. wxWidgets 2.9.4 and wxWidgets 2.9.5 have also been released through the project. Go to the project page on Launchpad to check for the latest releases.

wxPython-cmake-2.9.4-src

wxPython-cmake-mswu-gcc_dll_cm-2.9.4-Win32 (ZIP)

wxPython-cmake-mswu-gcc_dll_cm-2.9.4-Win32 (TAR.BZ2)

Building

In order to build the project, simply place this project over the top of a vanilla 2.9.4 wxWidgets source tree, or a 2.9.4 wxPython source tree. For an easier experience, you can just checkout the relevant branch for either wxWidgets or wxPython. Alternatively you can download the relevant release’s source archive.

From a separate folder (usually something like bld or something in the tree) run something like:

[source]cmake -G "CodeBlocks – MinGW Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DWXUNICODE[/source]

For a shared release build. There are also various configuration batch files for configuring under the /configs source directory.

Using cmake to build a wxWidgets app

You can use the standard FindwxWidgets.cmake module to find wxWidgets. It is best to guide CMake explicitly to the binaries you want to use by setting ${wxWidgets_ROOT_DIR} to the root directory of your binary wxWidgets install. Otherwise you can read the FindwxWidgets.cmake module to find out what directories is searches to find standard installations. On Windows this is usually something like C:\wxWidgets-2.9.4

 

Leave a Reply