mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-08 00:30:48 +00:00
FindwxWidgets: Support more wxWidgets versions, including 3.2
Update the example to use a more recent wxWidgets version. Use a list with known version numbers when searching for installation directories and wx-config names.
This commit is contained in:
@@ -29,9 +29,9 @@ select a configuration):
|
|||||||
::
|
::
|
||||||
|
|
||||||
wxWidgets_ROOT_DIR - Base wxWidgets directory
|
wxWidgets_ROOT_DIR - Base wxWidgets directory
|
||||||
(e.g., C:/wxWidgets-2.6.3).
|
(e.g., C:/wxWidgets-3.2.0).
|
||||||
wxWidgets_LIB_DIR - Path to wxWidgets libraries
|
wxWidgets_LIB_DIR - Path to wxWidgets libraries
|
||||||
(e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
|
(e.g., C:/wxWidgets-3.2.0/lib/vc_x64_lib).
|
||||||
wxWidgets_CONFIGURATION - Configuration to use
|
wxWidgets_CONFIGURATION - Configuration to use
|
||||||
(e.g., msw, mswd, mswu, mswunivud, etc.)
|
(e.g., msw, mswd, mswu, mswunivud, etc.)
|
||||||
wxWidgets_EXCLUDE_COMMON_LIBRARIES
|
wxWidgets_EXCLUDE_COMMON_LIBRARIES
|
||||||
@@ -215,6 +215,9 @@ else()
|
|||||||
set(wxWidgets_USE_FILE UsewxWidgets)
|
set(wxWidgets_USE_FILE UsewxWidgets)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Known wxWidgets versions.
|
||||||
|
set(wx_versions 3.3 3.2 3.1 3.0 2.9 2.8 2.7 2.6 2.5)
|
||||||
|
|
||||||
macro(wx_extract_version)
|
macro(wx_extract_version)
|
||||||
unset(_wx_filename)
|
unset(_wx_filename)
|
||||||
find_file(_wx_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
|
find_file(_wx_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH)
|
||||||
@@ -443,6 +446,13 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
|||||||
# WIN32: Start actual work.
|
# WIN32: Start actual work.
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
set(wx_paths "wxWidgets")
|
||||||
|
foreach(version ${wx_versions})
|
||||||
|
foreach(patch RANGE 15 0 -1)
|
||||||
|
list(APPEND wx_paths "wxWidgets-${version}.${patch}")
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Look for an installation tree.
|
# Look for an installation tree.
|
||||||
find_path(wxWidgets_ROOT_DIR
|
find_path(wxWidgets_ROOT_DIR
|
||||||
NAMES include/wx/wx.h
|
NAMES include/wx/wx.h
|
||||||
@@ -454,41 +464,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
|||||||
D:/
|
D:/
|
||||||
ENV ProgramFiles
|
ENV ProgramFiles
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
wxWidgets-3.1.0
|
${wx_paths}
|
||||||
wxWidgets-3.0.2
|
|
||||||
wxWidgets-3.0.1
|
|
||||||
wxWidgets-3.0.0
|
|
||||||
wxWidgets-2.9.5
|
|
||||||
wxWidgets-2.9.4
|
|
||||||
wxWidgets-2.9.3
|
|
||||||
wxWidgets-2.9.2
|
|
||||||
wxWidgets-2.9.1
|
|
||||||
wxWidgets-2.9.0
|
|
||||||
wxWidgets-2.8.9
|
|
||||||
wxWidgets-2.8.8
|
|
||||||
wxWidgets-2.8.7
|
|
||||||
wxWidgets-2.8.6
|
|
||||||
wxWidgets-2.8.5
|
|
||||||
wxWidgets-2.8.4
|
|
||||||
wxWidgets-2.8.3
|
|
||||||
wxWidgets-2.8.2
|
|
||||||
wxWidgets-2.8.1
|
|
||||||
wxWidgets-2.8.0
|
|
||||||
wxWidgets-2.7.4
|
|
||||||
wxWidgets-2.7.3
|
|
||||||
wxWidgets-2.7.2
|
|
||||||
wxWidgets-2.7.1
|
|
||||||
wxWidgets-2.7.0
|
|
||||||
wxWidgets-2.7.0-1
|
|
||||||
wxWidgets-2.6.4
|
|
||||||
wxWidgets-2.6.3
|
|
||||||
wxWidgets-2.6.2
|
|
||||||
wxWidgets-2.6.1
|
|
||||||
wxWidgets-2.5.4
|
|
||||||
wxWidgets-2.5.3
|
|
||||||
wxWidgets-2.5.2
|
|
||||||
wxWidgets-2.5.1
|
|
||||||
wxWidgets
|
|
||||||
DOC "wxWidgets base/installation directory"
|
DOC "wxWidgets base/installation directory"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -773,12 +749,14 @@ else()
|
|||||||
# Look for wx-config -- this can be set in the environment,
|
# Look for wx-config -- this can be set in the environment,
|
||||||
# or try versioned and toolchain-versioned variants of the -config
|
# or try versioned and toolchain-versioned variants of the -config
|
||||||
# executable as well.
|
# executable as well.
|
||||||
|
set(wx_config_names "wx-config")
|
||||||
|
foreach(version ${wx_versions})
|
||||||
|
list(APPEND wx_config_names "wx-config-${version}" "wxgtk3u-${version}-config" "wxgtk2u-${version}-config")
|
||||||
|
endforeach()
|
||||||
find_program(wxWidgets_CONFIG_EXECUTABLE
|
find_program(wxWidgets_CONFIG_EXECUTABLE
|
||||||
NAMES
|
NAMES
|
||||||
$ENV{WX_CONFIG}
|
$ENV{WX_CONFIG}
|
||||||
wx-config
|
${wx_config_names}
|
||||||
wx-config-3.1 wx-config-3.0 wx-config-2.9 wx-config-2.8
|
|
||||||
wxgtk3u-3.1-config wxgtk3u-3.0-config wxgtk2u-2.8-config
|
|
||||||
DOC "Location of wxWidgets library configuration provider binary (wx-config)."
|
DOC "Location of wxWidgets library configuration provider binary (wx-config)."
|
||||||
ONLY_CMAKE_FIND_ROOT_PATH
|
ONLY_CMAKE_FIND_ROOT_PATH
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user