From 0e34868d3c5ffd0bf8e506720ef888f38ada8e39 Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Mon, 25 Jul 2022 21:56:57 +0100
Subject: [PATCH] ensure that imgui isn't in the global folder on install

---
 fggl/debug/debug.cpp                     |  2 +-
 vendor/imgui/CMakeLists.txt              | 16 +++++++++-------
 vendor/imgui/{ => src}/imgui.cpp         |  0
 vendor/imgui/{ => src}/imgui_demo.cpp    | 14 ++++++++++++++
 vendor/imgui/{ => src}/imgui_draw.cpp    | 14 ++++++++++++++
 vendor/imgui/{ => src}/imgui_tables.cpp  | 14 ++++++++++++++
 vendor/imgui/{ => src}/imgui_widgets.cpp | 14 ++++++++++++++
 7 files changed, 66 insertions(+), 8 deletions(-)
 rename vendor/imgui/{ => src}/imgui.cpp (100%)
 rename vendor/imgui/{ => src}/imgui_demo.cpp (99%)
 rename vendor/imgui/{ => src}/imgui_draw.cpp (99%)
 rename vendor/imgui/{ => src}/imgui_tables.cpp (99%)
 rename vendor/imgui/{ => src}/imgui_widgets.cpp (99%)

diff --git a/fggl/debug/debug.cpp b/fggl/debug/debug.cpp
index 629e7fd..c516435 100644
--- a/fggl/debug/debug.cpp
+++ b/fggl/debug/debug.cpp
@@ -14,7 +14,7 @@
 
 #include <fggl/debug/debug.h>
 
-#include <imgui.h>
+#include "imgui.h"
 #include "imgui/include/imgui_impl_glfw.h"
 #include "imgui/include/imgui_impl_opengl3.h"
 
diff --git a/vendor/imgui/CMakeLists.txt b/vendor/imgui/CMakeLists.txt
index 740768f..ce27d61 100644
--- a/vendor/imgui/CMakeLists.txt
+++ b/vendor/imgui/CMakeLists.txt
@@ -1,19 +1,21 @@
+# IMGUI Integrations
 
 set( IMGUI_DIR ${CMAKE_CURRENT_LIST_DIR} )
 set( IMGUI_SOURCES
-  imgui.cpp
-  imgui_demo.cpp
-  imgui_draw.cpp
-  imgui_tables.cpp
-  imgui_widgets.cpp
+  src/imgui.cpp
+  src/imgui_demo.cpp
+  src/imgui_draw.cpp
+  src/imgui_tables.cpp
+  src/imgui_widgets.cpp
 )
 
 add_library(imgui STATIC ${IMGUI_SOURCES} )
 set_property(TARGET imgui PROPERTY POSITION_INDEPENDENT_CODE ON)
+
 target_include_directories( imgui
 	PUBLIC
 		$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
-		$<INSTALL_INTERFACE:include>
+		$<INSTALL_INTERFACE:include/fggl/imgui>
 )
 
 install(
@@ -25,6 +27,6 @@ install(
 			include/imstb_textedit.h
 			include/imstb_truetype.h
 		DESTINATION
-			${CMAKE_INSTALL_INCLUDEDIR}
+			${CMAKE_INSTALL_INCLUDEDIR}/fggl/imgui
 )
 install( TARGETS imgui EXPORT fgglTargets )
\ No newline at end of file
diff --git a/vendor/imgui/imgui.cpp b/vendor/imgui/src/imgui.cpp
similarity index 100%
rename from vendor/imgui/imgui.cpp
rename to vendor/imgui/src/imgui.cpp
diff --git a/vendor/imgui/imgui_demo.cpp b/vendor/imgui/src/imgui_demo.cpp
similarity index 99%
rename from vendor/imgui/imgui_demo.cpp
rename to vendor/imgui/src/imgui_demo.cpp
index 5437301..35e1d7f 100644
--- a/vendor/imgui/imgui_demo.cpp
+++ b/vendor/imgui/src/imgui_demo.cpp
@@ -1,3 +1,17 @@
+/*
+ * This file is part of FGGL.
+ *
+ * FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along with FGGL.
+ * If not, see <https://www.gnu.org/licenses/>.
+ */
+
 // dear imgui, v1.83
 // (demo code)
 
diff --git a/vendor/imgui/imgui_draw.cpp b/vendor/imgui/src/imgui_draw.cpp
similarity index 99%
rename from vendor/imgui/imgui_draw.cpp
rename to vendor/imgui/src/imgui_draw.cpp
index 54490ed..2b9a3ad 100644
--- a/vendor/imgui/imgui_draw.cpp
+++ b/vendor/imgui/src/imgui_draw.cpp
@@ -1,3 +1,17 @@
+/*
+ * This file is part of FGGL.
+ *
+ * FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along with FGGL.
+ * If not, see <https://www.gnu.org/licenses/>.
+ */
+
 // dear imgui, v1.83
 // (drawing and font code)
 
diff --git a/vendor/imgui/imgui_tables.cpp b/vendor/imgui/src/imgui_tables.cpp
similarity index 99%
rename from vendor/imgui/imgui_tables.cpp
rename to vendor/imgui/src/imgui_tables.cpp
index 593e3b0..09085a4 100644
--- a/vendor/imgui/imgui_tables.cpp
+++ b/vendor/imgui/src/imgui_tables.cpp
@@ -1,3 +1,17 @@
+/*
+ * This file is part of FGGL.
+ *
+ * FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along with FGGL.
+ * If not, see <https://www.gnu.org/licenses/>.
+ */
+
 // dear imgui, v1.83
 // (tables and columns code)
 
diff --git a/vendor/imgui/imgui_widgets.cpp b/vendor/imgui/src/imgui_widgets.cpp
similarity index 99%
rename from vendor/imgui/imgui_widgets.cpp
rename to vendor/imgui/src/imgui_widgets.cpp
index 46d2174..09505f4 100644
--- a/vendor/imgui/imgui_widgets.cpp
+++ b/vendor/imgui/src/imgui_widgets.cpp
@@ -1,3 +1,17 @@
+/*
+ * This file is part of FGGL.
+ *
+ * FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
+ * later version.
+ *
+ * FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License along with FGGL.
+ * If not, see <https://www.gnu.org/licenses/>.
+ */
+
 // dear imgui, v1.83
 // (widgets code)
 
-- 
GitLab