aboutsummaryrefslogtreecommitdiff
path: root/ports/ogre/fix-findimgui.patch
blob: efd30d061ea7046fc8f4bda151d4c45e9f75cfbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 
   "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
   $<INSTALL_INTERFACE:include/OGRE/Overlay>
   PRIVATE ${FREETYPE_INCLUDE_DIRS})
 
-if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI)
+if(0)
   target_include_directories(OgreOverlay PUBLIC
     PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/imgui>"
     PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/misc/freetype>")