aboutsummaryrefslogtreecommitdiff
path: root/ports/glfw3
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:50:08 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:54:03 -0700
commitccca198c1b1730b0241911cb56dc8e3504958b2a (patch)
treea2dd9b8b087a09afdcecc5cbb3377bed15127eb2 /ports/glfw3
downloadvcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.tar.gz
vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.zip
Initial commit
Diffstat (limited to 'ports/glfw3')
-rw-r--r--ports/glfw3/CONTROL3
-rw-r--r--ports/glfw3/portfile.cmake58
2 files changed, 61 insertions, 0 deletions
diff --git a/ports/glfw3/CONTROL b/ports/glfw3/CONTROL
new file mode 100644
index 000000000..0015a9105
--- /dev/null
+++ b/ports/glfw3/CONTROL
@@ -0,0 +1,3 @@
+Source: glfw3
+Version: 3.1.2
+Description: GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development. It provides a simple, platform-independent API for creating windows, contexts and surfaces, reading input, handling events, etc. \ No newline at end of file
diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake
new file mode 100644
index 000000000..cbfa6134d
--- /dev/null
+++ b/ports/glfw3/portfile.cmake
@@ -0,0 +1,58 @@
+include(vcpkg_common_functions)
+vcpkg_download_distfile(ARCHIVE
+ URL "https://github.com/glfw/glfw/releases/download/3.1.2/glfw-3.1.2.zip"
+ FILENAME "glfw-3.1.2.zip"
+ MD5 8023327bfe979b3fe735e449e2f54842
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+if(NOT EXISTS ${CURRENT_BUILDTREES_DIR}/patch.stamp)
+ file(READ ${CURRENT_BUILDTREES_DIR}/src/glfw-3.1.2/src/glfw3Config.cmake.in CONFIG)
+ string(REPLACE "\"@GLFW_LIB_NAME@\"" "NAMES @GLFW_LIB_NAME@ @GLFW_LIB_NAME@dll"
+ CONFIG ${CONFIG}
+ )
+ string(REPLACE "@PACKAGE_CMAKE_INSTALL_PREFIX@" "@PACKAGE_CMAKE_INSTALL_PREFIX@/../.."
+ CONFIG ${CONFIG}
+ )
+ file(WRITE ${CURRENT_BUILDTREES_DIR}/src/glfw-3.1.2/src/glfw3Config.cmake.in ${CONFIG})
+ file(APPEND ${CURRENT_BUILDTREES_DIR}/src/glfw-3.1.2/src/glfw3Config.cmake.in "set(GLFW3_LIBRARIES \${GLFW3_LIBRARY})\n")
+ file(WRITE ${CURRENT_BUILDTREES_DIR}/patch.stamp)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glfw-3.1.2
+ OPTIONS
+ -DBUILD_SHARED_LIBS=ON
+ -DGLFW_BUILD_EXAMPLES=OFF
+ -DGLFW_BUILD_TESTS=OFF
+ -DGLFW_BUILD_DOCS=OFF
+ -DPACKAGE_CMAKE_INSTALL_PREFIX=\${CMAKE_CURRENT_LIST_DIR}/../..
+ # OPTIONS_RELEASE -DOPTIMIZE=1
+ # OPTIONS_DEBUG -DDEBUGGABLE=1
+)
+
+vcpkg_build_cmake()
+vcpkg_install_cmake()
+
+file(MAKE_DIRECTORY
+ ${CURRENT_PACKAGES_DIR}/bin
+ ${CURRENT_PACKAGES_DIR}/debug/bin
+ ${CURRENT_PACKAGES_DIR}/share
+)
+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)
+
+file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/glfw ${CURRENT_PACKAGES_DIR}/share/glfw3)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
+file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/glfw/glfwTargets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/glfw3/glfwTargets-debug.cmake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/glfw3.lib)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/glfw3.lib)
+
+file(COPY ${CURRENT_BUILDTREES_DIR}/src/glfw-3.1.2/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/glfw3)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/glfw3/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/glfw3/copyright)
+vcpkg_copy_pdbs()
+