cmake_minimum_required(VERSION 2.6...3.29)
project(freetype)

set(FREETYPE_SOURCES
    src/autofit/autofit.c
    src/base/ftbase.c
    src/base/ftbitmap.c
    src/base/ftglyph.c
    src/base/ftinit.c
    src/base/ftsystem.c
    src/raster/raster.c
    src/sfnt/sfnt.c
    src/smooth/smooth.c
    src/truetype/truetype.c
)

file(GLOB_RECURSE FREETYPE_HEADERS ${PROJECT_SOURCE_DIR}/include/*.h)

include_directories(${PROJECT_SOURCE_DIR}/include)
add_definitions(-DFT2_BUILD_LIBRARY)

add_library(freetype STATIC ${FREETYPE_SOURCES} ${FREETYPE_HEADERS}) # remove static, cmake should take care of that
target_include_directories(freetype PUBLIC ${FREETYPE_HEADERS})

set_target_properties(freetype PROPERTIES FOLDER deps)