diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt index 1cea873..d3e756e 100644 --- a/Components/Overlay/CMakeLists.txt +++ b/Components/Overlay/CMakeLists.txt @@ -19,12 +19,8 @@ list(APPEND HEADER_FILES file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) - list(APPEND SOURCE_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_draw.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_widgets.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_demo.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/misc/freetype/imgui_freetype.cpp) + find_package(imgui CONFIG REQUIRED) + find_path(IMGUI_INCLUDE_DIR imgui.h) else() list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreImGuiOverlay.cpp") endif() @@ -32,13 +28,13 @@ endif() # setup target add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) -target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) +target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB imgui::imgui) target_include_directories(OgreOverlay PUBLIC "$" $ PRIVATE ${FREETYPE_INCLUDE_DIRS}) -if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) +if(0) target_include_directories(OgreOverlay PUBLIC PUBLIC "$" PRIVATE "$")