<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Disclaimer: I cannot speak to intent, and have never used these before.<div class=""><br class=""></div><div class="">So since you’re cross compiling, when looking at the docs ( <a href="https://cmake.org/cmake/help/v3.0/command/file.html" class="">https://cmake.org/cmake/help/v3.0/command/file.html</a> ), I <b class="">think</b> you can get away with using TO_CMAKE_PATH.  I do <b class="">not</b> know how you actually determine this, but the idea would be</div><div class=""><br class=""></div><div class="">if (CMAKE_CROSSCOMPILING)</div><div class="">  if (… host is windows …)</div><div class="">      if (… target is unix …)</div><div class="">        … use TO_CMAKE_PATH …</div><div class="">      else()</div><div class="">        … use TO_NATIVE_PATH …</div><div class="">      endif()</div><div class="">  else() # … host is unix …</div><div class="">    if (… target is unix …)</div><div class="">      … use TO_CMAKE_PATH or TO_NATIVE_PATH …</div><div class="">    else() # … target is windows</div><div class="">      … PROBLEM …</div><div class="">    endif()</div><div class="">endif()</div><div class=""><br class=""></div><div class="">That is, I think if you are compiling <b class="">on</b> Windows <b class="">for</b> Unix, you can cheat and use TO_CMAKE_PATH to get unix style paths.  But if you are compiling <b class="">on</b> unix <b class="">for</b> Windows, I don’t know how you get it to be Windows paths.</div><div class=""><br class=""></div><div class="">But if this does solve Windows -> Unix, you could maybe just message(FATAL_ERROR …) saying that cross compiling for Windows from Unix is not supported.  You could also take a look at the implementation of TO_NATIVE_PATH and just snag the Windows code and make your own function that converts it, maybe calling it to_windows_path() or something?</div><div class=""><br class=""></div><div class="">I hope that is helpful, but I really don’t know if anything in the above is possible :/</div><div class=""><br class=""></div></body></html>