Hi,
The annoying noob is back and is asking stupid questions again 
I am currently spending some time to figure out a useful directory structure for my use of headersβ¦
I still would like the everything to be as self cotained as possible, without my directory structure looking crowded⦠Please tell me which of the three structures you would prefer, or if there is even something better than the structures I am consdering.
Layout 1:
lib1/
βββ CMakeLists.txt
βββ lib1.cpp
βββ lib1.hpp
This would be my prefered option as far as looks, but then my cmake code for this library would need to look something like this:
add_library(lib1 lib1.cpp)
target_include_directories(lib1 PUBLIC .)
I think that this solution is a little bit jankyβ¦
Layout 2:
Another version of that that would probably be okay would be the following:
lib1/
βββ CMakeLists.txt
βββ include
β βββ lib1.hpp
βββ lib1.cpp
I donβt know if I could like this layout, but the cmake code would be nicer:
add_library(lib1 lib1.cpp)
target_include_directories(lib1 PUBLIC include)
I think that it will look a little clunky too, but at least header and implementation will still be close together. Which is not true for the next one.
Layout 3:
.
βββ CMakeLists.txt
βββ include
β βββ lib1
β βββ lib1.hpp
βββ src
βββ lib1
βββ lib1.cpp
This is a variation of a layout I was forced to use and that I quickly got sick of⦠Cmake code would roughly look like this:
add_library(lib1 src/lib1/lib1.cpp)
target_include_directories(lib1 PUBLIC include/lib1)