QtCreator CMake的项目 - 如何显示所有项目文件 [英] QtCreator CMake project - how to show all project files

查看:1270
本文介绍了QtCreator CMake的项目 - 如何显示所有项目文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用QtCreator打开CMake的项目。除了一些的CMakeLists.txt目录仅包含邮件头文件的* .h和这些目录QtCreator项目树视图只显示的CMakeLists.txt。如何解决呢?我需要从QtCreator看到所有项目文件。

I use QtCreator to open CMake project. Some directories apart from CMakeLists.txt contains only headers files *.h and for those directories QtCreator in the project tree view shows only CMakeLists.txt. How to fix that ? I need to see all project files from QtCreator.

推荐答案

查看项目作为文件系统不是解决所有导致例如你的项目编辑器设置将不适用。
而且我不喜欢头加入到可执行的目标,因为他们实际上并不属于那里。您有效地削弱项目文件与一个特定的IDE ......不好很好地工作。
清洁工选项恕我直言将是:

Viewing project as a file system is not a solution at all cause your project editor settings for example would not apply. And I do not like to add headers to executable target, cause they do not actually belong there. You effectively cripple the project file to work nicely with one particular IDE... not good. The cleaner option IMHO would be:

FILE(GLOB_RECURSE LibFiles "include/*.hpp")
add_custom_target(headers SOURCES ${LibFiles})

作为奖励,你会得到你在一个单独的文件夹显示包括。
(从<借来的href=\"https://cmake.org/pipermail/cmake/2012-August/051811.html\">https://cmake.org/pipermail/cmake/2012-August/051811.html)

这篇关于QtCreator CMake的项目 - 如何显示所有项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆