cmake how to create vs file filters

用cmakelists构建出来的工程,没有文件filters,可采用如下方法解决

set(SOURCE_LIST
    "lotteryTicket.cpp"
    "stdafx.cpp"
	"stdafx.h"
    "test/main.cpp"
)

add_executable(lotteryTicket ${SOURCE_LIST})

# Create the source groups for source tree with root at CMAKE_CURRENT_SOURCE_DIR.
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCE_LIST})

  

可以看到我们的文件结构出来了。。。

相关链接:https://stackoverflow.com/questions/31422680/how-to-set-visual-studio-filters-for-nested-sub-directory-using-cmake

猜你喜欢

转载自www.cnblogs.com/likemao/p/11061951.html