-
Notifications
You must be signed in to change notification settings - Fork 55
Working example on Mac and Linux #35
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
Conversation
|
I'll be reviewing this in the following weeks as work at uni has me quite busy. Meanwhile thanks for the contribution |
|
Thanks pavanakumar for sharing your example. It would be nice if the documentation.md had a sort of "quick start" section or example.md to reference how to integrate a simple demo/starting point into an app's main loop. And thank you for the awesome node editor, Fattorino 👍 |
|
it's sad to leave this PR un-merged and not updating the project more often. I hope one day I'll be able to show some love to it again and fix up some left over things. |
|
@Fattorino do you need some help to manage this project? |
|
Ok here is the updated CMakeLists that fixes warnings and specify ImGui version. Otherwise, this PR is a must have to quick test and understand the library. Maybe in the future: add the possibility to add nodes + draw them in specified X,Y positions. @AaronAppel can you update your PR? cmake_minimum_required(VERSION 3.14)
project(MyProject VERSION 1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(IMGUI_DIR ${CMAKE_CURRENT_LIST_DIR}/includes/imgui)
set(IMNODEFLOW_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
include(FetchContent)
FetchContent_Declare(
imgui
GIT_REPOSITORY "https://github.com/ocornut/imgui.git"
GIT_TAG "v1.91.6" # Update with future minimum compatibility
SOURCE_DIR ${IMGUI_DIR}
GIT_SHALLOW TRUE # Limit history to download
)
FetchContent_MakeAvailable(imgui)
list(APPEND imgui_sources
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/misc/cpp/imgui_stdlib.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/backends/imgui_impl_sdl2.cpp
${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
)
list(APPEND imnode_flow_sources
${IMNODEFLOW_DIR}/src/ImNodeFlow.cpp
)
add_executable(example example.cpp ${imgui_sources} ${imnode_flow_sources})
target_include_directories(example PRIVATE ${IMGUI_DIR} ${IMNODEFLOW_DIR}/include ${IMGUI_DIR}/backends)
target_compile_definitions(example PRIVATE IMGUI_DEFINE_MATH_OPERATORS)
if(CMAKE_SYSTEM_NAME MATCHES Emscripten)
include(cmake/emscripten.cmake)
else()
include(cmake/desktop.cmake)
endif()
|
|
Is this cmake for the example? |
|
This is a change set to the existing CMakeLists.txt for the example I created, have now merged the changes by @arabine and a fix to the window header |
|
Okay nice, go for merge on my side. (not tested ecmascripten). |
Fattorino
left a comment
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.
Everything looks good, I just left two comments on minor details
|
@pavanakumar I was taling about the "global" CMake, not the example one. I don't like how, now, to use the library you have to manually add the .cpp file to the list of sources of the executable. I much prefer the use of add_subdirectory() and then linking. |
Thanks for the fantastic library. I have
CMakeList.txtthat automatically download the sources and setup the targetsCMakeLists.txtis provided inreadme.txtfor other backendssrc/imgui_bezier_math.inlinclude/ImNodeFlow.hCMakeLists.txtfrom root folder