Finding packages on CMAKE_STAGING_PREFIX with CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = ONLY
For a system where the CMAKE_SYSROOT should remain pristine, forllowing the instructions here I wrote a toolchain that contains something like this:
set(CMAKE_SYSROOT ...)
set(CMAKE_STAGING_PREFIX ...)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
The CMAKE_STAGING_PREFIX
is not searched for packages, therefore if I install a library, it is not found automatically from a dependent project and the only way to find it is to set YARP_DIR manually.