2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2016-10-21 05:13:40 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glew-2.0.0)
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2016-10-21 05:13:40 +08:00
|
|
|
URLS "https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz"
|
2016-10-21 05:27:22 +08:00
|
|
|
FILENAME "glew-2.0.0.tgz"
|
2016-10-21 05:13:40 +08:00
|
|
|
SHA512 e9bcd5f19a4495ce6511dfd76e64b4e4d958603c513ee9063eb9fe24fc6e0413f168620661230f1baef558f2f907cef7fe7ab2bdf957a6f7bda5fe96e9319c6a
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
|
|
|
|
2016-09-22 14:28:12 +08:00
|
|
|
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
|
|
|
|
SET(BUILD_ARCH "Win32")
|
|
|
|
ELSEIF(TRIPLET_SYSTEM_ARCH MATCHES "arm")
|
2016-10-18 04:33:47 +08:00
|
|
|
MESSAGE(FATAL_ERROR " ARM is currently not supported.")
|
2016-09-22 14:28:12 +08:00
|
|
|
ELSE()
|
|
|
|
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
|
|
|
|
ENDIF()
|
|
|
|
|
2016-09-29 08:05:56 +08:00
|
|
|
if(NOT EXISTS ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj)
|
2016-09-19 11:50:08 +08:00
|
|
|
message(STATUS "Upgrading projects")
|
2016-09-29 08:05:56 +08:00
|
|
|
file(READ ${SOURCE_PATH}/build/vc12/glew_shared.vcxproj PROJ)
|
2016-09-19 11:50:08 +08:00
|
|
|
string(REPLACE
|
|
|
|
"<PlatformToolset>v120</PlatformToolset>"
|
|
|
|
"<PlatformToolset>v140</PlatformToolset>"
|
|
|
|
PROJ ${PROJ})
|
|
|
|
string(REPLACE
|
|
|
|
"opengl32.lib%"
|
|
|
|
"opengl32.lib\;%"
|
|
|
|
PROJ ${PROJ})
|
2016-09-29 08:05:56 +08:00
|
|
|
file(WRITE ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj ${PROJ})
|
2016-09-19 11:50:08 +08:00
|
|
|
endif()
|
|
|
|
message(STATUS "Upgrading projects done")
|
|
|
|
|
|
|
|
vcpkg_build_msbuild(
|
2016-09-29 08:05:56 +08:00
|
|
|
PROJECT_PATH ${SOURCE_PATH}/build/vc12/glew_shared14.vcxproj
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
message(STATUS "Installing")
|
2016-09-22 13:48:10 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
file(INSTALL
|
2016-09-29 08:05:56 +08:00
|
|
|
${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.dll
|
|
|
|
${SOURCE_PATH}/bin/Debug/${BUILD_ARCH}/glew32d.pdb
|
2016-09-19 11:50:08 +08:00
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
|
|
|
|
)
|
|
|
|
file(INSTALL
|
2016-09-29 08:05:56 +08:00
|
|
|
${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.dll
|
|
|
|
${SOURCE_PATH}/bin/Release/${BUILD_ARCH}/glew32.pdb
|
2016-09-19 11:50:08 +08:00
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
)
|
|
|
|
file(INSTALL
|
2016-09-29 08:05:56 +08:00
|
|
|
${SOURCE_PATH}/lib/Debug/${BUILD_ARCH}/glew32d.lib
|
2016-09-19 11:50:08 +08:00
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
|
|
)
|
|
|
|
file(INSTALL
|
2016-09-29 08:05:56 +08:00
|
|
|
${SOURCE_PATH}/lib/Release/${BUILD_ARCH}/glew32.lib
|
2016-09-19 11:50:08 +08:00
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
)
|
|
|
|
file(INSTALL
|
2016-09-29 08:05:56 +08:00
|
|
|
${SOURCE_PATH}/include/GL
|
2016-09-19 11:50:08 +08:00
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
|
|
)
|
2016-09-29 08:05:56 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glew RENAME copyright)
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
message(STATUS "Installing done")
|