Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions ports/forge/cmake_config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
diff --git a/CMakeModules/ForgeConfig.cmake.in b/CMakeModules/ForgeConfig.cmake.in
index e4c7737..5a3b000 100644
--- a/CMakeModules/ForgeConfig.cmake.in
+++ b/CMakeModules/ForgeConfig.cmake.in
@@ -57,16 +57,24 @@ if (NOT TARGET Forge::forge AND
endif ()

if (TARGET Forge::forge)
- get_property(config TARGET Forge::forge PROPERTY IMPORTED_CONFIGURATIONS)
- if(NOT config)
- set(config "NOCONFIG")
+ get_property(configs TARGET Forge::forge PROPERTY IMPORTED_CONFIGURATIONS)
+ if(NOT configs)
+ set(configs "NOCONFIG")
endif()
- get_property(loc TARGET Forge::forge PROPERTY IMPORTED_LOCATION_${config})
+ foreach(config IN LISTS configs)
+ get_property(loc TARGET Forge::forge PROPERTY IMPORTED_LOCATION_${config})
+
+ # break if any of the imported configurations exist. All configs write to the same
+ # location so they are not working as CMake intended. Its fine for single config
+ # installers like ours.
+ if(EXISTS ${loc})
+ set(Forge_BINARY_EXISTS TRUE)
+ break()
+ endif()
+ endforeach()
endif ()

-if ((TARGET Forge::forge AND EXISTS ${loc})
- OR
- TARGET forge)
+if ((TARGET Forge::forge AND Forge_BINARY_EXISTS) OR TARGET forge)
set(Forge_FOUND ON)
if (TARGET forge AND NOT TARGET Forge::forge)
add_library(Forge::forge ALIAS forge)
@@ -75,3 +83,22 @@ if ((TARGET Forge::forge AND EXISTS ${loc})
else ()
set(Forge_FOUND OFF)
endif ()
+
+if(Forge_FOUND)
+ # Check for dependencies when Forge binary and cmake files are found
+ include(CMakeFindDependencyMacro)
+
+ find_dependency(glad CONFIG)
+ find_dependency(glfw3 CONFIG)
+ find_dependency(freetype CONFIG)
+ find_dependency(freeimage CONFIG)
+ find_dependency(OpenGL)
+
+ if(NOT WIN32)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(fontconfig REQUIRED)
+ if(NOT fontconfig_FOUND)
+ message(FATAL_ERROR "Please install Fontconfig dependency")
+ endif()
+ endif()
+endif()
28 changes: 0 additions & 28 deletions ports/forge/fix-static_build.patch

This file was deleted.

29 changes: 0 additions & 29 deletions ports/forge/fix-usage.patch

This file was deleted.

19 changes: 6 additions & 13 deletions ports/forge/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,24 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO arrayfire/forge
REF 1a0f0cb6371a8c8053ab5eb7cbe3039c95132389 # v1.0.5
SHA512 8f8607421880a0f0013380eb5efb3a4f05331cd415d68c9cd84dd57eb727da1df6223fc6d65b106675d6aa09c3388359fab64443c31fadadf7641161be6b3b89
REF v1.0.7
SHA512 d341d5c6bdccf7d2f085162d1d8209b0b28d73b8a9f3173546b26f06bf8e422b3fdf1cfbaa7d122ea75cee5cf5f6bb6dbd2bffc10d8e0c336b5b8695c39f7b54
HEAD_REF master
PATCHES
fix-static_build.patch
fix-usage.patch
PATCHES cmake_config.patch
)
file(REMOVE ${SOURCE_PATH}/CMakeModules/FindOpenGL.cmake)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DFG_BUILD_DOCS=OFF
-DFG_BUILD_EXAMPLES=OFF
-DFG_INSTALL_BIN_DIR=bin
-DFG_WITH_FREEIMAGE=OFF
-DFG_INSTALL_CMAKE_DIR=share/Forge
)

vcpkg_install_cmake()

if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/Forge/cmake)
endif()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/Forge TARGET_PATH share/Forge)

file(GLOB DLLS ${CURRENT_PACKAGES_DIR}/bin/* ${CURRENT_PACKAGES_DIR}/debug/bin/*)
list(FILTER DLLS EXCLUDE REGEX "forge\\.dll\$")
Expand Down
7 changes: 3 additions & 4 deletions ports/forge/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "forge",
"version-semver": "1.0.5",
"port-version": 1,
"description": "Helps with high performance visualizations involving OpenGL-CUDA/OpenCL interop.",
"version-semver": "1.0.7",
"description": "An OpenGL interop library that can be used with ArrayFire or any other application using CUDA or OpenCL compute backend.",
"homepage": "https://github.com/arrayfire/forge",
"supports": "x64",
"dependencies": [
Expand All @@ -13,7 +12,7 @@
},
"freeimage",
"freetype",
"glbinding",
"glad",
"glfw3",
"glm"
]
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,8 @@
"port-version": 0
},
"forge": {
"baseline": "1.0.5",
"port-version": 1
"baseline": "1.0.7",
"port-version": 0
},
"fp16": {
"baseline": "2021-02-21",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/forge.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ca5513200ad2efb90936120fdfc7ea8bb6730f9d",
"version-semver": "1.0.7",
"port-version": 0
},
{
"git-tree": "b160185b8e2d1f0bd2268cb56d73e0e6a2940f69",
"version-semver": "1.0.5",
Expand Down