From 6089fde554aedb4888c7114fa433d14375b8a213 Mon Sep 17 00:00:00 2001 From: Simon Richter Date: Sun, 6 Sep 2015 18:35:36 +0200 Subject: [PATCH 1/4] FindwxWidgets: allow specifying required version --- Modules/FindwxWidgets.cmake | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 9a706783f..0c95529b5 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -857,6 +857,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 +889,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. From 8122fbd0f57f546d46c5a9659fb12f1740042966 Mon Sep 17 00:00:00 2001 From: Simon Richter Date: Sun, 6 Sep 2015 18:35:37 +0200 Subject: [PATCH 2/4] FindwxWidgets: Expect wxWidgets 3.1 --- Modules/FindwxWidgets.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 0c95529b5..52aafd7a3 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} @@ -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 ) From 15aacb684a4416dc287cb165394b1115e9c4c4cc Mon Sep 17 00:00:00 2001 From: Simon Richter Date: Sun, 6 Sep 2015 18:35:38 +0200 Subject: [PATCH 3/4] FindwxWidgets: Add wxWidgets webview component --- Modules/FindwxWidgets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 52aafd7a3..54a74f610 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -390,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() From d8e233d87845d8e52328bd5be8a04a363653cf67 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 9 Sep 2015 10:22:39 -0400 Subject: [PATCH 4/4] Help: Add notes for topic 'FindwxWidgets-updates' --- Help/release/dev/FindwxWidgets-updates.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Help/release/dev/FindwxWidgets-updates.rst diff --git a/Help/release/dev/FindwxWidgets-updates.rst b/Help/release/dev/FindwxWidgets-updates.rst new file mode 100644 index 000000000..aa470f2da --- /dev/null +++ b/Help/release/dev/FindwxWidgets-updates.rst @@ -0,0 +1,4 @@ +FindwxWidgets-updates +--------------------- + +* The :module:`FindwxWidgets` module learned to support version requests.