Merge pull request #2154 from cenit/master

[freeglut] rename static library for compatibility with FindGLUT.cmake
This commit is contained in:
Robert Schumacher 2017-11-08 07:31:04 -08:00 committed by GitHub
commit 19861c73aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,3 @@
Source: freeglut
Version: 3.0.0-2
Version: 3.0.0-3
Description: Open source implementation of GLUT with source and binary backwards compatibility.

View File

@ -35,11 +35,17 @@ vcpkg_install_cmake()
# Patch header
file(READ ${CURRENT_PACKAGES_DIR}/include/GL/freeglut_std.h FREEGLUT_STDH)
string(REPLACE "pragma comment (lib, \"freeglut_staticd.lib\")"
"pragma comment (lib, \"freeglut_static.lib\")" FREEGLUT_STDH "${FREEGLUT_STDH}")
"pragma comment (lib, \"freeglut.lib\")" FREEGLUT_STDH "${FREEGLUT_STDH}")
string(REPLACE "pragma comment (lib, \"freeglutd.lib\")"
"pragma comment (lib, \"freeglut.lib\")" FREEGLUT_STDH "${FREEGLUT_STDH}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/GL/freeglut_std.h "${FREEGLUT_STDH}")
# Rename static lib (otherwise it's incompatible with FindGLUT.cmake)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/freeglut_static.lib ${CURRENT_PACKAGES_DIR}/lib/freeglut.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/freeglut_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/freeglut.lib)
endif()
# Clean
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)