aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/imgui-node-editor
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/imgui-node-editor
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/imgui-node-editor')
-rw-r--r--vcpkg/ports/imgui-node-editor/CMakeLists.txt60
-rw-r--r--vcpkg/ports/imgui-node-editor/fix-vec2-math-operators.patch35
-rw-r--r--vcpkg/ports/imgui-node-editor/portfile.cmake27
-rw-r--r--vcpkg/ports/imgui-node-editor/remove-getkeyindex.patch72
-rw-r--r--vcpkg/ports/imgui-node-editor/vcpkg.json19
5 files changed, 213 insertions, 0 deletions
diff --git a/vcpkg/ports/imgui-node-editor/CMakeLists.txt b/vcpkg/ports/imgui-node-editor/CMakeLists.txt
new file mode 100644
index 0000000..852290e
--- /dev/null
+++ b/vcpkg/ports/imgui-node-editor/CMakeLists.txt
@@ -0,0 +1,60 @@
+cmake_minimum_required(VERSION 3.8)
+project(imgui-node-editor)
+
+set(CMAKE_CXX_STANDARD 14)
+
+find_package(imgui CONFIG REQUIRED)
+get_target_property(IMGUI_INCLUDE_DIRS imgui::imgui
+ INTERFACE_INCLUDE_DIRECTORIES
+)
+
+add_library(${PROJECT_NAME} "")
+
+target_include_directories(
+ ${PROJECT_NAME}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ PRIVATE
+ ${IMGUI_INCLUDE_DIRS}
+)
+
+target_sources(
+ ${PROJECT_NAME}
+ PRIVATE
+ crude_json.cpp
+ imgui_canvas.cpp
+ imgui_node_editor.cpp
+ imgui_node_editor_api.cpp
+)
+
+install(
+ TARGETS ${PROJECT_NAME}
+ EXPORT unofficial-${PROJECT_NAME}-target
+ ARCHIVE DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+
+if (NOT IMGUI_NODE_EDITOR_SKIP_HEADERS)
+ install(
+ FILES
+ crude_json.h
+ imgui_bezier_math.h
+ imgui_bezier_math.inl
+ imgui_canvas.h
+ imgui_extra_math.h
+ imgui_extra_math.inl
+ imgui_node_editor.h
+ imgui_node_editor_internal.h
+ imgui_node_editor_internal.inl
+ DESTINATION include/${PROJECT_NAME}
+ )
+endif()
+
+install(
+ EXPORT unofficial-${PROJECT_NAME}-target
+ NAMESPACE unofficial::${PROJECT_NAME}::
+ FILE unofficial-${PROJECT_NAME}-config.cmake
+ DESTINATION share/unofficial-${PROJECT_NAME}
+)
diff --git a/vcpkg/ports/imgui-node-editor/fix-vec2-math-operators.patch b/vcpkg/ports/imgui-node-editor/fix-vec2-math-operators.patch
new file mode 100644
index 0000000..c4115d9
--- /dev/null
+++ b/vcpkg/ports/imgui-node-editor/fix-vec2-math-operators.patch
@@ -0,0 +1,35 @@
+diff --git a/imgui_extra_math.h b/imgui_extra_math.h
+index 5c46cc4..18f6dad 100644
+--- a/imgui_extra_math.h
++++ b/imgui_extra_math.h
+@@ -30,8 +30,10 @@ struct ImLine
+
+
+ //------------------------------------------------------------------------------
++# if IMGUI_VERSION_NUM < 19002
+ inline bool operator==(const ImVec2& lhs, const ImVec2& rhs);
+ inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs);
++#endif
+ inline ImVec2 operator*(const float lhs, const ImVec2& rhs);
+ # if IMGUI_VERSION_NUM < 18955
+ inline ImVec2 operator-(const ImVec2& lhs);
+diff --git a/imgui_extra_math.inl b/imgui_extra_math.inl
+index 8b1b071..acc1254 100644
+--- a/imgui_extra_math.inl
++++ b/imgui_extra_math.inl
+@@ -19,6 +19,7 @@
+
+
+ //------------------------------------------------------------------------------
++# if IMGUI_VERSION_NUM < 19002
+ inline bool operator==(const ImVec2& lhs, const ImVec2& rhs)
+ {
+ return lhs.x == rhs.x && lhs.y == rhs.y;
+@@ -28,6 +29,7 @@ inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs)
+ {
+ return lhs.x != rhs.x || lhs.y != rhs.y;
+ }
++#endif
+
+ inline ImVec2 operator*(const float lhs, const ImVec2& rhs)
+ {
diff --git a/vcpkg/ports/imgui-node-editor/portfile.cmake b/vcpkg/ports/imgui-node-editor/portfile.cmake
new file mode 100644
index 0000000..991b7ad
--- /dev/null
+++ b/vcpkg/ports/imgui-node-editor/portfile.cmake
@@ -0,0 +1,27 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO thedmd/imgui-node-editor
+ REF v${VERSION}
+ SHA512 83573b6ed776095837373bc95be1c1f5b85e9c5fae2145647f9cb6fdc17d3889edce716ac9e27c1bbde56f00803a66db98ca856910e6e0ce8714d3c5ce3f7c3f
+ HEAD_REF master
+ PATCHES
+ fix-vec2-math-operators.patch
+ remove-getkeyindex.patch # GetKeyIndex() is a no-op since 1.87; see https://github.com/ocornut/imgui/issues/5979#issuecomment-1345349492
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS_DEBUG
+ -DIMGUI_NODE_EDITOR_SKIP_HEADERS=ON
+)
+
+vcpkg_cmake_install()
+
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/imgui-node-editor/remove-getkeyindex.patch b/vcpkg/ports/imgui-node-editor/remove-getkeyindex.patch
new file mode 100644
index 0000000..b05377e
--- /dev/null
+++ b/vcpkg/ports/imgui-node-editor/remove-getkeyindex.patch
@@ -0,0 +1,72 @@
+diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp
+index 1d2bb06..f70d099 100644
+--- a/imgui_node_editor.cpp
++++ b/imgui_node_editor.cpp
+@@ -60,6 +60,7 @@ namespace Detail {
+
+ DECLARE_KEY_TESTER(ImGuiKey_F);
+ DECLARE_KEY_TESTER(ImGuiKey_D);
++DECLARE_KEY_TESTER(ImGuiKey_Delete);
+
+ static inline int GetKeyIndexForF()
+ {
+@@ -70,6 +71,11 @@ static inline int GetKeyIndexForD()
+ {
+ return KeyTester_ImGuiKey_D::Get<ImGuiKey_>(nullptr);
+ }
++
++static inline int GetKeyIndexForDelete()
++{
++ return KeyTester_ImGuiKey_Delete::Get<ImGuiKey_>(nullptr);
++}
+ # else
+ static inline ImGuiKey GetKeyIndexForF()
+ {
+@@ -80,6 +86,11 @@ static inline ImGuiKey GetKeyIndexForD()
+ {
+ return ImGuiKey_D;
+ }
++
++static inline ImGuiKey GetKeyIndexForDelete()
++{
++ return ImGuiKey_Delete;
++}
+ # endif
+
+ } // namespace Detail
+@@ -4391,6 +4402,7 @@ ed::EditorAction::AcceptResult ed::ShortcutAction::Accept(const Control& control
+ Action candidateAction = None;
+
+ auto& io = ImGui::GetIO();
++# if !defined(IMGUI_VERSION_NUM) || (IMGUI_VERSION_NUM < 18822)
+ if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_X)))
+ candidateAction = Cut;
+ if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_C)))
+@@ -4401,6 +4413,18 @@ ed::EditorAction::AcceptResult ed::ShortcutAction::Accept(const Control& control
+ candidateAction = Duplicate;
+ if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space)))
+ candidateAction = CreateNode;
++# else
++ if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_X))
++ candidateAction = Cut;
++ if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_C))
++ candidateAction = Copy;
++ if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_V))
++ candidateAction = Paste;
++ if (io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(GetKeyIndexForD()))
++ candidateAction = Duplicate;
++ if (!io.KeyCtrl && !io.KeyShift && !io.KeyAlt && ImGui::IsKeyPressed(ImGuiKey_Space))
++ candidateAction = CreateNode;
++# endif
+
+ if (candidateAction != None)
+ {
+@@ -4953,7 +4977,7 @@ ed::EditorAction::AcceptResult ed::DeleteItemsAction::Accept(const Control& cont
+ return False;
+
+ auto& io = ImGui::GetIO();
+- if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Delete)) && Editor->AreShortcutsEnabled())
++ if (Editor->CanAcceptUserInput() && ImGui::IsKeyPressed(GetKeyIndexForDelete()) && Editor->AreShortcutsEnabled())
+ {
+ auto& selection = Editor->GetSelectedObjects();
+ if (!selection.empty())
diff --git a/vcpkg/ports/imgui-node-editor/vcpkg.json b/vcpkg/ports/imgui-node-editor/vcpkg.json
new file mode 100644
index 0000000..fd4bb73
--- /dev/null
+++ b/vcpkg/ports/imgui-node-editor/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "imgui-node-editor",
+ "version": "0.9.3",
+ "port-version": 2,
+ "description": "Node Editor built using Dear ImGui",
+ "homepage": "https://github.com/thedmd/imgui-node-editor",
+ "license": "MIT",
+ "dependencies": [
+ "imgui",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}