2017-04-05 04:27:44 +08:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(SDL2_TTF C)
|
|
|
|
|
|
|
|
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
|
2019-05-02 04:36:57 +08:00
|
|
|
find_package(SDL2 CONFIG REQUIRED)
|
2018-11-07 10:04:07 +08:00
|
|
|
find_package(Freetype REQUIRED)
|
2017-04-05 04:27:44 +08:00
|
|
|
|
2018-01-10 04:44:37 +08:00
|
|
|
add_library(SDL2_ttf SDL_ttf.c version.rc)
|
2017-04-05 04:27:44 +08:00
|
|
|
|
2021-01-06 04:33:13 +08:00
|
|
|
set_target_properties(SDL2_ttf PROPERTIES DEFINE_SYMBOL DLL_EXPORT)
|
2019-03-27 00:57:16 +08:00
|
|
|
target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIRS})
|
2019-05-02 04:36:57 +08:00
|
|
|
target_link_libraries(SDL2_ttf SDL2::SDL2 ${FREETYPE_LIBRARIES})
|
2017-04-05 04:27:44 +08:00
|
|
|
|
|
|
|
install(TARGETS SDL2_ttf
|
2019-03-27 00:57:16 +08:00
|
|
|
EXPORT SDL2_ttf
|
2017-04-05 04:27:44 +08:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib)
|
|
|
|
|
2019-03-27 00:57:16 +08:00
|
|
|
INSTALL(EXPORT SDL2_ttf
|
|
|
|
DESTINATION "share/sdl2-ttf"
|
|
|
|
FILE sdl2-ttf-config.cmake
|
|
|
|
NAMESPACE SDL2::
|
|
|
|
)
|
|
|
|
|
2017-04-05 04:27:44 +08:00
|
|
|
if(NOT DEFINED SDL_TTF_SKIP_HEADERS)
|
|
|
|
install(FILES SDL_ttf.h DESTINATION include/SDL2)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Link-time dependencies:")
|
2019-05-02 04:36:57 +08:00
|
|
|
message(STATUS " " SDL2::SDL2)
|
2019-03-27 00:57:16 +08:00
|
|
|
message(STATUS " " ${FREETYPE_LIBRARIES})
|