我有一個路徑,我想擺脫一個特定的路徑 開始路徑。這是我目前的路徑CMake的 - 使用get_filename_component
macro(MY_MACRO base)
foreach(ITEM ${ARGN})
get_filename_component(ITEM_PATH ${ITEM} DIRECTORY)
get_filename_component(ITEM_EXT ${ITEM} EXT)
source_group("${ITEM_PATH}" FILES ${ITEM})
MESSAGE ("${ITEM_PATH}")
endforeach()
endmacro()
上述輸出這個
/Users/admin/main/project/module/pilot/pilot/src/proA
/Users/admin/main/project/module/pilot/guide/src/proB
得到一個路徑
我希望它只顯示從最後一級開始的路徑 它應該只顯示文件夾試點 之後的路徑,所以它應該顯示類似這樣的內容
pilot/src/proA
guide/src/proB
不完整路徑
只是好奇,爲什麼? – Joel