[CMake] Get path without Windows drive letter

Konstantin Tokarev annulen at yandex.ru
Thu Dec 1 09:17:50 EST 2016


Hello,

On Windows, is there any better way to strip out drive letter from path besides using REGEX REPLACE? I looked at get_filename_component but didn't find anything appropriate.

What I'm doing at higher level is transposition of CMAKE_INSTALL_PREFIX with DESTDIR variable, like what install(FILES) is doing. I cannot use built-in DESTDIR support because I need to pass modified path to external program. Is there any better way to achieve that?

Thanks!

-- 
Regards,
Konstantin


More information about the CMake mailing list