The evil CMake -- File system, path notation, slash

CMake file system use the front-slash '/' as the path seperator, but under Windows systems, this can cause problems(we all know that Windows use the back-slash '\' as the path seperator), especially in command line.

CMake has provided us the command FILE(TO_NATIVE_PATH) to convert CMake path into the native system path, and FILE(TO_CMAKE_PATH), vice versa. The example is:

# Convert CMake path into native path
FILE(TO_NATIVE_PATH ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} NATIVE_OUTPUT_PATH)
MESSAGE(STATUS "This is the native output path=" ${NATIVE_OUTPUT_PATH})


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章