vcpkg/ports/sdl2-ttf/CMakeLists.txt
Helco 95785e1b40 [SDL2_xxx]: Add CMake targets for SDL2 addons (#5754)
* Add SDL2 image target

* Add SDL2_mixer target

* Add SDL2_ttf target

* Add SDL2_net target

* Fix missing source file for SDL2_image

* Disable harfbuzz for freetype properly

* Use both include dirs for freetype in SDL2-tff
2019-03-26 09:57:16 -07:00

33 lines
913 B
CMake

cmake_minimum_required(VERSION 3.0)
project(SDL2_TTF C)
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL_LIBRARY NAMES SDL2d SDL2)
find_package(Freetype REQUIRED)
add_library(SDL2_ttf SDL_ttf.c version.rc)
set_target_properties(SDL2_ttf PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIRS})
target_link_libraries(SDL2_ttf ${SDL_LIBRARY} ${FREETYPE_LIBRARIES})
install(TARGETS SDL2_ttf
EXPORT SDL2_ttf
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
INSTALL(EXPORT SDL2_ttf
DESTINATION "share/sdl2-ttf"
FILE sdl2-ttf-config.cmake
NAMESPACE SDL2::
)
if(NOT DEFINED SDL_TTF_SKIP_HEADERS)
install(FILES SDL_ttf.h DESTINATION include/SDL2)
endif()
message(STATUS "Link-time dependencies:")
message(STATUS " " ${SDL_LIBRARY})
message(STATUS " " ${FREETYPE_LIBRARIES})