Kaynağa Gözat

Merge topic 'findwxwidgets-msys-library-dirs'

44ad8e48de FindwxWidgets: Fix wxWidgets_LIBRARY_DIRS on Cygwin/MSYS

Acked-by: Kitware Robot <[email protected]>
Merge-request: !1930
Brad King 7 yıl önce
ebeveyn
işleme
d7af8a34b6
1 değiştirilmiş dosya ile 20 ekleme ve 0 silme
  1. 20 0
      Modules/FindwxWidgets.cmake

+ 20 - 0
Modules/FindwxWidgets.cmake

@@ -863,6 +863,26 @@ else()
         set(wxWidgets_INCLUDE_DIRS ${_tmp_path})
         set(wxWidgets_INCLUDE_DIRS ${_tmp_path})
         separate_arguments(wxWidgets_INCLUDE_DIRS)
         separate_arguments(wxWidgets_INCLUDE_DIRS)
         list(REMOVE_ITEM 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()
       endif()
       unset(_cygpath_exe CACHE)
       unset(_cygpath_exe CACHE)
     endif()
     endif()