From ffb06c23acb78a905b39c0808316e9398def821d Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Sun, 4 Dec 2011 03:37:02 +0100 Subject: [PATCH] Added version check for wxWidgets. If the systemwide wxWidgets is too old, we can fall back to the version from Externals instead of letting the build fail. Note that while the version in Externals appears to be wxWidgets 2.8, it has post-2.8 features manually added to it (wxAuiToolBar), so the version check only accepts 2.9 or higher. --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e28cc901d4..3648c82e52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -388,6 +388,21 @@ if(NOT DISABLE_WX) include(FindwxWidgets OPTIONAL) FIND_PACKAGE(wxWidgets COMPONENTS core aui adv) + if(wxWidgets_FOUND) + EXECUTE_PROCESS( + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --version + OUTPUT_VARIABLE wxWidgets_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + message("Found wxWidgets version ${wxWidgets_VERSION}") + if(${wxWidgets_VERSION} VERSION_LESS "2.9.0") + message("At least 2.9.0 is required; ignoring found version") + unset(wxWidgets_FOUND) + endif() + endif(wxWidgets_FOUND) + if(wxWidgets_FOUND) include(${wxWidgets_USE_FILE})