I'm trying to specify correctly the dependencies in the MyLibConfig.cmake
file of my project.
In CMakeLists.txt
I have something like this:
find_package(aLib REQUIRED)
find_package(bLib)
So in MyLibConfig.cmake
I wrote something like:
include(CMakeFindDependencyMacro)
find_dependency(aLib REQUIRED)
find_dependency(bLib)
Now, when I write another project that needs myLib, I do:
find_package(MyLib REQUIRED)
This fails because the MyLib configuration file doesn't find bLib, but I would like it to be treated as optional. What is the best Modern CMake practice to handle this?