FindwxWindows¶
自 3.0 版本弃用: 替换为:module:FindwxWidgets。
找到wxWindows(wxWidgets) 安装
该模块查找是否安装了 wxWindows/wxWidgets 并确定包含文件和库的位置。它还确定库的名称是什么。此代码设置以下变量:
WXWINDOWS_FOUND = system has WxWindows
WXWINDOWS_LIBRARIES = path to the wxWindows libraries
on Unix/Linux with additional
linker flags from
"wx-config --libs"
CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
essentially "`wx-config --cxxflags`"
on Linux
WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
Unix
WXWINDOWS_DEFINITIONS = extra defines
选项 如果您需要 OpenGL 支持,请
set(WXWINDOWS_USE_GL 1)
在您的 CMakeLists.txt *之前*您包含此文件。
HAVE_ISYSTEM - true required to replace -I by -isystem on g++
为方便起见,使用 include(${CMAKE_CURRENT_LIST_DIR}/Use_wxWindows.cmake) 在项目的 CMakeLists.txt 中包含 Use_wxWindows.cmake。
用法
set(WXWINDOWS_USE_GL 1)
find_package(wxWindows)
注释 wxWidgets 2.6.x 支持整体构建,例如在 wx/build/msw 目录中编译为:
nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
弃用
CMAKE_WX_CAN_COMPILE
WXWINDOWS_LIBRARY
CMAKE_WX_CXX_FLAGS
WXWINDOWS_INCLUDE_PATH
作者 Jan Woetzel (07/2003-01/2006)