aboutsummaryrefslogtreecommitdiff
path: root/ports/forge/cmake_config.patch
diff options
context:
space:
mode:
authorpradeep <pradeep.garigipati@gmail.com>2021-05-11 23:09:03 +0530
committerGitHub <noreply@github.com>2021-05-11 10:39:03 -0700
commit48678ea8b27e697ca613b6f1abff75f0984f370b (patch)
treee9398e770404346902fae2b1289552e750ba7718 /ports/forge/cmake_config.patch
parent56a5c2ac52835bcdfe5962568cf1e61376a1dd82 (diff)
downloadvcpkg-48678ea8b27e697ca613b6f1abff75f0984f370b.tar.gz
vcpkg-48678ea8b27e697ca613b6f1abff75f0984f370b.zip
[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
Diffstat (limited to 'ports/forge/cmake_config.patch')
-rw-r--r--ports/forge/cmake_config.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/ports/forge/cmake_config.patch b/ports/forge/cmake_config.patch
new file mode 100644
index 000000000..eb77265a0
--- /dev/null
+++ b/ports/forge/cmake_config.patch
@@ -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()