vcpkg/ports/sdl2/portfile.cmake

44 lines
1.8 KiB
CMake
Raw Normal View History

2016-09-19 11:50:08 +08:00
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/SDL2-2.0.4)
2016-09-19 11:50:08 +08:00
vcpkg_download_distfile(ARCHIVE_FILE
URLS "http://libsdl.org/release/SDL2-2.0.4.tar.gz"
2016-09-19 11:50:08 +08:00
FILENAME "SDL2-2.0.4.tar.gz"
2016-09-23 04:13:09 +08:00
SHA512 dd0a95878639856c0f4b8a579ace8071379ab64519fa139b22d3ed857a0f0db87a75bc8480c7207e02fbffd1fdbd448e3c0b882c451675b0e2f1a945af02e1d6
2016-09-19 11:50:08 +08:00
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore")
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
2016-09-19 11:50:08 +08:00
)
file(COPY
${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/Debug/SDL-UWP/SDL2.dll
${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/Debug/SDL-UWP/SDL2.pdb
2016-09-19 11:50:08 +08:00
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(COPY
${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/Release/SDL-UWP/SDL2.dll
${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/Release/SDL-UWP/SDL2.pdb
2016-09-19 11:50:08 +08:00
DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(COPY ${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/Debug/SDL-UWP/SDL2.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(COPY ${SOURCE_PATH}/VisualC-WinRT/UWP_VS2015/Release/SDL-UWP/SDL2.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
2016-09-19 11:50:08 +08:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include)
file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include)
2016-09-19 11:50:08 +08:00
file(RENAME ${CURRENT_PACKAGES_DIR}/include/include ${CURRENT_PACKAGES_DIR}/include/SDL2)
else()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2016-09-19 11:50:08 +08:00
OPTIONS
-DSDL_STATIC=OFF
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
endif()
file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2 RENAME copyright)
2016-09-19 11:50:08 +08:00
vcpkg_copy_pdbs()