Polytonic / Glitter

Dead Simple OpenGL
http://polytonic.github.io/Glitter/
2.46k stars 416 forks source link

Add FreeType #78

Closed lindaarab closed 1 year ago

lindaarab commented 1 year ago

Hi,

I tried adding another submodule - FreeType. Right now, I am trying to alter the CMakeLists.txt file to make FreeType work. But I am struggling. I was thinking maybe the solution is more obvious to you?

I tried by adding: add_subdirectory(Brakeloose/Vendors/freetype) include_directories(Brakeloose/Vendors/freetype/include/) target_link_libraries(${PROJECT_NAME} ${FREETYPE_LIBRARIES})

But there is a linking error "LNK2019 unresolved external symbol FT_Init_FreeType [..]"

I also tried (in a separate folder) running CMake on the cloned FreeType repository and building the solution with Visual Studio 2019. Here I did not encounter any issues.

Kind regards, Linda

lindaarab commented 1 year ago

Hi, use target_link_libraries(${PROJECT_NAME} freetype) instead of target_link_libraries(${PROJECT_NAME} ${FREETYPE_LIBRARIES}.

I guess ${FREETYPE_LIBRARIES} is only accessible when FreeType is actually installed on the system?