cmake_minimum_required(VERSION 2.6)

project(cvra-build)
set(CMAKE_BUILD_TYPE Debug)

{% for dir in include_directories %}
include_directories({{ dir }})
{% endfor %}

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")

add_executable(
    tests
    {% for file in source -%}
    {{ file }}
    {% endfor -%}

    {% for file in tests -%}
    {{ file }}
    {% endfor -%}
    )

{% for dir in include_directories.test -%}
target_include_directories(tests PRIVATE {{ dir }})
{%- endfor %}

target_link_libraries(
    tests
    m
    CppUTest
    CppUTestExt
    )

# Run unit tests
add_custom_target(check ./tests -c DEPENDS tests)

{% block additional_targets %}
{% endblock %}
