diff options
author | Brad King <brad.king@kitware.com> | 2015-09-10 15:29:54 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-09-10 15:29:54 (GMT) |
commit | bae6eee13a37b9af42ad4a7af65e8e1a9139485c (patch) | |
tree | cd7cc85167ac3d178eee858bb1ed1a11ea61ad3d | |
parent | fe0e9a35cec24f653c60f48b9f0250aec7e5000b (diff) | |
parent | d8e233d87845d8e52328bd5be8a04a363653cf67 (diff) | |
download | CMake-bae6eee13a37b9af42ad4a7af65e8e1a9139485c.zip CMake-bae6eee13a37b9af42ad4a7af65e8e1a9139485c.tar.gz CMake-bae6eee13a37b9af42ad4a7af65e8e1a9139485c.tar.bz2 |
Merge topic 'FindwxWidgets-updates'
d8e233d8 Help: Add notes for topic 'FindwxWidgets-updates'
15aacb68 FindwxWidgets: Add wxWidgets webview component
8122fbd0 FindwxWidgets: Expect wxWidgets 3.1
6089fde5 FindwxWidgets: allow specifying required version
-rw-r--r-- | Help/release/dev/FindwxWidgets-updates.rst | 4 | ||||
-rw-r--r-- | Modules/FindwxWidgets.cmake | 39 |
2 files changed, 38 insertions, 5 deletions
diff --git a/Help/release/dev/FindwxWidgets-updates.rst b/Help/release/dev/FindwxWidgets-updates.rst new file mode 100644 index 0000000..aa470f2 --- /dev/null +++ b/Help/release/dev/FindwxWidgets-updates.rst @@ -0,0 +1,4 @@ +FindwxWidgets-updates +--------------------- + +* The :module:`FindwxWidgets` module learned to support version requests. diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 9a70678..54a74f6 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -302,6 +302,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # Find wxWidgets multilib base libraries. find_library(WX_base${_DBG} NAMES + wxbase31${_UCD}${_DBG} wxbase30${_UCD}${_DBG} wxbase29${_UCD}${_DBG} wxbase28${_UCD}${_DBG} @@ -315,6 +316,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") foreach(LIB net odbc xml) find_library(WX_${LIB}${_DBG} NAMES + wxbase31${_UCD}${_DBG}_${LIB} wxbase30${_UCD}${_DBG}_${LIB} wxbase29${_UCD}${_DBG}_${LIB} wxbase28${_UCD}${_DBG}_${LIB} @@ -330,6 +332,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # Find wxWidgets monolithic library. find_library(WX_mono${_DBG} NAMES + wxmsw${_UNV}31${_UCD}${_DBG} wxmsw${_UNV}30${_UCD}${_DBG} wxmsw${_UNV}29${_UCD}${_DBG} wxmsw${_UNV}28${_UCD}${_DBG} @@ -346,6 +349,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") stc ribbon propgrid webview) find_library(WX_${LIB}${_DBG} NAMES + wxmsw${_UNV}31${_UCD}${_DBG}_${LIB} wxmsw${_UNV}30${_UCD}${_DBG}_${LIB} wxmsw${_UNV}29${_UCD}${_DBG}_${LIB} wxmsw${_UNV}28${_UCD}${_DBG}_${LIB} @@ -386,7 +390,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # Clear wxWidgets multilib libraries. foreach(LIB core adv aui html media xrc dbgrid gl qa richtext - stc ribbon propgrid) + webview stc ribbon propgrid) WX_CLEAR_LIB(WX_${LIB}${_DBG}) endforeach() endmacro() @@ -741,7 +745,7 @@ else() #----------------------------------------------------------------- # Support cross-compiling, only search in the target platform. find_program(wxWidgets_CONFIG_EXECUTABLE - NAMES wx-config wx-config-3.0 wx-config-2.9 wx-config-2.8 + NAMES wx-config wx-config-3.1 wx-config-3.0 wx-config-2.9 wx-config-2.8 DOC "Location of wxWidgets library configuration provider binary (wx-config)." ONLY_CMAKE_FIND_ROOT_PATH ) @@ -857,6 +861,28 @@ else() endif() endif() +# Check if a specfic version was requested by find_package(). +if(wxWidgets_FOUND) + find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH) + dbg_msg("_filename: ${_filename}") + + if(NOT _filename) + message(FATAL_ERROR "wxWidgets wx/version.h file not found in ${wxWidgets_INCLUDE_DIRS}.") + endif() + + file(READ ${_filename} _wx_version_h) + + string(REGEX REPLACE "^(.*\n)?#define +wxMAJOR_VERSION +([0-9]+).*" + "\\2" wxWidgets_VERSION_MAJOR "${_wx_version_h}" ) + string(REGEX REPLACE "^(.*\n)?#define +wxMINOR_VERSION +([0-9]+).*" + "\\2" wxWidgets_VERSION_MINOR "${_wx_version_h}" ) + string(REGEX REPLACE "^(.*\n)?#define +wxRELEASE_NUMBER +([0-9]+).*" + "\\2" wxWidgets_VERSION_PATCH "${_wx_version_h}" ) + set(wxWidgets_VERSION_STRING + "${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}.${wxWidgets_VERSION_PATCH}" ) + dbg_msg("wxWidgets_VERSION_STRING: ${wxWidgets_VERSION_STRING}") +endif() + # Debug output: DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}") DBG_MSG("wxWidgets_INCLUDE_DIRS : ${wxWidgets_INCLUDE_DIRS}") @@ -867,10 +893,13 @@ DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}") #===================================================================== #===================================================================== + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND) -# Maintain consistency with all other variables. -set(wxWidgets_FOUND ${WXWIDGETS_FOUND}) + +find_package_handle_standard_args(wxWidgets + REQUIRED_VARS wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS + VERSION_VAR wxWidgets_VERSION_STRING + ) #===================================================================== # Macros for use in wxWidgets apps. |