I am working on a project that involves writing a library as well as showcases of its usage. My folder structure looks like this
├───lib
│ ├───CMakeLists.txt
│ ├───inc
│ │ └───Foo.h
│ └───src
│ └───Foo.cpp
├───example
│ ├───main.cpp
│ └───CMakeLists.txt
├───graphical-application
│ ├───CMakeLists.txt
│ ├───confanfile.txt
│ └───main.cpp
├───test
│ ├───CMakeLists.txt
│ └───GoogleTestMain.cpp
└───CMakeLists.txt
The lib directory provides the library for static linking. The example directory showcases the use of the library The test directory uses Google Test to perform simple unit tests.
So far the root CMakeLists.txt provides a simple one-stop solution to build the library, the example and the unit tests. I have started building a graphical-application where the library is used in a different context. Since the graphical-application uses external libraries I am managing dependencies with Conan.
I would now like to be able to add the graphical-application directory to the root CMakelists.txt in such a fashion that the entire project folder with all subdirectories can be built, some with pure CMake, some with Conan. Does one need a special conanfile.txt or .py for this use case and is it possible to invoke either from the context of the root CMakeLists.txt, either implicitly or explicitly?