file(TO_NATIVE_PATH ... ) and cross-compiling

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

file(TO_NATIVE_PATH ... ) and cross-compiling

Miroslav Keš
Hi!

I have question concerning the file(TO_NATIVE_PATH ...) behavior. The documentation says:

"The TO_NATIVE_PATH mode converts a cmake-style <path> into a native path with platform-specific slashes (\ on Windows and / elsewhere)."

... but it doesn't say if the decision is made based on the CMAKE_SYSTEM_NAME or the CMAKE_HOST_SYSTEM_NAME.

I have a project that builds the code for multiple platforms. The conversion works OK when building for Linux on Linux host or when building for Windows on a Windows host.
But if I cross-compile on a Windows for a non-Windows platform, the file(TO_NATIVE_PATH ...) converts paths to the target "non Windows" platform convention.

Is this the expected behavior?

I was going to use it when calling external programs on the build host (e.g. to generate Doxygen config file from a template using configure_file() ).
But it doesn't work because of the target host path convention output.

Thanks.

Mira
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake