vcpkg/ports/sdl2-image/portfile.cmake

39 lines
1.4 KiB
CMake
Raw Normal View History

# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2_image-2.0.1)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.zip"
FILENAME "SDL2_image-2.0.1.zip"
SHA512 37d12f4fae71c586bec73262bddb9207ab2f9a2ca6001d2cbfde646e268a950ba5cd4cff53d75e2da8959ae6da6e9cadc6eca88fa7bd9aa2758395d64c84a307
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/correct-sdl-headers-dir.patch)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindWEBP.cmake DESTINATION ${SOURCE_PATH}/cmake)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
# OPTIONS
# OPTIONS_RELEASE -DOPTIMIZE=1
# OPTIONS_DEBUG -DDEBUGGABLE=1
)
vcpkg_install_cmake()
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-image)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-image/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-image/copyright)
vcpkg_copy_pdbs()