[Forge] update version to 1.0.7 (#17099)

* [forge] Update forge to v1.0.7 tag

- Use explicit cmake files install path
- Use REF option in vcpkg_from_github command to fetch tag

* [forge] Update version in baseline
This commit is contained in:
pradeep 2021-05-11 23:09:03 +05:30 committed by GitHub
parent 56a5c2ac52
commit 48678ea8b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 75 additions and 76 deletions

View File

@ -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()

View File

@ -1,28 +0,0 @@
diff --git a/extern/glad/CMakeLists.txt b/extern/glad/CMakeLists.txt
index c8c8d86..27adf86 100644
--- a/extern/glad/CMakeLists.txt
+++ b/extern/glad/CMakeLists.txt
@@ -2,15 +2,19 @@ add_library(forge_glad_interface INTERFACE)
target_include_directories(forge_glad_interface
INTERFACE
- ${CMAKE_CURRENT_SOURCE_DIR}/include
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_sources(forge_glad_interface
INTERFACE
- ${CMAKE_CURRENT_SOURCE_DIR}/src/glad.c
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/glad.c>
)
target_link_libraries(forge_glad_interface
INTERFACE
- ${CMAKE_DL_LIBS}
+ $<BUILD_INTERFACE:${CMAKE_DL_LIBS}>
)
+
+if (NOT BUILD_SHARED_LIBS)
+ install(TARGETS forge_glad_interface EXPORT ForgeTargets)
+endif ()
\ No newline at end of file

View File

@ -1,29 +0,0 @@
diff --git a/CMakeModules/ForgeConfig.cmake.in b/CMakeModules/ForgeConfig.cmake.in
index e4c7737..6429069 100644
--- a/CMakeModules/ForgeConfig.cmake.in
+++ b/CMakeModules/ForgeConfig.cmake.in
@@ -52,16 +52,18 @@ set(Forge_FOUND OFF)
if (NOT TARGET Forge::forge AND
NOT TARGET forge AND
- EXISTS @PACKAGE_CMAKE_DIR@/ForgeTargets.cmake)
- include(@PACKAGE_CMAKE_DIR@/ForgeTargets.cmake)
+ EXISTS ${CMAKE_CURRENT_LIST_DIR}/ForgeTargets.cmake)
+ include(${CMAKE_CURRENT_LIST_DIR}/ForgeTargets.cmake)
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 ${configs})
+ get_property(loc TARGET Forge::forge PROPERTY IMPORTED_LOCATION_${config})
+ endforeach()
endif ()
if ((TARGET Forge::forge AND EXISTS ${loc})

View File

@ -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\$")

View File

@ -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": [
@ -13,7 +12,7 @@
},
"freeimage",
"freetype",
"glbinding",
"glad",
"glfw3",
"glm"
]

View File

@ -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",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ca5513200ad2efb90936120fdfc7ea8bb6730f9d",
"version-semver": "1.0.7",
"port-version": 0
},
{
"git-tree": "b160185b8e2d1f0bd2268cb56d73e0e6a2940f69",
"version-semver": "1.0.5",