How to get CMake to add files to MSVC's Solution tree?
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
)
精彩评论