2018-10-26 02:57:39 +08:00
include ( vcpkg_common_functions )
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O S D L - M i r r o r / S D L
R E F r e l e a s e - 1 . 2 . 1 5
S H A 5 1 2 3 8 b 9 4 a 6 5 0 e c 2 0 5 3 7 7 a e 1 5 0 3 d 0 e c 8 a 5 2 5 4 e f 6 d 5 0 e d 0 a c a c 8 d 9 8 5 b 5 7 b 6 4 b c 1 6 e a 0 4 2 c f a 4 1 e 1 9 e 5 e f 8 3 1 7 9 8 0 c 4 a f b 8 3 1 8 6 8 2 9 f 5 b c 3 d a 9 4 3 3 d 0 a 6 4 9 d f d 1 0 5 5 4 8 0 1 b 5
H E A D _ R E F m a s t e r
2019-09-12 01:42:07 +08:00
P A T C H E S
e x p o r t - s y m b o l s - o n l y - i n - s h a r e d - b u i l d . p a t c h
f i x - l i n u x - b u i l d . p a t c h
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" )
file ( INSTALL ${ CMAKE_CURRENT_LIST_DIR } /SDL_static.vcxproj DESTINATION ${ SOURCE_PATH } /VisualC/SDL RENAME SDL.vcxproj )
file ( INSTALL ${ CMAKE_CURRENT_LIST_DIR } /SDLmain_static.vcxproj DESTINATION ${ SOURCE_PATH } /VisualC/SDLmain RENAME SDLmain.vcxproj )
else ( )
file ( INSTALL ${ CMAKE_CURRENT_LIST_DIR } /SDL_dynamic.vcxproj DESTINATION ${ SOURCE_PATH } /VisualC/SDL RENAME SDL.vcxproj )
file ( INSTALL ${ CMAKE_CURRENT_LIST_DIR } /SDLmain_dynamic.vcxproj DESTINATION ${ SOURCE_PATH } /VisualC/SDLmain RENAME SDLmain.vcxproj )
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 (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R O J E C T _ S U B P A T H V i s u a l C / S D L 1 _ 2 0 1 7 . s l n
I N C L U D E S _ S U B P A T H i n c l u d e
L I C E N S E _ S U B P A T H C O P Y I N G
A L L O W _ R O O T _ I N C L U D E S
)
#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 ( )
2019-09-12 01:42:07 +08:00
find_program ( autoreconf autoreconf )
if ( NOT autoreconf OR NOT EXISTS "/usr/share/doc/libgles2/copyright" )
message ( FATAL_ERROR "autoreconf and libgles2-mesa-dev must be installed before libepoxy can build. Install them with \" apt-get dh-autoreconf libgles2-mesa-dev\ "." )
endif ( )
find_program ( MAKE make )
if ( NOT MAKE )
message ( FATAL_ERROR "MAKE not found" )
endif ( )
2019-04-03 01:48:36 +08:00
2019-09-12 01:42:07 +08:00
file ( REMOVE_RECURSE ${ SOURCE_PATH } /m4 )
file ( MAKE_DIRECTORY ${ SOURCE_PATH } /m4 )
vcpkg_execute_required_process (
C O M M A N D " . / a u t o g e n . s h "
W O R K I N G _ D I R E C T O R Y $ { S O U R C E _ P A T H }
L O G N A M E a u t o r e c o n f - $ { T A R G E T _ T R I P L E T }
)
message ( STATUS "Configuring ${TARGET_TRIPLET}" )
set ( OUT_PATH_RELEASE ${ CURRENT_BUILDTREES_DIR } /make-build- ${ TARGET_TRIPLET } -release )
file ( REMOVE_RECURSE ${ OUT_PATH_RELEASE } )
file ( MAKE_DIRECTORY ${ OUT_PATH_RELEASE } )
vcpkg_execute_required_process (
C O M M A N D " . / c o n f i g u r e " - - p r e f i x = $ { O U T _ P A T H _ R E L E A S E }
W O R K I N G _ D I R E C T O R Y $ { S O U R C E _ P A T H }
L O G N A M E c o n f i g - $ { T A R G E T _ T R I P L E T }
)
message ( STATUS "Building ${TARGET_TRIPLET}" )
vcpkg_execute_build_process (
C O M M A N D " m a k e - j $ { V C P K G _ C O N C U R R E N C Y } "
N O _ P A R A L L E L _ C O M M A N D " m a k e "
W O R K I N G _ D I R E C T O R Y " $ { S O U R C E _ P A T H } "
L O G N A M E " b u i l d - $ { T A R G E T _ T R I P L E T } - r e l e a s e "
)
message ( STATUS "Installing ${TARGET_TRIPLET}" )
vcpkg_execute_required_process (
C O M M A N D " m a k e i n s t a l l "
W O R K I N G _ D I R E C T O R Y " $ { S O U R C E _ P A T H } "
L O G N A M E " i n s t a l l - $ { T A R G E T _ T R I P L E T } - r e l e a s e "
)
file ( INSTALL ${ OUT_PATH_RELEASE } /include DESTINATION ${ CURRENT_PACKAGES_DIR } )
file ( INSTALL ${ OUT_PATH_RELEASE } /lib DESTINATION ${ CURRENT_PACKAGES_DIR } )
file ( INSTALL ${ OUT_PATH_RELEASE } /share DESTINATION ${ CURRENT_PACKAGES_DIR } )
file ( GLOB DYNAMIC_LIBS ${ CURRENT_PACKAGES_DIR } /lib *.so* )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
file ( COPY ${ DYNAMIC_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /bin )
endif ( )
file ( REMOVE ${ DYNAMIC_LIBS } )
file ( INSTALL ${ SOURCE_PATH } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
endif ( )