我有以下项目结构:
- CMakeLists.txt(顶层)
- 包括
- 源文件
- 例子
- CMakeLists.txt
- example.cpp
- src
- CMakeLists.txt
- source.cpp
Top level CMakeLists.txt
includes both src
and examples
using add_subdirectory
. I want to do the same with include
directory. I have no problem using the header files from include
. What I want is to be able to see include
directory in my IDE. Currently, QtCreator doesn't show include
directory if I open the top level CMake file with it.
I know that I can add dummy CMakeLists.txt
but that's a bit meh. Don't want to do this for code readers sanity sake.
add
include_directories(include/)
in your toplevelCMakeLists.txt
just before usingadd_subdirectory