For me, this sounds more like foo is an independent thing and not a
subdirectory.
In this case, I think about two solutions:
1) Use a macro/function "check_yada", which sets a variable
"yada_usable". If you extract this logic in an extra .cmake file, you
can reuse it in your yada
"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
Hi,
On 12.03.19 06:37, Steve Keller wrote:
> 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
With my Debian Developer hat on: please also add a mechanism to manually
specify
On 12.03.2019 06:37 Steve Keller wrote:
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
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)