Skip to content

Commit

Permalink
[glew] Move source dir to avoid conflicts with previous source versio…
Browse files Browse the repository at this point in the history
…n. Rename static -> dynamic.
  • Loading branch information
ras0219-msft committed Jun 22, 2017
1 parent 0154ef4 commit ac763f9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ports/glew/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: glew
Version: 2.0.0-1
Version: 2.0.0-2
Description: The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library.
27 changes: 22 additions & 5 deletions ports/glew/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
include(vcpkg_common_functions)

set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/20170423/glew-2.0.0)

vcpkg_download_distfile(ARCHIVE_FILE
URLS "https://sourceforge.net/projects/glew/files/glew/snapshots/glew-20170423.tgz"
FILENAME "glew-20170423.tgz"
SHA512 2d4651196e01b4db7b210fc60505bf50ac9e37b49c8eee9c9bbfeadb4cb6f87f4c907e60e708a7371ff4b7596bee51ed35a76fba76f9a13a1f32f123121f1350
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})
vcpkg_extract_source_archive(${ARCHIVE_FILE} ${CURRENT_BUILDTREES_DIR}/src/20170423)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}/build/cmake
Expand All @@ -17,13 +17,30 @@ vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/glew")

vcpkg_copy_pdbs()
foreach(FILE ${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-release.cmake)
file(READ ${FILE} _contents)
string(REPLACE "libglew32" "glew32" _contents "${_contents}")
file(WRITE ${FILE} "${_contents}")
endforeach()

if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/libglew32.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libglew32.lib ${CURRENT_PACKAGES_DIR}/lib/glew32.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/glew32d.lib)
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/glewinfo.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/visualinfo.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/glewinfo.exe)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/visualinfo.exe)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
endif()

vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glew RENAME copyright)

0 comments on commit ac763f9

Please sign in to comment.