开发者

How to get CMake to add files to MSVC's Solution tree?

开发者 https://www.devze.com 2023-01-27 05:50 出处:网络
Is there a way to get CMake to add files to MSVC\'s Solution Explorer tree as for example a \"Solution item\"? I have placed a bunch of CMake macros in a file called开发者_运维知识库 \"helper_function

Is there a way to get CMake to add files to MSVC's Solution Explorer tree as for example a "Solution item"? I have placed a bunch of CMake macros in a file called开发者_运维知识库 "helper_functions.cmake" and would like this file to appear in MSVC's Solution Explorer. This is so that team members can see that the file exists, (as per the CMakeLists.txt files that appear under their projects in the Solution Explorer tree).


source_group("Helper Macros" FILES helper_functions.cmake) see more info at http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:source_group


You can just add the file to the sources of the library or executable

PROJECT(FooBar)

ADD_EXECUTABLE(FooBar 
                main.cpp
                helper_functions.cmake # additional file
               )
0

精彩评论

暂无评论...
验证码 换一张
取 消