imgui-sfml
imgui-sfml copied to clipboard
I used cmake fetchcontent to include your library to use with conan.
An old version is at:
self.requires("imgui-sfml/2.1@bincrafters/stable")
I think that bincrafters is being phased out.
conan-center-index has these two packages.
self.requires("imgui/1.84.2")
self.requires("sfml/2.5.1")
I was trying to use imgui-sfml with the newer conan packages, but I had trouble including your project. So I did some custom cmake to make things work.
include(FetchContent)
find_package(imgui REQUIRED) #from conan
find_package(sfml REQUIRED) #from conan
#list(GET imgui_INCLUDE_DIRS 0 IMGUI_DIR)
#message(STATUS "dir='${IMGUI_DIR}'")
#foreach(dir ${imgui_INCLUDE_DIRS})
# message(STATUS "dir='${dir}'")
#endforeach()
#options for FetchContent are at https://cmake.org/cmake/help/latest/module/ExternalProject.html
FetchContent_Declare(
imgui-sfml_fetch
GIT_REPOSITORY https://github.com/eliasdaler/imgui-sfml.git
GIT_TAG origin/master
GIT_REMOTE_UPDATE_STRATEGY CHECKOUT
)
#FetchContent_MakeAvailable(imgui-sfml_fetch)
FetchContent_GetProperties(imgui-sfml_fetch)
if (NOT imgui-sfml_fetch_POPULATED)
FetchContent_Populate(imgui-sfml_fetch)
#add_subdirectory(${imgui-sfml_fetch_SOURCE_DIR} ${imgui-sfml_fetch_BINARY_DIR} EXCLUDE_FROM_ALL)
add_library(ImGui-SFML STATIC
${imgui-sfml_fetch_SOURCE_DIR}/imgui-SFML.cpp
)
target_include_directories(ImGui-SFML
PUBLIC ${imgui-sfml_fetch_SOURCE_DIR}
)
target_link_libraries(ImGui-SFML
PUBLIC imgui::imgui
PUBLIC sfml-graphics
PUBLIC sfml-system
PUBLIC sfml-window)
endif ()
I might one day try to do a pull request for conan to get a new package but I'm a newbie at conan.
I just thought someone might find this useful.
There's a new version here: https://github.com/bincrafters/community/tree/main/recipes/imgui-sfml I'm not sure how well it works - I'm not maintaining it. Someone needs to update it to 2.3, and I plan to do 2.4 release soon...