CMake convert unix to windows path -


i'm trying convert unix style msys path such /c/my/path/to/a/folder windows path, or cmake understand, e.g c:/my/path/to/a/folder. i'd work on path correct.

is there proper way ?

note : please not mention cygwin's cygpath.

edit: file(to_cmake_path mypath result) not working

there's no built-in cmake functionality this, can write function/macro it:

macro(msys_to_cmake_path msyspath resultingpath)   string(regex replace "^/([a-za-z])/" "\\1:/" ${resultingpath} "${msyspath}") endmacro()  set(mypath "/c/my/path/to/a/folder") msys_to_cmake_path(${mypath} result)  message("converted \"${mypath}\" \"${result}\".") 

having said that, agree antonio's comment in seems unusual need in first place.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -