diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2018-03-19 20:41:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-19 20:41:51 -0700 |
| commit | a67b809a16027177a4a237108a415a2583673997 (patch) | |
| tree | f21d4f6edfc21b6f7e5a14be1fde9d036a868482 | |
| parent | 6558f7bec63b6d3cd0944a0f67237072a287b499 (diff) | |
| parent | d7394e883cb4b21b6b5ea602308879c51d366fa1 (diff) | |
| download | vcpkg-a67b809a16027177a4a237108a415a2583673997.tar.gz vcpkg-a67b809a16027177a4a237108a415a2583673997.zip | |
Merge pull request #3076 from past-due/glew_fix_vcpkg_build_type
[glew] Fix build failure when VCPKG_BUILD_TYPE is set
| -rw-r--r-- | ports/glew/portfile.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ports/glew/portfile.cmake b/ports/glew/portfile.cmake index 79c669640..45f711f77 100644 --- a/ports/glew/portfile.cmake +++ b/ports/glew/portfile.cmake @@ -19,7 +19,15 @@ 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}") @@ -27,6 +35,8 @@ 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() |
