# Use like:
#
# cmake ... \
#     -DCMAKE_TOOLCHAIN_FILE={{ venv_root }}/toolchain.cmake \
{%- if sysroot %}
#     -DCMAKE_INSTALL_PREFIX={{ sysroot }} \
{%- endif %}
#     ...

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR {{ processor }})
set(CMAKE_C_COMPILER {{ cc }})
set(CMAKE_CXX_COMPILER {{ cxx }})
{% if sysroot -%}
set(CMAKE_FIND_ROOT_PATH {{ sysroot }})
{% endif %}
# search for headers and libraries in the target environment,
# search for programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
