2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_common_functions)
|
2018-11-07 09:50:54 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO glfw/glfw
|
2019-04-25 02:09:58 +08:00
|
|
|
REF 3.3
|
|
|
|
SHA512 e74bb7ba0c1c3a524a193c4fb5a2d13ba0e75f8e309612ea19cdcc944859d6e2fe29d8b2e3db76236e1011b637564ddd5f4a176dcccfeb84d09bda060f08f774
|
2018-11-07 09:50:54 +08:00
|
|
|
HEAD_REF master
|
2019-09-11 01:46:47 +08:00
|
|
|
PATCHES
|
|
|
|
fix-config.patch
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
2019-08-26 11:31:55 +08:00
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
2018-11-07 09:50:54 +08:00
|
|
|
message(
|
|
|
|
"GLFW3 currently requires the following libraries from the system package manager:
|
|
|
|
xinerama
|
|
|
|
xcursor
|
2019-08-26 11:31:55 +08:00
|
|
|
xorg
|
|
|
|
libglu1-mesa
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2019-08-26 11:31:55 +08:00
|
|
|
These can be installed on Ubuntu systems via sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev")
|
2018-11-07 09:50:54 +08:00
|
|
|
endif()
|
2017-03-31 12:52:18 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
2016-09-29 08:05:56 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-08-01 04:01:02 +08:00
|
|
|
PREFER_NINJA
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
|
|
|
-DGLFW_BUILD_EXAMPLES=OFF
|
|
|
|
-DGLFW_BUILD_TESTS=OFF
|
|
|
|
-DGLFW_BUILD_DOCS=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2018-11-07 09:50:54 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/glfw3)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2016-11-01 09:21:57 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2018-11-07 09:50:54 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/glfw3.dll OR EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.dll)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/bin/glfw3.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glfw3.dll)
|
|
|
|
foreach(_conf release debug)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-${_conf}.cmake _contents)
|
|
|
|
string(REPLACE "lib/glfw3.dll" "bin/glfw3.dll" _contents "${_contents}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/glfw3/glfw3Targets-${_conf}.cmake "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2016-11-01 09:21:57 +08:00
|
|
|
endif()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2018-11-07 09:50:54 +08:00
|
|
|
vcpkg_copy_pdbs()
|