set(FONT_CHEF_ARCH "x86")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  set(FONT_CHEF_ARCH "x64")
endif ()

string(TOLOWER ${CMAKE_SYSTEM_NAME} FONT_CHEF_SYSTEM_NAME)
if (MSVC)
  string(TOLOWER "${CMAKE_C_COMPILER_ID}${MSVC_TOOLSET_VERSION}" FONT_CHEF_COMPILER_TARGET)
else ()
  string(TOLOWER "${CMAKE_C_COMPILER_ID}" FONT_CHEF_COMPILER_TARGET)
endif (MSVC)

set(CPACK_PACKAGE_VENDOR "Leonardo G. L. de Freitas")
set(CPACK_PACKAGE_DESCRIPTION
  "Font Chef is a cross-platform C99 library to create character atlas of pre-rasterized glyphs from a font at a specified size and color")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_FILE_NAME
  "${PROJECT_NAME}-${PROJECT_VERSION}-${FONT_CHEF_SYSTEM_NAME}-${FONT_CHEF_ARCH}-${FONT_CHEF_COMPILER_TARGET}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
  "${PROJECT_NAME}-${PROJECT_VERSION}")
set(CPACK_PACKAGE_NAME KiWi)

set(CPACK_SOURCE_IGNORE_FILES .*build.*/ .idea/ .git/)

if (WIN32)
  set(CPACK_SOURCE_GENERATOR "ZIP")
  set(CPACK_GENERATOR "ZIP")
else()
  set(CPACK_SOURCE_GENERATOR "TGZ")
  set(CPACK_GENERATOR "TGZ")
endif()

include(CPack)