FindwxWindows¶
自版本 3.0 起已棄用: 已由 FindwxWidgets
取代。
尋找 wxWindows (wxWidgets) 安裝
此模組會尋找 wxWindows/wxWidgets 是否已安裝,並判斷 include 檔和函式庫的位置。它也會判斷函式庫的名稱。此程式碼會設定以下變數
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++
為了方便起見,請在您的專案的 CMakeLists.txt 中包含 Use_wxWindows.cmake,方法是使用 include(${CMAKE_CURRENT_LIST_DIR}/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)