diff options
author | ARATA Mizuki <minorinoki@gmail.com> | 2018-04-04 16:01:21 (GMT) |
---|---|---|
committer | ARATA Mizuki <minorinoki@gmail.com> | 2018-04-04 16:37:57 (GMT) |
commit | 44ad8e48def8d98eaff8fd6deb11731520183daa (patch) | |
tree | 67958462d13260d680773181b5ea89cc2a9e1bfd /Modules/FindwxWidgets.cmake | |
parent | 3201e4c156fcf79a7c29a73430e72b1bcd43cedc (diff) | |
download | CMake-44ad8e48def8d98eaff8fd6deb11731520183daa.zip CMake-44ad8e48def8d98eaff8fd6deb11731520183daa.tar.gz CMake-44ad8e48def8d98eaff8fd6deb11731520183daa.tar.bz2 |
FindwxWidgets: Fix wxWidgets_LIBRARY_DIRS on Cygwin/MSYS
The check for `wxWidgets_LIBRARIES` variable, introduced by e8b77084, fails
with the `wx-config` script generated by an MSYS build, because
`wxWidgets_LIBRARY_DIRS` is in POSIX style.
This commit fixes the problem with `wxWidgets_LIBRARY_DIRS` by converting it to
Windows style. The actual code were copied from bf643286, which does the same
thing for `wxWidgets_INCLUDE_DIRS`.
Diffstat (limited to 'Modules/FindwxWidgets.cmake')
-rw-r--r-- | Modules/FindwxWidgets.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 202d481..1cfc624 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -875,6 +875,26 @@ else() set(wxWidgets_INCLUDE_DIRS ${_tmp_path}) separate_arguments(wxWidgets_INCLUDE_DIRS) list(REMOVE_ITEM wxWidgets_INCLUDE_DIRS "") + + set(_tmp_path "") + foreach(_path ${wxWidgets_LIBRARY_DIRS}) + execute_process( + COMMAND cygpath -w ${_path} + OUTPUT_VARIABLE _native_path + RESULT_VARIABLE _retv + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + if(_retv EQUAL 0) + file(TO_CMAKE_PATH ${_native_path} _native_path) + DBG_MSG_V("Path ${_path} converted to ${_native_path}") + string(APPEND _tmp_path " ${_native_path}") + endif() + endforeach() + DBG_MSG("Setting wxWidgets_LIBRARY_DIRS = ${_tmp_path}") + set(wxWidgets_LIBRARY_DIRS ${_tmp_path}) + separate_arguments(wxWidgets_LIBRARY_DIRS) + list(REMOVE_ITEM wxWidgets_LIBRARY_DIRS "") endif() unset(_cygpath_exe CACHE) endif() |