summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/vendor/stb_image_include.cpp5
-rw-r--r--src/vendor/stb_image_include.hpp7
3 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a1851a..370b3eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,8 @@ set(PKE_SOURCE_FILES
src/asset-manager.hpp
src/asset-manager.cpp
src/vendor/glm_include.hpp
+ src/vendor/stb_image_include.hpp
+ src/vendor/stb_image_include.cpp
src/window.hpp
src/window.cpp
)
@@ -113,6 +115,10 @@ if (glm_FOUND)
target_include_directories(pke PUBLIC ${glm_INCLUDE_DIR})
endif (glm_FOUND)
+FetchContent_Declare(stb URL https://github.com/nothings/stb/archive/5736b15f7ea0ffb08dd38af21067c314d6a3aae9.zip)
+FetchContent_MakeAvailable(stb)
+target_include_directories(pke PUBLIC "${PROJECT_BINARY_DIR}/_deps/stb-src")
+
target_include_directories(pke PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_link_libraries(pke PUBLIC imguidocked)
diff --git a/src/vendor/stb_image_include.cpp b/src/vendor/stb_image_include.cpp
new file mode 100644
index 0000000..10a18b4
--- /dev/null
+++ b/src/vendor/stb_image_include.cpp
@@ -0,0 +1,5 @@
+
+#define STB_IMAGE_IMPLEMENTATION
+#define STB_IMAGE_WRITE_IMPLEMENTATION
+
+#include "stb_image_include.hpp"
diff --git a/src/vendor/stb_image_include.hpp b/src/vendor/stb_image_include.hpp
new file mode 100644
index 0000000..cfea99a
--- /dev/null
+++ b/src/vendor/stb_image_include.hpp
@@ -0,0 +1,7 @@
+#ifndef PKE_VENDOR_STB_IMAGE_INCLUDE_HPP
+#define PKE_VENDOR_STB_IMAGE_INCLUDE_HPP
+
+#include "stb_image.h"
+#include "stb_image_write.h"
+
+#endif /* PKE_VENDOR_STB_IMAGE_INCLUDE_HPP */