# ============================================================================== # 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")