cmake: populate `CMAKE_FIND_ROOT_PATH` when cross-compiling for a different architecture on Linux
Populate CMAKE_FIND_ROOT_PATH when cross-compiling on Linux.
Fix:
- https://github.com/DaemonEngine/Daemon/issues/1659
I modified a bit the comments to make them more understandable.
Why is it inside if (DEPS_DIR) ?
Right, it's not needed to be there, I moved it out of that block.
It would be better to avoid setting CMAKE_FIND_ROOT_PATH if possible, since it causes CMAKE_PREFIX_PATH not to work as I discovered on #1433. When both of those variables are set, CMake concatenates the root path and prefix path together, instead of using the prefix path as is (unless the prefix path is already a subdirectory of the root path).