I would like to
- use the crosscompiler
gcc-aarch64-linux-gnuto build a binary - link a precompiled library (e.g.
libxml2.so/libxml2.a) to that binary - use cmake
I thought of the following way to achieve the above:
- creating a sysroot folder (is this the correct term?)
- downloading the library by
apt-get download libxml2-dev:arm64 - "installing" the package into the sysroot folder by
dpkg-deb -x libxml2_*_arm64.deb ./sysroot/ - declaring the sysroot folder in
CMAKE_FIND_ROOT_PATH - using
find_package()in cmake to locate the library in sysroot
Question: Is the way above a good one? Is there a better one? I am surely not the first one facing that problem, therefore I think there might be a better way.