2018-10-26 02:57:39 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO SDL-Mirror/SDL
|
|
|
|
REF release-1.2.15
|
|
|
|
SHA512 38b94a650ec205377ae1503d0ec8a5254ef6d50ed0acac8d985b57b64bc16ea042cfa41e19e5ef8317980c4afb83186829f5bc3da9433d0a649dfd10554801b5
|
|
|
|
HEAD_REF master
|
2019-09-12 01:42:07 +08:00
|
|
|
PATCHES
|
|
|
|
export-symbols-only-in-shared-build.patch
|
|
|
|
fix-linux-build.patch
|
2018-10-26 02:57:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
configure_file(${SOURCE_PATH}/include/SDL_config.h.default ${SOURCE_PATH}/include/SDL_config.h COPYONLY)
|
|
|
|
|
2019-08-02 08:54:45 +08:00
|
|
|
|
2019-09-12 01:42:07 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/SDL1_2017.sln DESTINATION ${SOURCE_PATH}/VisualC/ )
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2020-03-06 06:06:50 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/SDL_static.vcxproj ${SOURCE_PATH}/VisualC/SDL/SDL.vcxproj COPYONLY)
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/SDLmain_static.vcxproj ${SOURCE_PATH}/VisualC/SDLmain/SDLmain.vcxproj COPYONLY)
|
2019-09-12 01:42:07 +08:00
|
|
|
else()
|
2020-03-06 06:06:50 +08:00
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/SDL_dynamic.vcxproj ${SOURCE_PATH}/VisualC/SDL/SDL.vcxproj COPYONLY)
|
|
|
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/SDLmain_dynamic.vcxproj ${SOURCE_PATH}/VisualC/SDLmain/SDLmain.vcxproj COPYONLY)
|
2019-09-12 01:42:07 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# This text file gets copied as a library, and included as one in the package
|
|
|
|
file(REMOVE_RECURSE ${SOURCE_PATH}/src/hermes/COPYING.LIB)
|
|
|
|
|
|
|
|
vcpkg_install_msbuild(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PROJECT_SUBPATH VisualC/SDL1_2017.sln
|
|
|
|
INCLUDES_SUBPATH include
|
|
|
|
LICENSE_SUBPATH COPYING
|
|
|
|
ALLOW_ROOT_INCLUDES
|
|
|
|
)
|
|
|
|
|
|
|
|
#Take all the fils into include/SDL to sovle conflict with SDL2 port
|
|
|
|
file(GLOB files ${CURRENT_PACKAGES_DIR}/include/*)
|
|
|
|
foreach(file ${files})
|
|
|
|
file(COPY ${file} DESTINATION ${CURRENT_PACKAGES_DIR}/include/SDL)
|
|
|
|
file(REMOVE ${file})
|
|
|
|
endforeach()
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/SDL/doxyfile)
|
|
|
|
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/SDLmain.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/SDLmain.lib)
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/SDLmain.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDLmaind.lib)
|
|
|
|
endif()
|
2019-08-02 08:54:45 +08:00
|
|
|
else()
|
2020-01-10 06:39:10 +08:00
|
|
|
message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".")
|
2019-04-03 01:48:36 +08:00
|
|
|
|
2020-01-10 06:39:10 +08:00
|
|
|
vcpkg_configure_make(
|
2020-05-22 01:46:07 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-09-12 01:42:07 +08:00
|
|
|
)
|
|
|
|
|
2020-01-10 06:39:10 +08:00
|
|
|
vcpkg_install_make()
|
2020-05-22 01:46:07 +08:00
|
|
|
vcpkg_fixup_pkgconfig(IGNORE_FLAGS -Wl,-rpath,\${libdir} SYSTEM_LIBRARIES -lm -ldl -lpthread)
|
2019-09-12 01:42:07 +08:00
|
|
|
|
2020-01-10 06:39:10 +08:00
|
|
|
file(GLOB SDL1_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*")
|
|
|
|
foreach (SDL1_TOOL ${SDL1_TOOLS})
|
|
|
|
file(COPY ${SDL1_TOOL} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
|
|
|
file(REMOVE ${SDL1_TOOL})
|
|
|
|
endforeach()
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
2019-09-12 01:42:07 +08:00
|
|
|
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2020-05-22 01:46:07 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-09-12 01:42:07 +08:00
|
|
|
endif()
|