option(NNG_SETSTACKSIZE "Use rlimit for thread stack size" ON)
set(NNG_TESTS OFF)
set(NNG_ENABLE_NNGCAT OFF)
add_subdirectory(nng)

if (NOT SDL2_FOUND)
    add_subdirectory(SDL)
else()
    message("-- Using system-installed SDL version ${SDL2_VERSION}")
endif()

add_library(imgui OBJECT
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_demo.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_draw.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_tables.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/imgui_widgets.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/backends/imgui_impl_sdl.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/imgui/backends/imgui_impl_sdlrenderer.cpp
)

target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
target_link_libraries(imgui PUBLIC SDL2::SDL2-static)
