Why does pkg_check_modules not use CMAKE_SYSTEM_PREFIX_PATH?
I'm using CMake for cross-compilation, and I have a toolchain file which sets CMAKE_SYSTEM_PREFIX_PATH accordingly. I'm running into issues with pkg_check_modules not finding some modules because it only searches
inside CMAKE_PREFIX_PATH and not CMAKE_SYSTEM_PREFIX_PATH (where my *.pc files are located).
I'm wondering why this is the case. From my understanding, CMAKE_SYSTEM_PREFIX_PATH is intended to contain prefixes for the system, and CMAKE_PREFIX_PATH is intended to contain prefixes for the project. In
this case, since I'm cross-compiling (which defines my "system"), it seems appropriate to set CMAKE_SYSTEM_PREFIX_PATH inside my toolchain file, but then that doesn't end up influencing the pkg-config search as I would like.
Should I be setting CMAKE_PREFIX_PATH inside my toolchain file, either instead of or in addition to CMAKE_SYSTEM_PREFIX_PATH, or should pkg_check_modules also honor CMAKE_SYSTEM_PREFIX_PATH? I suppose another
option would be to set the PKG_CONFIG_PATH environment variable inside my toolchain file directly, but that seems kinda ugly.