[Qt-creator] Show all project files in stocked CMake plugin in Hackers way

Alexander Drozdov adrozdoff at gmail.com
Wed Jan 18 13:02:06 CET 2017


Not a question, just a life-hack :-)

Changes, that allows showing all project files in project view is discarded
<https://codereview.qt-project.org/#/c/180827/>. Clarification that Project
View is not a Project View but Build System View is added
to the documentation. So, now there is no way to propagate
CMakeProjectManager2 <https://github.com/h4tr3d/cmakeprojectmanager2>
changes to the upstream at all.

But we can still display all files using stock plugin and existing
functionality. Just hack it using fake CMAKE_TOOLCHAIN_FILE...

*Idea: *
- using `file(GLOB_RECURSE ...)` scan project tree for files
- create fake target ALL_PROJECT_FILES with this files
- put it to the fake toolchain file to avoid modification of the original
- pass fake toolchain file to the cmake executable via Kit CMake


Solution allows to configure globbing expression for scanner per build
configuration. Via Kit CMake configuration it can be configured per-kit.
Look into Gist for complete instruction.

*Screen shot:*

It can be extended to allow passing exclude globbing expression.

WBR, Alexander Drozdov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20170118/324e91fb/attachment.html>

More information about the Qt-creator mailing list