[freeglut] Fix the internal default link name of freeglut. Fixed #4243.

This commit is contained in:
icedream2linxi 2018-09-07 20:24:27 +08:00
parent 40510c3aaf
commit f138ef3747
2 changed files with 7 additions and 9 deletions

View File

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

View File

@ -25,6 +25,12 @@ else()
set(FREEGLUT_DYNAMIC OFF)
endif()
# Patch header
file(READ ${SOURCE_PATH}/include/GL/freeglut_std.h FREEGLUT_STDH)
string(REGEX REPLACE "\"freeglut[_a-z]+.lib\""
"\"freeglut.lib\"" FREEGLUT_STDH "${FREEGLUT_STDH}")
file(WRITE ${SOURCE_PATH}/include/GL/freeglut_std.h "${FREEGLUT_STDH}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
@ -36,14 +42,6 @@ vcpkg_configure_cmake(
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.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")
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")