Skip to content

Commit

Permalink
rename freeglut_static.lib for compatibility with FindGLUT.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
cenit committed Nov 8, 2017
1 parent 9ea963d commit 68bfea1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ports/freeglut/CONTROL
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 7 additions & 1 deletion ports/freeglut/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 68bfea1

Please sign in to comment.