2021-07-08 00:26:06 +08:00
if ( VCPKG_TARGET_IS_LINUX )
message ( WARNING "${PORT} requires the following libraries from the system package manager:\n libxmu-dev\n libxi-dev\n libgl-dev\n\nThese can be installed on Ubuntu systems via apt-get install libxmu-dev libxi-dev libgl-dev." )
endif ( )
2019-10-08 01:35:13 +08:00
# Don't change to vcpkg_from_github! The sources in the git repository (archives) are missing some files that are distributed inside releases.
2019-03-31 13:18:23 +08:00
# More info: https://github.com/nigels-com/glew/issues/31 and https://github.com/nigels-com/glew/issues/13
2019-10-08 01:35:13 +08:00
vcpkg_download_distfile ( ARCHIVE
2021-09-08 22:56:56 +08:00
U R L S " h t t p s : / / g i t h u b . c o m / n i g e l s - c o m / g l e w / r e l e a s e s / d o w n l o a d / g l e w - 2 . 2 . 0 / g l e w - 2 . 2 . 0 . t g z "
F I L E N A M E " g l e w - 2 . 2 . 0 . t g z "
S H A 5 1 2 5 7 4 5 3 6 4 6 6 3 5 6 0 9 d 5 4 f 6 2 f b 3 2 a 0 8 0 b 8 2 b 6 0 1 f d 4 7 1 f c f d 2 6 e 1 0 9 f 4 7 9 b 3 f e f 6 d f b c 2 4 b 8 3 f 4 b a 6 2 9 1 6 d 0 7 d 6 2 c d 0 6 d 1 4 0 9 a d 7 a a 1 9 b c 1 c d 7 c f 3 6 3 9 c 1 0 3 c 8 1 5 b 8 b e 3 1 d 1
2016-09-19 11:50:08 +08:00
)
2019-10-08 01:35:13 +08:00
2019-06-13 06:44:25 +08:00
vcpkg_extract_source_archive_ex (
2019-10-08 01:35:13 +08:00
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
A R C H I V E $ { A R C H I V E }
2019-06-13 06:44:25 +08:00
R E F g l e w
2021-09-08 22:56:56 +08:00
P A T C H E S
f i x - L N K 2 0 1 9 . p a t c h
2019-06-13 06:44:25 +08:00
)
2016-09-19 11:50:08 +08:00
2021-09-08 22:56:56 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } / b u i l d / c m a k e "
2019-04-06 00:38:26 +08:00
D I S A B L E _ P A R A L L E L _ C O N F I G U R E
2019-03-31 13:18:23 +08:00
O P T I O N S
- D B U I L D _ U T I L S = O F F
2019-10-08 01:35:13 +08:00
)
2016-09-19 11:50:08 +08:00
2021-09-08 22:56:56 +08:00
vcpkg_cmake_install ( )
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/glew )
2021-02-11 15:55:18 +08:00
# Skip check the required dependency opengl
vcpkg_fixup_pkgconfig ( SKIP_CHECK )
2016-09-19 11:50:08 +08:00
2020-07-31 13:37:02 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
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 ( )
2021-09-08 22:56:56 +08:00
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 ( )
2021-09-08 22:56:56 +08:00
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" )
2017-06-22 14:25:57 +08:00
endif ( )
2020-02-12 09:30:03 +08:00
endif ( )
2016-09-22 13:48:10 +08:00
2017-06-22 14:25:57 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2021-09-08 22:56:56 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" )
foreach ( FILE "${CURRENT_PACKAGES_DIR}/include/GL/glew.h" "${CURRENT_PACKAGES_DIR}/include/GL/wglew.h" "${CURRENT_PACKAGES_DIR}/include/GL/glxew.h" )
2017-09-25 20:48:34 +08:00
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 ( )
2021-09-08 22:56:56 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2017-06-22 14:25:57 +08:00
2021-09-08 22:56:56 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
file ( INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )