2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-06-22 13:31:23 +08:00
|
|
|
|
2017-08-14 08:21:08 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew/glew-2.1.0)
|
2017-06-22 13:31:23 +08:00
|
|
|
|
2018-02-21 09:18:50 +08:00
|
|
|
# Don't change to vcpkg_from_github! The github-auto-generated archives are missing some files.
|
|
|
|
# More info: https://github.com/nigels-com/glew/issues/31
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2018-02-14 13:10:11 +08:00
|
|
|
URLS "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz"
|
2017-08-14 08:21:08 +08:00
|
|
|
FILENAME "glew-2.1.0.tgz"
|
|
|
|
SHA512 9a9b4d81482ccaac4b476c34ed537585ae754a82ebb51c3efa16d953c25cc3931be46ed2e49e79c730cd8afc6a1b78c97d52cd714044a339c3bc29734cd4d2ab
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
2017-08-14 08:21:08 +08:00
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE} ${CURRENT_BUILDTREES_DIR}/src/glew)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-06-22 13:31:23 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}/build/cmake
|
|
|
|
)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-06-22 13:31:23 +08:00
|
|
|
vcpkg_install_cmake()
|
2016-11-24 01:30:36 +08:00
|
|
|
|
2017-06-22 13:31:23 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/glew")
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2018-03-20 03:31:32 +08:00
|
|
|
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})
|
2017-06-22 14:25:57 +08:00
|
|
|
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)
|
2018-03-20 03:31:32 +08:00
|
|
|
endif()
|
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib)
|
2017-06-22 14:25:57 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libglew32d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/glew32d.lib)
|
|
|
|
endif()
|
2016-09-22 13:48:10 +08:00
|
|
|
|
2017-06-22 13:31:23 +08:00
|
|
|
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)
|
2016-11-24 01:30:36 +08:00
|
|
|
|
2017-06-22 14:25:57 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
2017-09-25 20:48:34 +08:00
|
|
|
foreach(FILE ${CURRENT_PACKAGES_DIR}/include/GL/glew.h ${CURRENT_PACKAGES_DIR}/include/GL/wglew.h ${CURRENT_PACKAGES_DIR}/include/GL/glxew.h)
|
|
|
|
file(READ ${FILE} _contents)
|
|
|
|
string(REPLACE "#ifdef GLEW_STATIC" "#if 1" _contents "${_contents}")
|
|
|
|
file(WRITE ${FILE} "${_contents}")
|
|
|
|
endforeach()
|
2017-06-22 14:25:57 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
2017-11-17 15:54:55 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glew RENAME copyright)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|