I have a lot folders from sources which contents .cpp
and .h
files. Each folder contains CMakeLists.txt
file except folders which contents .h
headers files. I see the several ways.
The first way is consist from take advantage of
add_library(myLib1 STATIC /link/to/sources/somefile.cpp /link/to/sources/interfaces/somefile.h)
. But in this way I will have a lot strings when is't good way, I think. Because I have very more files, which are interconnected.The same way, with that exception when use
set(HEADERS /link1 /link2 ....)
andset(SOURCES /link3 ...)
and thanadd_library(myLib ${HEADERS} ${SOURCES})
.
I think than both the ways is't do properly. I don't know how I can connect the folder with library into my project, because if include this using the above methods it's will take a long time and is't beautiful