diff --git a/ports/freeglut/CONTROL b/ports/freeglut/CONTROL index 82f0dc1f15..d7c3801f72 100644 --- a/ports/freeglut/CONTROL +++ b/ports/freeglut/CONTROL @@ -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. diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index c2d1f28162..33861a7ebe 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -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)