add option to conditionally build manual selector node #397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the code looks whether
ncurses
is found and if that's the case, it tries to build the manual selector node.This PR adds an explicit option to enable/disable building this node.
Besides giving more control on the dependencies, this simplifies cross-compilation procedures for example when building this package in conan (see here https://github.com/conan-io/conan-center-index/blob/master/recipes/behaviortree.cpp/all/conanfile.py)
Conan requires that all dependencies that will be "searched" (via
find_package
) are listed as requirements in the conanfile and it does not play well with optional dependencies that are not controlled via CMake options.In particular, without my change, the code implicitly required the cross-compilation of ncurses.
ncurses
as a dependency in the conanfile it is required to cross-compile it.ncurses
as a dependency,find_package(Curses QUIET)
could still find an x86_64 version if this was present in the OS (e.g. ubuntu desktop) thus linking it with the library and obviously failing the compilation as the library format was incompatible.Signed-off-by: Alberto Soragna alberto.soragna@gmail.com