This patch add support to the Yocto SDK by properly passing sysroot
information to build the project.
Sadly, besides what is said in CMake documentation, FindPkgConfig
don't deal very well with "CMAKE_FIND_ROOT_PATH" + "CMAKE_PREFIXPATH"
combo. Luckily for us, find*() commands does (from 3.1 onwards)!
So now MavLink is found by find_path(), taking advantage of the fact
that its headers only library.
Now, to cross-compile this project against a system that doesn't provide
Mavlink headers, one just have to set CMAKE_PREFIX_PATH to where those
headers can be found.
This patch add support to the Yocto SDK by properly passing sysroot information to build the project.
Sadly, besides what is said in CMake documentation, FindPkgConfig don't deal very well with "CMAKE_FIND_ROOT_PATH" + "CMAKE_PREFIXPATH" combo. Luckily for us, find*() commands does (from 3.1 onwards)!
So now MavLink is found by find_path(), taking advantage of the fact that its headers only library.
Now, to cross-compile this project against a system that doesn't provide Mavlink headers, one just have to set CMAKE_PREFIX_PATH to where those headers can be found.