Easy to include headers from cmake library dependency

I am experimenting with CMake a bit for the C ++ repository, but I am having some problems trying to simplify the collection of applications against libraries in a single source tree without a lot of CMake code.

The layout of the source tree is basically the following:

ROOT
    libs/
         lib1/
         lib2/
         lib3/
    apps/
         app1/
         app2/
         app3/

Libraries are independent of each other, and applications can reference one or more libraries.

Currently, I have a root CMakeLists.txt, which lists all applications and libraries as a subdirectory, so if the library is changed and the application is rebuilt, then it is also a library. This works fine, and CMake links it without having to indicate where the library is, but I see no way to do something like this for include directories.

? CMakeLists.txt, , .

+5
1

, , lib INCLUDE_DIRECTORIES, . CMakeListst.txt, . "" .

+1

All Articles