function(add_project_test TARGET)
  cmake_parse_arguments(PARSE_ARGV 1 TST "" "" "")
  add_executable(${TARGET}-test ${TST_UNPARSED_ARGUMENTS})
  set_target_properties(${TARGET}-test PROPERTIES FOLDER tests)
  target_compile_options(${TARGET}-test PRIVATE {{${}}{{NAME_PREFIX}}_ADDITIONAL_COMPILE_FLAGS})
  target_link_options(${TARGET}-test PRIVATE {{${}}{{NAME_PREFIX}}_ADDITIONAL_LINK_FLAGS})
  target_include_directories(${TARGET}-test
    PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/tests
    ${CMAKE_CURRENT_BINARY_DIR})
endfunction()

function(add_win32_icon TARGET NAME)
  set(RESNAME "${PROJECT_SOURCE_DIR}/data/assets/${NAME}")
  set(RC "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.dir/icon.rc")
  set(__content "// Copyright (c) {{COPY.YEAR}} {{COPY.HOLDER}}
// This code is licensed under {{COPY.LICENSE}} license (see LICENSE for details)
// This file was autogenerated. Do not edit.

LANGUAGE 9, 1

100 ICON \"${RESNAME}\"
")

  file(GENERATE OUTPUT ${RC} CONTENT ${__content})
  target_sources(${TARGET} PRIVATE "${RC}" "${RESNAME}")
endfunction()
