vcpkg/ports/sdl2-gfx/CMakeLists.txt
Antonio Maiorano df753fbcf5 Fix sdl2-gfx, sdl2-image, sdl2-mixer, sdl2-net, and sdl2-ttf forcing debug lib first (SDL2d) (#5948)
Prevent SDL2 dependent libraries from always linking against debug.
2019-05-01 13:36:57 -07:00

31 lines
840 B
CMake

cmake_minimum_required(VERSION 3.0)
project(SDL2_GFX C)
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_package(SDL2 CONFIG REQUIRED)
# builtin formats
set(SDL_GFX_DEFINES WIN32)
if(BUILD_SHARED_LIBS)
list(APPEND SDL_GFX_DEFINES DLL_EXPORT)
endif()
add_library(SDL2_gfx
SDL2_framerate.c
SDL2_gfxPrimitives.c
SDL2_imageFilter.c
SDL2_rotozoom.c)
target_compile_definitions(SDL2_gfx PRIVATE ${SDL_GFX_DEFINES})
target_include_directories(SDL2_gfx PRIVATE ${SDL_INCLUDE_DIR}/SDL2)
target_link_libraries(SDL2_gfx PRIVATE SDL2::SDL2)
install(TARGETS SDL2_gfx
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
if(NOT SDL_GFX_SKIP_HEADERS)
install(FILES SDL2_framerate.h SDL2_gfxPrimitives.h SDL2_imageFilter.h SDL2_rotozoom.h SDL2_gfxPrimitives_font.h DESTINATION include/SDL2)
endif()