How to build wxWidgets program using CMake

Configuring a project that uses wxWidgets to build on Windows is quite simple. However, on Linux the same task is a bit more involved and requires using the wx-config program.

CMake has support for wxWidgets, but requires knowing the right incantations to build. A minimal CMakeLists.txt for building a wxWidgets program is given below:

This includes the core and base wxWidgets libraries. If you use any other wxWidgets modules, like wxGLCanvas for example, then include the relevant modules, like gl in the find_package command.

Tried with: wxWidgets 3.0, CMake and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s