2018-11-09 21:41:16 +08:00
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
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 D a v 1 d d e / g l a d
2022-08-09 02:54:00 +08:00
R E F 1 e c d 4 5 7 7 5 d 9 6 f 3 5 1 7 0 4 5 8 e 6 b 1 4 8 e b 0 7 0 8 9 6 7 e 4 0 2 # 0.1.36
S H A 5 1 2 f 6 2 9 2 e 9 d b c e 5 0 3 a 9 5 b 6 e c a 9 2 7 a 9 0 c f 8 a 0 6 f 5 e 3 d e 3 9 b 8 4 f 9 a 4 7 e 0 d 9 2 7 3 a 6 e a 3 f 6 5 9 1 a 6 4 d 3 5 f 2 e 3 3 b 5 e a 3 5 3 e 0 c 7 8 4 f 1 5 c 3 8 5 7 9 f c 1 5 a a 6 c 5 b 1 8 0 1 5 4 e 2 4 1 c c b b 1 6 f e
2018-11-09 21:41:16 +08:00
H E A D _ R E F m a s t e r
2022-08-09 02:54:00 +08:00
P A T C H E S
e n c o d i n g . p a t c h
f i n d _ p y t h o n . p a t c h
2018-11-09 21:41:16 +08:00
)
2021-04-08 04:33:59 +08:00
if ( NOT GLAD_PROFILE )
set ( GLAD_PROFILE "compatibility" )
endif ( )
message ( STATUS "This version of glad uses the compatibility profile. To use the core profile instead, create an overlay port of this with GLAD_PROFILE set to 'core' or set GLAD_PROFILE to 'core' in a custom triplet." )
message ( STATUS "This recipe is at ${CMAKE_CURRENT_LIST_DIR}" )
message ( STATUS "See the overlay ports documentation at https://github.com/microsoft/vcpkg/blob/master/docs/specifications/ports-overlay.md" )
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
F E A T U R E S
e x t e n s i o n s G L A D _ A L L _ E X T E N S I O N S
I N V E R T E D _ F E A T U R E S
l o a d e r G L A D _ N O _ L O A D E R
)
set ( GLAD_SPEC "gl" )
if ( "egl" IN_LIST FEATURES )
string ( APPEND GLAD_SPEC ",egl" )
endif ( )
if ( "wgl" IN_LIST FEATURES )
string ( APPEND GLAD_SPEC ",wgl" )
endif ( )
if ( "glx" IN_LIST FEATURES )
string ( APPEND GLAD_SPEC ",glx" )
endif ( )
2021-05-19 06:24:02 +08:00
# This needs to be ordered highest to lowest for it to be correct!
2021-04-08 04:33:59 +08:00
if ( "gl-api-latest" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=" )
elseif ( "gl-api-46" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.6" )
2021-05-19 06:24:02 +08:00
elseif ( "gl-api-45" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.5" )
elseif ( "gl-api-44" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.4" )
elseif ( "gl-api-43" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.3" )
elseif ( "gl-api-42" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.2" )
elseif ( "gl-api-41" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.1" )
elseif ( "gl-api-40" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=4.0" )
elseif ( "gl-api-33" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=3.3" )
elseif ( "gl-api-32" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=3.2" )
elseif ( "gl-api-31" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=3.1" )
elseif ( "gl-api-30" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=3.0" )
elseif ( "gl-api-21" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=2.1" )
elseif ( "gl-api-20" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=2.0" )
elseif ( "gl-api-15" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=1.5" )
elseif ( "gl-api-14" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=1.4" )
elseif ( "gl-api-13" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=1.3" )
elseif ( "gl-api-12" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=1.2" )
elseif ( "gl-api-11" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=1.1" )
elseif ( "gl-api-10" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gl=1.0" )
2021-04-08 04:33:59 +08:00
endif ( )
2021-05-19 06:24:02 +08:00
# This needs to be ordered highest to lowest for it to be correct!
2021-04-08 04:33:59 +08:00
if ( "gles1-api-latest" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles1=" )
elseif ( "gles1-api-10" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles1=1.0" )
endif ( )
2021-05-19 06:24:02 +08:00
# This needs to be ordered highest to lowest for it to be correct!
2021-04-08 04:33:59 +08:00
if ( "gles2-api-latest" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles2=" )
elseif ( "gles2-api-32" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles2=3.2" )
2021-05-19 06:24:02 +08:00
elseif ( "gles2-api-31" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles2=3.1" )
elseif ( "gles2-api-30" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles2=3.0" )
elseif ( "gles2-api-20" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "gles2=2.0" )
2021-04-08 04:33:59 +08:00
endif ( )
2021-05-19 06:24:02 +08:00
# This needs to be ordered highest to lowest for it to be correct!
2021-04-08 04:33:59 +08:00
if ( "glsc2-api-latest" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "glsc2=" )
elseif ( "glsc2-api-20" IN_LIST FEATURES )
LIST ( APPEND GLAD_API "glsc2=2.0" )
endif ( )
string ( REPLACE ";" "," GLAD_API "${GLAD_API}" )
2019-02-08 07:28:50 +08:00
vcpkg_find_acquire_program ( PYTHON3 )
2018-11-17 10:19:03 +08:00
file ( COPY
2021-11-26 17:17:11 +08:00
" $ { C U R R E N T _ I N S T A L L E D _ D I R } / i n c l u d e / K H R / k h r p l a t f o r m . h "
" $ { C U R R E N T _ I N S T A L L E D _ D I R } / i n c l u d e / E G L / e g l p l a t f o r m . h "
" $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / o p e n g l / e g l . x m l "
" $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / o p e n g l / g l . x m l "
" $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / o p e n g l / g l x . x m l "
" $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / o p e n g l / w g l . x m l "
D E S T I N A T I O N " $ { S O U R C E _ P A T H } / g l a d / f i l e s "
2018-11-17 10:19:03 +08:00
)
2018-11-14 07:02:29 +08:00
2021-04-08 04:33:59 +08:00
vcpkg_cmake_configure (
2021-11-26 17:17:11 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2018-11-09 21:41:16 +08:00
O P T I O N S
- D G L A D _ E X P O R T = O F F
- D G L A D _ I N S T A L L = O N
- D G L A D _ R E P R O D U C I B L E = O N
2021-04-08 04:33:59 +08:00
- D G L A D _ S P E C = $ { G L A D _ S P E C }
- D G L A D _ A P I = $ { G L A D _ A P I }
- D G L A D _ P R O F I L E = $ { G L A D _ P R O F I L E }
2020-04-30 15:23:48 +08:00
- D P Y T H O N _ E X E C U T A B L E = $ { P Y T H O N 3 }
2021-04-08 04:33:59 +08:00
$ { F E A T U R E _ O P T I O N S }
2018-11-09 21:41:16 +08:00
O P T I O N S _ D E B U G
- D G L A D _ G E N E R A T O R = " c - d e b u g "
2021-04-08 04:33:59 +08:00
O P T I O N S _ R E L E A S E
- D G L A D _ G E N E R A T O R = " c "
2018-11-09 21:41:16 +08:00
)
2021-04-08 04:33:59 +08:00
vcpkg_cmake_install ( )
2018-11-09 21:41:16 +08:00
vcpkg_copy_pdbs ( )
2021-04-08 04:33:59 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/glad )
2018-11-09 21:41:16 +08:00
2021-11-26 17:17:11 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/include/KHR" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/include/EGL" )
2021-04-08 04:33:59 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2021-11-26 17:17:11 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )