Hello,
in my experience it was also necessary to specify things like CMAKE_FIND_ROOT_PATH, otherwise cmake didn't find libraries in the poky SDK sysroot (also see cmake cross-compiling documentation). Here's what I've been using for cross-compiling with a poky SDK installed to /opt/poky/<version>:
source /opt/poky/<version>/environment-setup-*
cmake <srcdir> \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_VERSION=1 \
-DCMAKE_FIND_ROOT_PATH=/opt/poky/<version>/sysroots/<target> \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY
Another important detail is that the poky SDK must include all the *-dev packages needed.
Regards,
Daniel