Files
cuber/deps/Findimnodes.cmake
T
portersky 90d013695d feat: add OpenGL abstraction layer with RAII resources
- Replace window class with cbt::opengl::context
- Add buffer resource (VBO, EBO, UBO, SSBO) with move semantics
- Add texture resource with format/type enums and filtering
- Add descriptor_set for Vulkan-style resource binding
- All resources use RAII with proper cleanup
2026-05-05 21:58:34 +02:00

48 lines
1.7 KiB
CMake

# ==============================================================================
# Find imnodes
# ==============================================================================
# Builds imnodes from the bundled sources in deps/imnodes/.
#
# Targets provided:
# imnodes::imnodes - The imnodes library target
#
# Variables set:
# imnodes_FOUND - TRUE if imnodes is available
# imnodes_LIBRARIES - The imnodes library target (imnodes::imnodes)
# imnodes_INCLUDE_DIR - Include directories for imnodes
# ==============================================================================
if (DEFINED _FINDIMNODES_INCLUDED)
return()
endif()
set(_FINDIMNODES_INCLUDED TRUE)
set(_imnodes_source_dir "${CMAKE_CURRENT_LIST_DIR}/imnodes")
if (NOT EXISTS "${_imnodes_source_dir}/imnodes.cpp")
message(FATAL_ERROR "imnodes sources not found at '${_imnodes_source_dir}'")
endif()
if (NOT TARGET imgui::imgui)
message(FATAL_ERROR "imnodes requires imgui::imgui to be available before find_package(imnodes)")
endif()
add_subdirectory("${_imnodes_source_dir}" "${CMAKE_BINARY_DIR}/_deps/imnodes-build" EXCLUDE_FROM_ALL)
if (NOT TARGET imnodes::imnodes)
message(FATAL_ERROR "imnodes: target imnodes::imnodes was not created")
endif()
set(imnodes_FOUND TRUE)
set(imnodes_LIBRARIES imnodes::imnodes)
get_target_property(_imnodes_inc imnodes INTERFACE_INCLUDE_DIRECTORIES)
set(imnodes_INCLUDE_DIR "${_imnodes_inc}")
if (_imnodes_inc AND TARGET imnodes)
set_target_properties(imnodes PROPERTIES
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_imnodes_inc}"
)
endif()
set(IMNODES_LICENSE_FILE "${_imnodes_source_dir}/LICENSE.md" CACHE FILEPATH "Path to imnodes license file")