Skip to content

Commit

Permalink
[glew] Fix build failure when VCPKG_BUILD_TYPE is set
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Mar 20, 2018
1 parent 5968ebf commit d7394e8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ports/glew/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,24 @@ vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/glew")

foreach(FILE ${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-release.cmake)
set(_targets_cmake_files)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
list(APPEND _targets_cmake_files "${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-debug.cmake")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
list(APPEND _targets_cmake_files "${CURRENT_PACKAGES_DIR}/share/glew/glew-targets-release.cmake")
endif()

foreach(FILE ${_targets_cmake_files})
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)
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/glew32d.lib)
endif()

Expand Down

0 comments on commit d7394e8

Please sign in to comment.