FindwxWindows
Deprecated since version 3.0: Replaced by FindwxWidgets.
Finds the wxWidgets (formerly known as wxWindows) installation and determines the locations of its include directories and libraries, as well as the name of the library:
find_package(wxWindows [...])
wxWidgets 2.6.x is supported for monolithic builds, such as those compiled in the wx/build/msw directory using:
nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
Result Variables
This module defines the following variables:
-
WXWINDOWS_FOUND -
Boolean indicating whether the wxWidgets was found.
-
WXWINDOWS_LIBRARIES -
Libraries needed to link against to use wxWidgets. This includes paths to the wxWidgets libraries and any additional linker flags, typically derived from the output of
wx-config --libson Unix/Linux systems. -
CMAKE_WXWINDOWS_CXX_FLAGS -
Compiler options needed to use wxWidgets (if any). On Linux, this corresponds to the output of
wx-config --cxxflags. -
WXWINDOWS_INCLUDE_DIR -
The directory containing the
wx/wx.handwx/setup.hheader files. -
WXWINDOWS_LINK_DIRECTORIES -
Link directories, useful for setting
rpathon Unix-like platforms. -
WXWINDOWS_DEFINITIONS -
Extra compile definitions needed to use wxWidgets (if any).
Hints
This module accepts the following variables before calling the find_package(wxWindows):
-
WXWINDOWS_USE_GL -
Set this variable to boolean true to require OpenGL support.
-
HAVE_ISYSTEM -
Set this variable to boolean true to replace
-Icompiler options with-isystemwhen the C++ compiler is GNU (g++).
Deprecated Variables
The following variables are provided for backward compatibility:
-
CMAKE_WX_CAN_COMPILE -
Deprecated since version 1.8: Replaced by the
WXWINDOWS_FOUNDvariable with the same value. -
WXWINDOWS_LIBRARY -
Deprecated since version 1.8: Replaced by the
WXWINDOWS_LIBRARIESvariable with the same value. -
CMAKE_WX_CXX_FLAGS -
Deprecated since version 1.8: Replaced by the
CMAKE_WXWINDOWS_CXX_FLAGSvariable with the same value. -
WXWINDOWS_INCLUDE_PATH -
Deprecated since version 1.8: Replaced by the
WXWINDOWS_INCLUDE_DIRvariable with the same value.
Examples
Example: Finding wxWidgets in Earlier CMake Versions
In earlier versions of CMake, wxWidgets (wxWindows) could be found using:
find_package(wxWindows)
To request OpenGL support, the WXWINDOWS_USE_GL variable could be set before calling find_package():
set(WXWINDOWS_USE_GL ON) find_package(wxWindows)
Using wxWidgets (wxWindows) in CMake was commonly done by including the Use_wxWindows module, which would find wxWidgets and set the appropriate libraries, include directories, and compiler flags:
include(Use_wxWindows)
Example: Finding wxWidgets as of CMake 3.0
Starting with CMake 3.0, wxWidgets can be found using the FindwxWidgets module:
find_package(wxWidgets)
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/module/FindwxWindows.html