FOREACH(FILE_PATH ${SRC_FILES})
文件名提取MESSAGE(${FILE_PATH})
STRING(REGEX REPLACE ".+/(.+)\\..*" "\\1" FILE_NAME ${FILE_PATH})
MESSAGE(${FILE_NAME})
ENDFOREACH(FILE_PATH)
⽰例:
E:/develop/glut_canvas/src/gl_graphic_base.cpp
gl_graphic_base
E:/develop/glut_canvas/src/glut_window.cpp
glut_window
E:/develop/glut_canvas/src/main.cpp
main
E:/develop/glut_canvas/src/gl_graphic_base.h
gl_graphic_base
E:/develop/glut_canvas/src/glut_window.h
glut_window
E:/develop/glut_canvas/src/point2d.h
point2d
E:/develop/glut_canvas/src/point2df.h
point2df
发布评论