<small id='CUFcb'></small><noframes id='CUFcb'>

    • <bdo id='CUFcb'></bdo><ul id='CUFcb'></ul>

      1. <i id='CUFcb'><tr id='CUFcb'><dt id='CUFcb'><q id='CUFcb'><span id='CUFcb'><b id='CUFcb'><form id='CUFcb'><ins id='CUFcb'></ins><ul id='CUFcb'></ul><sub id='CUFcb'></sub></form><legend id='CUFcb'></legend><bdo id='CUFcb'><pre id='CUFcb'><center id='CUFcb'></center></pre></bdo></b><th id='CUFcb'></th></span></q></dt></tr></i><div id='CUFcb'><tfoot id='CUFcb'></tfoot><dl id='CUFcb'><fieldset id='CUFcb'></fieldset></dl></div>

        <legend id='CUFcb'><style id='CUFcb'><dir id='CUFcb'><q id='CUFcb'></q></dir></style></legend>
        <tfoot id='CUFcb'></tfoot>

      2. 列出由 cmake 生成的 Visual Studio C++ 项目中的头文件

        Listing header files in Visual Studio C++ project generated by cmake(列出由 cmake 生成的 Visual Studio C++ 项目中的头文件)
          <bdo id='ku4gl'></bdo><ul id='ku4gl'></ul>
        • <small id='ku4gl'></small><noframes id='ku4gl'>

          • <tfoot id='ku4gl'></tfoot>

                    <tbody id='ku4gl'></tbody>

                  <i id='ku4gl'><tr id='ku4gl'><dt id='ku4gl'><q id='ku4gl'><span id='ku4gl'><b id='ku4gl'><form id='ku4gl'><ins id='ku4gl'></ins><ul id='ku4gl'></ul><sub id='ku4gl'></sub></form><legend id='ku4gl'></legend><bdo id='ku4gl'><pre id='ku4gl'><center id='ku4gl'></center></pre></bdo></b><th id='ku4gl'></th></span></q></dt></tr></i><div id='ku4gl'><tfoot id='ku4gl'></tfoot><dl id='ku4gl'><fieldset id='ku4gl'></fieldset></dl></div>
                  <legend id='ku4gl'><style id='ku4gl'><dir id='ku4gl'><q id='ku4gl'></q></dir></style></legend>
                1. 本文介绍了列出由 cmake 生成的 Visual Studio C++ 项目中的头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在为我们的产品构建一个基于 cmake 的构建系统.问题是由 cmake 生成的 Visual Studio 项目没有在解决方案浏览器中显示头文件.

                  I'm building a cmake based build system for our product. The problem is that Visual Studio project, generated by cmake, doesn't display header files in solution browser.

                  我需要在 CMakeList.txt 中添加什么来列出头文件?首选的解决方案是不需要列出每个特定的头文件.

                  What I need to add in CMakeList.txt to list header files? The preferred solution is where no need to list each particular header file.

                  解决方案这是我带来的解决方案:

                  Solution Here is a solution I came with:

                  file(GLOB_RECURSE INCS "*.h")
                  add_library(myLib ${SRCS} ${INCS})
                  

                  谢谢

                  推荐答案

                  只需将头文件与源文件一起添加即可:

                  Just add the header files along with the source files:

                  PROJECT (Test)
                  
                  ADD_EXECUTABLE(Test test.cpp test.h)
                  

                  或者使用变量:

                  PROJECT (Test)
                  
                  SET(SOURCE
                    test.cpp
                  )
                  
                  SET(HEADERS
                    test.h
                  )
                  
                  ADD_EXECUTABLE(Test ${SOURCE} ${HEADERS})
                  

                  这篇关于列出由 cmake 生成的 Visual Studio C++ 项目中的头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C++ stl unordered_map implementation, reference validity(C++ stl unordered_map 实现,参考有效性)
                  C++: Is it possible to use a reference as the value in a map?(C++:是否可以使用引用作为映射中的值?)
                  Where ampersand quot;amp;quot; can be put when passing argument by reference?(其中符号“amp;通过引用传递参数时可以放置吗?)
                  Why can a non-const reference parameter be bound to a temporary object?(为什么可以将非常量引用参数绑定到临时对象?)
                  What is a dangling reference?(什么是悬空引用?)
                  C++ reference changes when push_back new element to std::vector(当 push_back 新元素到 std::vector 时,C++ 引用发生变化)

                  <small id='lXAOJ'></small><noframes id='lXAOJ'>

                  1. <legend id='lXAOJ'><style id='lXAOJ'><dir id='lXAOJ'><q id='lXAOJ'></q></dir></style></legend>
                        <bdo id='lXAOJ'></bdo><ul id='lXAOJ'></ul>
                        <tfoot id='lXAOJ'></tfoot>

                          1. <i id='lXAOJ'><tr id='lXAOJ'><dt id='lXAOJ'><q id='lXAOJ'><span id='lXAOJ'><b id='lXAOJ'><form id='lXAOJ'><ins id='lXAOJ'></ins><ul id='lXAOJ'></ul><sub id='lXAOJ'></sub></form><legend id='lXAOJ'></legend><bdo id='lXAOJ'><pre id='lXAOJ'><center id='lXAOJ'></center></pre></bdo></b><th id='lXAOJ'></th></span></q></dt></tr></i><div id='lXAOJ'><tfoot id='lXAOJ'></tfoot><dl id='lXAOJ'><fieldset id='lXAOJ'></fieldset></dl></div>
                              <tbody id='lXAOJ'></tbody>