-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vsgImGui #28912
Open
jeongseok-meta
wants to merge
9
commits into
conda-forge:main
Choose a base branch
from
jeongseok-meta:vsgImGui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+701
−0
Open
Add vsgImGui #28912
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
72f21c4
Add vsgImGui
jeongseok-meta 6cbd5a7
Update patches
jeongseok-meta 4c4e148
Add patch for package cmake config
jeongseok-meta 9640137
Fix include in example
jeongseok-meta bbc6920
Simplify example
jeongseok-meta f408c0d
Merge branch 'main' into vsgImGui
jeongseok-meta 200a260
Merge branch 'main' into vsgImGui
jeongseok-meta 1944b85
Merge branch 'main' into vsgImGui
jeongseok-meta c528b78
Use rm command instead of patch
jeongseok-meta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@echo on | ||
|
||
cmake %SRC_DIR% ^ | ||
%CMAKE_ARGS% ^ | ||
-B build ^ | ||
-DBUILD_SHARED_LIBS=ON ^ | ||
-DVSG_IMGUI_USE_SYSTEM_IMGUI=ON ^ | ||
-DVSG_IMGUI_USE_SYSTEM_IMPLOT=ON | ||
|
||
cmake --build build --parallel --config Release | ||
if errorlevel 1 exit 1 | ||
|
||
cmake --install build --config Release | ||
if errorlevel 1 exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -exo pipefail | ||
|
||
cmake $SRC_DIR \ | ||
${CMAKE_ARGS} \ | ||
-G Ninja \ | ||
-B build \ | ||
-DBUILD_SHARED_LIBS=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DVSG_IMGUI_USE_SYSTEM_IMGUI=ON \ | ||
-DVSG_IMGUI_USE_SYSTEM_IMPLOT=ON | ||
|
||
cmake --build build --parallel | ||
|
||
cmake --install build --strip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{% set name = "vsgImGui" %} | ||
{% set version = "0.6.0" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
- url: https://github.com/vsg-dev/vsgImGui/archive/v{{ version }}.tar.gz | ||
sha256: 1697d53c4d4a91b90837c16196d891ecff20bb0469e1947caccada03e6dca864 | ||
patches: | ||
- patches/0001-Add-options-to-use-system-dependencies.patch | ||
- patches/0002-Remove-imgui-and-implot-from-include-folder.patch | ||
- patches/0003-Find-imgui-and-implot-in-package-config-when-system-.patch | ||
|
||
build: | ||
number: 0 | ||
run_exports: | ||
- {{ pin_subpackage('vsgimgui', max_pin='x.x') }} | ||
|
||
requirements: | ||
build: | ||
- {{ compiler('cxx') }} | ||
- {{ stdlib('c') }} | ||
- cmake | ||
- ninja # [not win] | ||
- pkgconfig # [linux] | ||
host: | ||
- imgui | ||
- implot | ||
- libvulkan-headers | ||
- libvulkan-loader | ||
- vulkanscenegraph | ||
run: | ||
- libvulkan-loader | ||
- vulkanscenegraph | ||
|
||
test: | ||
commands: | ||
- test -f $PREFIX/include/vsgImGui/Export.h # [not win] | ||
- test -f $PREFIX/lib/libvsgImGui${SHLIB_EXT} # [not win] | ||
- test -f $PREFIX/lib/cmake/vsgImGui/vsgImGuiConfig.cmake # [not win] | ||
- if not exist %PREFIX%\\Library\\include\\vsgImGui\\Export.h exit 1 # [win] | ||
- if not exist %PREFIX%\\Library\\lib\\vsgImGui.lib exit 1 # [win] | ||
- if not exist %PREFIX%\\Library\\bin\\vsgImGui.dll exit 1 # [win] | ||
- if not exist %PREFIX%\\Library\\lib\\cmake\\vsgImGui\\vsgImGuiConfig.cmake exit 1 # [win] | ||
requires: | ||
- {{ compiler("c") }} | ||
- {{ compiler("cxx") }} | ||
- cmake | ||
- ninja # [not win] | ||
- pkgconfig # [linux] | ||
- vsgXchange | ||
files: | ||
- tests/ | ||
|
||
about: | ||
home: https://vsg-dev.github.io/vsg-dev.io/ | ||
summary: Integration of VulkanSceneGraph with ImGui | ||
license: MIT | ||
license_file: LICENSE.md | ||
dev_url: https://github.com/vsg-dev/vsgImGui | ||
|
||
extra: | ||
recipe-maintainers: | ||
- jeongseok-meta |
248 changes: 248 additions & 0 deletions
248
recipes/vsgimgui/patches/0001-Add-options-to-use-system-dependencies.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,248 @@ | ||
From 13d974246cea7cb24b985008516a947bf393f53c Mon Sep 17 00:00:00 2001 | ||
From: Jeongseok Lee <[email protected]> | ||
Date: Thu, 23 Jan 2025 15:36:00 -0800 | ||
Subject: [PATCH 1/2] Add options to use system dependencies | ||
|
||
--- | ||
CMakeLists.txt | 54 ++++++++++++++-------- | ||
include/vsgImGui/RenderImGui.h | 2 +- | ||
src/CMakeLists.txt | 74 +++++++++++++++++++++--------- | ||
src/vsgImGui/RenderImGui.cpp | 4 +- | ||
src/vsgImGui/SendEventsToImGui.cpp | 2 +- | ||
5 files changed, 93 insertions(+), 43 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index e1679d2..464b8ee 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -5,6 +5,10 @@ project(vsgImGui | ||
DESCRIPTION "VulkanSceneGraph, ImGui and ImPlot integration library" | ||
LANGUAGES CXX | ||
) | ||
+ | ||
+option(VSG_IMGUI_USE_SYSTEM_IMGUI "Use system installed ImGui" OFF) | ||
+option(VSG_IMGUI_USE_SYSTEM_IMPLOT "Use system installed ImPlot" OFF) | ||
+ | ||
set(VSGIMGUI_SOVERSION 0) | ||
SET(VSGIMGUI_RELEASE_CANDIDATE 0) | ||
|
||
@@ -27,29 +31,43 @@ find_package(vsg 1.0.5) | ||
vsg_setup_dir_vars() | ||
vsg_setup_build_vars() | ||
|
||
-if ( (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.h) OR | ||
- (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/implot/implot.h) ) | ||
- find_package(Git QUIET) | ||
+if(NOT VSG_IMGUI_USE_SYSTEM_IMGUI OR NOT VSG_IMGUI_USE_SYSTEM_IMPLOT) | ||
+ if ( (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.h) OR | ||
+ (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/implot/implot.h) ) | ||
+ find_package(Git QUIET) | ||
|
||
- execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
- RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
+ execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
+ RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
|
||
- if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
- message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
+ if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
+ message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
+ endif() | ||
endif() | ||
endif() | ||
|
||
-vsg_copy_imgui_headers( | ||
- FILES | ||
- ${VSGIMGUI_SOURCE_DIR}/src/imgui/imgui.h | ||
- ${VSGIMGUI_SOURCE_DIR}/src/imgui/imconfig.h | ||
- ${VSGIMGUI_SOURCE_DIR}/src/imgui/imgui_internal.h | ||
- ${VSGIMGUI_SOURCE_DIR}/src/imgui/imstb_textedit.h | ||
- ${VSGIMGUI_SOURCE_DIR}/src/imgui//misc/cpp/imgui_stdlib.h | ||
- ${VSGIMGUI_SOURCE_DIR}/src/implot/implot.h | ||
- ${VSGIMGUI_SOURCE_DIR}/src/implot/implot_internal.h | ||
-) | ||
+if(VSG_IMGUI_USE_SYSTEM_IMGUI) | ||
+ find_package(imgui CONFIG REQUIRED) | ||
+else() | ||
+ vsg_copy_imgui_headers( | ||
+ FILES | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/imgui/imgui.h | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/imgui/imconfig.h | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/imgui/imgui_internal.h | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/imgui/imstb_textedit.h | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/imgui//misc/cpp/imgui_stdlib.h | ||
+ ) | ||
+endif() | ||
+ | ||
+if(VSG_IMGUI_USE_SYSTEM_IMPLOT) | ||
+ find_package(implot CONFIG REQUIRED) | ||
+else() | ||
+ vsg_copy_imgui_headers( | ||
+ FILES | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/implot/implot.h | ||
+ ${VSGIMGUI_SOURCE_DIR}/src/implot/implot_internal.h | ||
+ ) | ||
+endif() | ||
|
||
vsg_add_target_clang_format( | ||
FILES | ||
diff --git a/include/vsgImGui/RenderImGui.h b/include/vsgImGui/RenderImGui.h | ||
index 26a644d..3e427cd 100644 | ||
--- a/include/vsgImGui/RenderImGui.h | ||
+++ b/include/vsgImGui/RenderImGui.h | ||
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
#include <vsg/vk/DescriptorPool.h> | ||
|
||
#include <vsgImGui/Export.h> | ||
-#include <vsgImGui/imgui.h> | ||
+#include <imgui.h> | ||
|
||
namespace vsgImGui | ||
{ | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 41d749d..97720b2 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -6,41 +6,60 @@ set(EXTRA_INCLUDES) | ||
SET(HEADER_PATH ${VSGIMGUI_SOURCE_DIR}/include/vsgImGui) | ||
|
||
set(HEADERS | ||
- ${HEADER_PATH}/imgui.h | ||
${HEADER_PATH}/SendEventsToImGui.h | ||
${HEADER_PATH}/RenderImGui.h | ||
${HEADER_PATH}/Texture.h | ||
- imgui/imconfig.h | ||
- imgui/imgui_internal.h | ||
- imgui/imstb_rectpack.h | ||
- imgui/imstb_textedit.h | ||
- imgui/imstb_truetype.h | ||
- imgui/misc/cpp/imgui_stdlib.h | ||
- implot/implot.h | ||
- implot/implot_internal.h | ||
) | ||
|
||
set(SOURCES | ||
vsgImGui/RenderImGui.cpp | ||
vsgImGui/SendEventsToImGui.cpp | ||
vsgImGui/Texture.cpp | ||
- imgui/imgui.cpp | ||
- imgui/imgui_draw.cpp | ||
- imgui/imgui_tables.cpp | ||
- imgui/imgui_widgets.cpp | ||
- imgui/backends/imgui_impl_vulkan.cpp | ||
- imgui/misc/cpp/imgui_stdlib.cpp | ||
- implot/implot.cpp | ||
- implot/implot_items.cpp | ||
) | ||
|
||
-OPTION(SHOW_DEMO_WINDOW "Toggle the build of the ImGui::ShowDemoWindow(bool*) and ImPlot::ShadowDemoWindow(bool*)" ON) | ||
+if(NOT VSG_IMGUI_USE_SYSTEM_IMGUI) | ||
+ set(HEADERS ${HEADERS} | ||
+ imgui/imgui.h | ||
+ imgui/imconfig.h | ||
+ imgui/imgui_internal.h | ||
+ imgui/imstb_rectpack.h | ||
+ imgui/imstb_textedit.h | ||
+ imgui/imstb_truetype.h | ||
+ imgui/misc/cpp/imgui_stdlib.h | ||
+ ) | ||
|
||
-if (SHOW_DEMO_WINDOW) | ||
set(SOURCES ${SOURCES} | ||
- imgui/imgui_demo.cpp | ||
- implot/implot_demo.cpp | ||
+ imgui/imgui.cpp | ||
+ imgui/imgui_draw.cpp | ||
+ imgui/imgui_tables.cpp | ||
+ imgui/imgui_widgets.cpp | ||
+ imgui/backends/imgui_impl_vulkan.cpp | ||
+ imgui/misc/cpp/imgui_stdlib.cpp | ||
+ ) | ||
+endif() | ||
+ | ||
+if(NOT VSG_IMGUI_USE_SYSTEM_IMPLOT) | ||
+ set(HEADERS ${HEADERS} | ||
+ implot/implot.h | ||
+ implot/implot_internal.h | ||
) | ||
+ | ||
+ set(SOURCES ${SOURCES} | ||
+ implot/implot.cpp | ||
+ implot/implot_items.cpp | ||
+ ) | ||
+endif() | ||
+ | ||
+OPTION(SHOW_DEMO_WINDOW "Toggle the build of the ImGui::ShowDemoWindow(bool*) and ImPlot::ShadowDemoWindow(bool*)" ON) | ||
+ | ||
+if (SHOW_DEMO_WINDOW) | ||
+ if(NOT VSG_IMGUI_USE_SYSTEM_IMGUI) | ||
+ set(HEADERS ${HEADERS} imgui/imgui_demo.cpp) | ||
+ endif() | ||
+ | ||
+ if(NOT VSG_IMGUI_USE_SYSTEM_IMPLOT) | ||
+ set(SOURCES ${SOURCES} implot/implot_demo.cpp) | ||
+ endif() | ||
else() | ||
set(SOURCES ${SOURCES} | ||
vsgImGui/fallback_demo.cpp | ||
@@ -69,6 +88,11 @@ target_include_directories(vsgImGui PUBLIC | ||
$<INSTALL_INTERFACE:include> | ||
${EXTRA_INCLUDES} | ||
) | ||
+if(NOT VSG_IMGUI_USE_SYSTEM_IMGUI) | ||
+ target_include_directories(vsgImGui PRIVATE | ||
+ $<BUILD_INTERFACE:${VSGIMGUI_SOURCE_DIR}/src/imgui/backends> | ||
+ ) | ||
+endif() | ||
|
||
target_link_libraries(vsgImGui | ||
PUBLIC | ||
@@ -77,6 +101,14 @@ target_link_libraries(vsgImGui | ||
${EXTRA_LIBRARIES} | ||
) | ||
|
||
+if(VSG_IMGUI_USE_SYSTEM_IMGUI) | ||
+ target_link_libraries(vsgImGui PUBLIC imgui::imgui) | ||
+endif() | ||
+ | ||
+if(VSG_IMGUI_USE_SYSTEM_IMPLOT) | ||
+ target_link_libraries(vsgImGui PUBLIC implot::implot) | ||
+endif() | ||
+ | ||
install(TARGETS vsgImGui ${INSTALL_TARGETS_DEFAULT_FLAGS}) | ||
|
||
if (BUILD_SHARED_LIBS) | ||
diff --git a/src/vsgImGui/RenderImGui.cpp b/src/vsgImGui/RenderImGui.cpp | ||
index 306030b..f0af046 100644 | ||
--- a/src/vsgImGui/RenderImGui.cpp | ||
+++ b/src/vsgImGui/RenderImGui.cpp | ||
@@ -22,9 +22,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
</editor-fold> */ | ||
|
||
#include <vsgImGui/RenderImGui.h> | ||
-#include <vsgImGui/implot.h> | ||
+#include <implot.h> | ||
|
||
-#include "../imgui/backends/imgui_impl_vulkan.h" | ||
+#include <imgui_impl_vulkan.h> | ||
|
||
#include <vsg/io/Logger.h> | ||
#include <vsg/vk/State.h> | ||
diff --git a/src/vsgImGui/SendEventsToImGui.cpp b/src/vsgImGui/SendEventsToImGui.cpp | ||
index 11de226..ef784fc 100644 | ||
--- a/src/vsgImGui/SendEventsToImGui.cpp | ||
+++ b/src/vsgImGui/SendEventsToImGui.cpp | ||
@@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
</editor-fold> */ | ||
|
||
#include <vsgImGui/SendEventsToImGui.h> | ||
-#include <vsgImGui/imgui.h> | ||
+#include <imgui.h> | ||
|
||
#include <vsg/ui/KeyEvent.h> | ||
#include <vsg/ui/PointerEvent.h> | ||
-- | ||
2.20.1.windows.1 | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter may be confused by the casing differences between the name and the run_exports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xhochy I am facing the same issue. A change happened yesterday approximately 24 hours ago. I tested then a meta.yaml that worked a few hours before again, it gave the new error in the linter. Therefore, I suspect something on GitHub changed that makes the linter fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I'm also suspicious that there might be something else that could have caused this, because it was fine with other recipes (e.g., https://github.com/conda-forge/staged-recipes/pull/28730/files#diff-907e125340dccaf73eebc0b636349abcafcff964d43b2fe8a8fd742bfa354da0R1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter error is gone rebasing to #28925!