"Simon Richter" wrote:
> With my Debian Developer hat on: please also add a mechanism to manually
> specify whether the optional component should be built. If the
> dependency changes and suddenly a component goes missing without
> triggering a build failure, that can be rather annoying for
"Albrecht Schlosser" wrote:
> If you want yadda to be optional then don't use REQUIRED.
>
> find_package(yadda)
> if (yadda_FOUND)
>message(STATUS "found yadda, building bar ...")
>
># add your code to build bar here
>
> endif ()
>
> This should do what you want - unless I misunderstood
How can I build a module in a subdirectory automatically if a required
package is available, but not fail if it's not. Say I have a
top-level CMakeLists.txt with
add_subdirectory(foo)
add_subdirectory(bar)
and in directory foo I have in CMakeLists.txt
find_package(yadda, REQUIRED)