# #
# Copyright (C) 2023 SpyroSoft Solutions S.A. All rights reserved.
# #

#
# DO NOT EDIT THIS FILE!
# This file is generated by `scargo update`.
#
{% if config.project.target.family == "esp32" %}
cmake_minimum_required(VERSION 3.14)
{% else %}
cmake_minimum_required(VERSION 3.16)
{% endif %}

{% if config.project.target.family == 'stm32' %}
{% include 'stm32.cmake.j2' %}
{% elif config.project.target.family == 'x86' %}
{% include 'x86.cmake.j2' %}
{% endif %}

set(CMAKE_CXX_STANDARD {{ config.project.cxxstandard }})

{% for key, value in config.project.cmake_variables.items() %}
set({{ key }} "{{ value }}")
{% endfor %}

{% for profile_name, profile in config.profiles.items() %}
    {% if profile.extras %}
# {{ profile_name }}
IF("${CMAKE_BUILD_TYPE}" STREQUAL "{{ profile_name }}")
        {% for key, value in profile.extras.items() %}
    SET({{ key }} {{ value }})
        {% endfor %}
ENDIF()
    {% endif %}

{% endfor %}

{% if config.project.target.family == "esp32" %}
{% include 'esp32.cmake.j2' %}
{% else %}
add_subdirectory(src)
{% endif %}
