I’m new to CMake and I have a c++ project that I’m trying to put together using cmake, much of the code exists already with classes in nested dirs. I am able to get it all to compile with something like this
add_library(${PROJECT_NAME} STATIC
./nested/folder/with/source.cc
)
target_include_directories(${PROJECT_NAME} PUBLIC
"."
"./nested/folder/with/"
My question is should I list out the dir structure like that? I only find examples of dirs one level down.
I feel like I could use ‘glob’ but couldn’t get that to work or let cmake traverse the dirs and include the files down at the lowest level, but I couldn’t get that to work either. Any suggestions or an example would be great!
1