2020-06-27 06:06:30 +08:00
vcpkg_from_sourceforge (
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 f r e e g l u t / f r e e g l u t
R E F 3 . 2 . 1
2020-05-22 02:29:52 +08:00
F I L E N A M E " f r e e g l u t - 3 . 2 . 1 . t a r . g z "
S H A 5 1 2 a c e d 4 b b c d 3 6 2 6 9 c e 6 f 4 e e 1 9 8 2 e 0 f 9 e 3 f f f b f 1 8 c 9 4 f 7 8 5 d 3 2 1 5 a c 9 f 4 8 0 9 b 9 9 2 e 1 6 6 c 7 a d a 4 9 6 e d 6 1 7 4 e 1 3 d 7 7 c 0 f 7 e f 3 c a 4 c 5 7 d 8 a 2 8 2 e 9 6 c b b e 6 f f 0 8 6 3 3 9 a d e 3 b 0 8
2020-06-27 06:06:30 +08:00
P A T C H E S
u s e _ t a r g e t s _ t o _ e x p o r t _ x 1 1 _ d e p e n d e n c y . p a t c h
m a c O S _ X q u a r t z . p a t c h
g c c 1 0 . p a t c h
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
2019-05-09 04:47:32 +08:00
)
2016-10-11 16:27:49 +08:00
2020-05-22 02:29:52 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
2019-05-10 02:45:23 +08:00
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\nOn macOS Xquartz is required." )
2018-04-27 18:15:17 +08:00
endif ( )
2016-11-16 09:39:33 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
set ( FREEGLUT_STATIC OFF )
set ( FREEGLUT_DYNAMIC ON )
else ( )
set ( FREEGLUT_STATIC ON )
set ( FREEGLUT_DYNAMIC OFF )
endif ( )
2018-09-07 20:24:27 +08:00
# Patch header
file ( READ ${ SOURCE_PATH } /include/GL/freeglut_std.h FREEGLUT_STDH )
2019-05-09 04:47:32 +08:00
string ( REGEX REPLACE "\" freeglut_static.lib\ ""
2018-09-07 20:24:27 +08:00
" \ " f r e e g l u t . l i b \ " " F R E E G L U T _ S T D H " $ { F R E E G L U T _ S T D H } " )
2019-05-09 04:47:32 +08:00
string ( REGEX REPLACE "\" freeglut_staticd.lib\ ""
" \ " f r e e g l u t d . l i b \ " " F R E E G L U T _ S T D H " $ { F R E E G L U T _ S T D H } " )
2018-09-07 20:24:27 +08:00
file ( WRITE ${ SOURCE_PATH } /include/GL/freeglut_std.h "${FREEGLUT_STDH}" )
2016-10-11 16:27:49 +08:00
vcpkg_configure_cmake (
2016-12-08 07:21:30 +08:00
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2019-08-01 04:01:02 +08:00
P R E F E R _ N I N J A
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 }
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
)
vcpkg_install_cmake ( )
2020-05-22 02:29:52 +08:00
vcpkg_fixup_cmake_targets ( CONFIG_PATH lib/cmake/FreeGLUT )
2016-10-11 16:27:49 +08:00
2017-11-08 21:55:46 +08:00
# Rename static lib (otherwise it's incompatible with FindGLUT.cmake)
2018-04-27 18:15:17 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
if ( NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
2020-01-31 06:40:10 +08:00
if ( NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /lib/freeglut_static.lib ${ CURRENT_PACKAGES_DIR } /lib/freeglut.lib )
endif ( )
if ( NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /debug/lib/freeglut_staticd.lib ${ CURRENT_PACKAGES_DIR } /debug/lib/freeglutd.lib )
endif ( )
2018-04-27 18:15:17 +08:00
endif ( )
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
2016-10-11 16:27:49 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
# Handle copyright
2020-05-22 02:29:52 +08:00
file ( INSTALL ${ SOURCE_PATH } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
2016-11-16 09:39:33 +08:00
2017-11-17 15:54:55 +08:00
vcpkg_copy_pdbs ( )
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /usage DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } )
2019-05-10 02:45:23 +08:00
if ( VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" )
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /vcpkg-cmake-wrapper.cmake DESTINATION ${ CURRENT_PACKAGES_DIR } /share/glut )
endif ( )