microsoft/GSL

Make files visible in generated Visual Studio solution

Open

#1,216 创建于 2025年9月26日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)C++ (5,695 star) (721 fork)batch import
Help WantedPriority: LowStatus: Open

描述

If you generate a Visual studio solution from the current CMake the GSL headers like algorithm and assert don't appear. The only way you seem to be able to see them is to open a test like algorithm_tests.cpp and then do a "Go to document" on a line like #include <gsl/algorithm>. In my local copy I added the following

add_custom_target(include SOURCES
    gsl/algorithm
    gsl/assert
    gsl/byte
    gsl/gsl
    gsl/narrow
    gsl/pointers	
    gsl/span
    gsl/span_ext
    gsl/util	
    gsl/zstring		
)

But I am sure that is the wrong way to do it.

I also added

set(SolutionItems
    .clang-format
    .gitattributes
    .gitignore
    CMakeSettings.json
    CONTRIBUTING.md
    LICENSE
    README.md
    SECURITY.md
    ThirdPartyNotices.txt)
set_property(DIRECTORY APPEND PROPERTY VS_SOLUTION_ITEMS ${SolutionItems})

This makes all these files appears in the "Solution Items" folder in the IDE which is super useful.

贡献者指南