[glew] Fix build failure when VCPKG_BUILD_TYPE is set

This commit is contained in:
past-due 2018-03-19 15:31:32 -04:00
parent 5968ebf9f4
commit d7394e883c

View File

@ -19,7 +19,15 @@ vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/glew") 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) file(READ ${FILE} _contents)
string(REPLACE "libglew32" "glew32" _contents "${_contents}") string(REPLACE "libglew32" "glew32" _contents "${_contents}")
file(WRITE ${FILE} "${_contents}") file(WRITE ${FILE} "${_contents}")
@ -27,6 +35,8 @@ endforeach()
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/libglew32.lib) 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}/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) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/glew32d.lib)
endif() endif()