1

I'm using CMake for a C++ project. When I create a CodeLite workspace with cmake -G "CodeLite - Unix Makefiles", I have to manually add header files into the workspace - I guess, because they aren't listed in any CMakeLists.txt.

Is there a way to configure the generation of the CodeLite project in a way that header files (and other #included files, such as template definitions) are also included?

In this question it seems like I'd have to include all header files in the appropriate CMakeLists.txt. I'd vastly prefer it if I don't have to do that. Is that possible?

RL-S
  • 734
  • 6
  • 21
  • "I'd vastly prefer it if I don't have to do that." - What **exactly** you want to avoid? Typing all header manually? - You may always use `file(GLOB)` for collect all headers in a directory. – Tsyvarev Mar 17 '20 at 22:01
  • Yes, I want to avoid putting in all header files manually. Using file(GLOB) is discouraged by the CMake documentation, so I'd rather avoid that as well. The point is, that ```make``` knows which header files are required, without putting them into a CMakeLists.txt. So that information is available *somewhere*. – RL-S Mar 18 '20 at 10:54
  • "The point is, that `make` knows which header files are required" - list of required headers is collected only during the **build** (and is updated every further build). So this list cannot be used by IDE which sees only the *configured* project. What IDE can is collecting **all header files** from some **include directories**. Which is mostly usable feature. – Tsyvarev Mar 18 '20 at 21:17

0 Answers0