diff options
author | Maarten Bent <MaartenBent@users.noreply.github.com> | 2022-07-05 22:07:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-07-06 13:58:48 (GMT) |
commit | 6dce42b1718a4947bfeaded77a127e6672c46815 (patch) | |
tree | 327538bbb876131b60b065c722a779f37cf88e40 /Modules/FindwxWidgets.cmake | |
parent | 9b051f557eef1ed99ba264f5528a00818413f34d (diff) | |
download | CMake-6dce42b1718a4947bfeaded77a127e6672c46815.zip CMake-6dce42b1718a4947bfeaded77a127e6672c46815.tar.gz CMake-6dce42b1718a4947bfeaded77a127e6672c46815.tar.bz2 |
FindwxWidgets: Restore win32 find style on MinGW
Since commit 6fac8af9ca (FindwxWidgets: set wxWidgets_FIND_STYLE to unix
on MINGW, 2022-04-11, v3.24.0-rc1~296^2), we only tried unix find style
on MinGW. However, only some MinGW builds have the `wx-config` needed
for unix find style. Other builds, including those using the official
wxWidgets makefiles, do not provide `wx-config` and need to use win32
find style. To accommodate both use cases, first use win32 find style
and if it fails, use unix find style.
Diffstat (limited to 'Modules/FindwxWidgets.cmake')
-rw-r--r-- | Modules/FindwxWidgets.cmake | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 9e7937e..3b80b2d 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -53,8 +53,6 @@ the following variables: wxWidgets_USE_UNIVERSAL wxWidgets_USE_STATIC - - There is also a wxWidgets_CONFIG_OPTIONS variable for all other options that need to be passed to the wx-config utility. For example, to use the base toolkit found in the /usr/local path, set the variable @@ -244,7 +242,7 @@ endmacro() #===================================================================== # Determine whether unix or win32 paths should be used #===================================================================== -if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT MINGW AND NOT CMAKE_CROSSCOMPILING) +if(WIN32 AND NOT CYGWIN AND NOT MSYS AND NOT CMAKE_CROSSCOMPILING) set(wxWidgets_FIND_STYLE "win32") else() set(wxWidgets_FIND_STYLE "unix") @@ -652,11 +650,17 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") endif() endif() + if(MINGW AND NOT wxWidgets_FOUND) + # Try unix search mode as well. + set(wxWidgets_FIND_STYLE "unix") + dbg_msg_v("wxWidgets_FIND_STYLE changed to unix") + endif() +endif() + #===================================================================== # UNIX_FIND_STYLE #===================================================================== -else() - if(wxWidgets_FIND_STYLE STREQUAL "unix") +if(wxWidgets_FIND_STYLE STREQUAL "unix") #----------------------------------------------------------------- # UNIX: Helper MACROS #----------------------------------------------------------------- @@ -920,19 +924,6 @@ else() endif() unset(_cygpath_exe CACHE) endif() - -#===================================================================== -# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE -#===================================================================== - else() - if(NOT wxWidgets_FIND_QUIETLY) - message(STATUS - "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n" - " Platform unknown/unsupported. It's neither WIN32 nor UNIX " - "find style." - ) - endif() - endif() endif() # Check that all libraries are present, as wx-config does not check it |