summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-17 15:25:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-17 15:25:31 (GMT)
commited1b3430fcfc906780b68fe4a073590c6d23ff08 (patch)
treed802d166076e7fc69d2d23a41386429a7ddc92b0 /Modules
parent0cd86338e0ca8f7706945b20c41805529524a8d5 (diff)
parentbf643286d32b569d20e7b7431ecc8755443fe5c4 (diff)
downloadCMake-ed1b3430fcfc906780b68fe4a073590c6d23ff08.zip
CMake-ed1b3430fcfc906780b68fe4a073590c6d23ff08.tar.gz
CMake-ed1b3430fcfc906780b68fe4a073590c6d23ff08.tar.bz2
Merge topic 'FindwxWidgets-msys2-paths'
bf643286 FindwxWidgets: Resolve Cygwin/MSYS paths to Windows paths
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindwxWidgets.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 49ce57e..8c07e6c 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -835,6 +835,36 @@ else()
endif()
endif()
+ # When using wx-config in MSYS, the include paths are UNIX style paths which may or may
+ # not work correctly depending on you MSYS/MinGW configuration. CMake expects native
+ # paths internally.
+ if(wxWidgets_FOUND AND MSYS)
+ find_program(_cygpath_exe cygpath ONLY_CMAKE_FIND_ROOT_PATH)
+ DBG_MSG_V("_cygpath_exe: ${_cygpath_exe}")
+ if(_cygpath_exe)
+ set(_tmp_path "")
+ foreach(_path ${wxWidgets_INCLUDE_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}")
+ set(_tmp_path "${_tmp_path} ${_native_path}")
+ endif()
+ endforeach()
+ DBG_MSG("Setting wxWidgets_INCLUDE_DIRS = ${_tmp_path}")
+ set(wxWidgets_INCLUDE_DIRS ${_tmp_path})
+ separate_arguments(wxWidgets_INCLUDE_DIRS)
+ list(REMOVE_ITEM wxWidgets_INCLUDE_DIRS "")
+ endif()
+ unset(_cygpath_exe CACHE)
+ endif()
+
#=====================================================================
# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE
#=====================================================================