一直提示这个内容this file does not belong to any project target;code insight features might not work property.
这是我的CMake
get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" ProjectId ${ProjectId})
project(${ProjectId} C) #表示是个C项目
set(CMAKE_C_STANDARD 11)
#遍历cmake所在文件夹下的所有 .c文件
file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
foreach(file ${files})
get_filename_component(name ${file} NAME)
add_executable(${name} ${file})
endforeach()