2022-04-06 02:14:30 +08:00
vcpkg_from_github (
2020-06-27 06:06:30 +08:00
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
2022-04-06 02:14:30 +08:00
R E P O F r e e G L U T P r o j e c t / f r e e g l u t
2022-12-30 02:34:27 +08:00
R E F " v $ { V E R S I O N } "
S H A 5 1 2 4 b b 6 d 6 c 0 8 6 b a c 7 a 9 c 0 e c 7 8 0 6 2 d c e 5 8 9 8 7 5 5 5 7 8 5 a b e 6 3 7 5 f 4 6 2 e e 2 4 9 f 6 5 2 1 0 a 9 6 4 a 2 8 f b 1 0 b a 7 e e 8 a 4 2 d 7 f a f b 0 0 e b 8 d 1 9 6 e b 4 0 3 d 6 5 d 2 5 5 f 0 2 f 8 8 4 6 7 3 6 9 c 1 8 7 2 2 8 b
2022-04-06 02:14:30 +08:00
H E A D _ R E F m a s t e r
2024-06-12 04:26:30 +08:00
P A T C H E S
a n d r o i d . p a t c h
g l e s . p a t c h # amends https://github.com/freeglut/freeglut/commit/093a5a46
2022-04-06 02:14:30 +08:00
x 1 1 - d e p e n d e n c i e s - e x p o r t . p a t c h
2020-06-27 06:06:30 +08:00
f i x - d e b u g - m a c r o . p a t c h
2021-04-10 01:09:10 +08:00
n o _ x 6 4 _ e n f o r c e m e n t . p a t c h
2022-12-30 02:34:27 +08:00
w i n d o w s - o u t p u t - n a m e . p a t c h
2019-05-09 04:47:32 +08:00
)
2016-10-11 16:27:49 +08:00
2023-12-01 18:13:18 +08:00
if ( VCPKG_TARGET_IS_OSX )
message ( "Freeglut currently requires Xquartz for macOS." )
elseif ( NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_ANDROID )
message ( "Freeglut currently requires the following libraries from the system package manager:\n opengl\n glu\n libx11\n xrandr\n xi\n xxf86vm\n\nThese can be installed on Ubuntu systems via apt-get install libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev" )
2018-04-27 18:15:17 +08:00
endif ( )
2022-04-06 02:14:30 +08:00
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" FREEGLUT_STATIC )
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" FREEGLUT_DYNAMIC )
2018-09-07 20:24:27 +08:00
2022-04-06 02:14:30 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2016-10-11 16:27:49 +08:00
O P T I O N S
2016-11-16 09:39:33 +08:00
- D F R E E G L U T _ B U I L D _ S T A T I C _ L I B S = $ { F R E E G L U T _ S T A T I C }
- D F R E E G L U T _ B U I L D _ S H A R E D _ L I B S = $ { F R E E G L U T _ D Y N A M I C }
2022-12-30 02:34:27 +08:00
- D F R E E G L U T _ R E P L A C E _ G L U T = O N
2016-10-11 16:27:49 +08:00
- D F R E E G L U T _ B U I L D _ D E M O S = O F F
2016-11-16 09:39:33 +08:00
- D I N S T A L L _ P D B = O F F # Installing pdbs failed on debug static. So, disable it and let vcpkg_copy_pdbs() do it
2016-10-11 16:27:49 +08:00
)
2022-04-06 02:14:30 +08:00
vcpkg_cmake_install ( )
vcpkg_copy_pdbs ( )
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/FreeGLUT )
vcpkg_fixup_pkgconfig ( )
2023-12-01 18:13:18 +08:00
file ( GLOB pc_files "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/*.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc" )
foreach ( file IN LISTS pc_files )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${file}" ";-D" " -D" IGNORE_UNCHANGED )
2023-12-01 18:13:18 +08:00
endforeach ( )
if ( NOT VCPKG_TARGET_IS_ANDROID )
file ( COPY_FILE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/glut.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freeglut.pc" )
if ( NOT VCPKG_BUILD_TYPE )
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glut.pc" " -lfreeglut" " -lfreeglutd" IGNORE_UNCHANGED )
2023-12-01 18:13:18 +08:00
endif ( )
file ( COPY_FILE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/glut.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freeglut.pc" )
2022-12-30 02:34:27 +08:00
endif ( )
endif ( )
2016-10-11 16:27:49 +08:00
2018-04-27 18:15:17 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2020-01-23 04:19:17 +08:00
vcpkg_replace_string (
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L / f r e e g l u t _ s t d . h "
" i f d e f F R E E G L U T _ S T A T I C "
" i f 1 / / i f d e f F R E E G L U T _ S T A T I C "
)
2017-11-08 21:55:46 +08:00
endif ( )
2017-07-01 05:38:26 +08:00
# Clean
2022-12-30 02:34:27 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
2016-10-11 16:27:49 +08:00
2022-04-06 02:14:30 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/glut" )
2016-11-16 09:39:33 +08:00
2022-04-06 02:14:30 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )