From 4955f728f282e6730193e307a50f8ae174a432c3 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 31 Aug 2023 15:10:19 -0400 Subject: add stb_image --- CMakeLists.txt | 6 ++++++ src/vendor/stb_image_include.cpp | 5 +++++ src/vendor/stb_image_include.hpp | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 src/vendor/stb_image_include.cpp create mode 100644 src/vendor/stb_image_include.hpp 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 */ -- cgit v1.2.3