From d4e81ca17700ec7e3e3c351b62a03b969ab98a4d Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sun, 3 Apr 2022 20:05:33 +0200 Subject: [PATCH] Fix libpng submodule usage The current usage used the system `png.h` header instead of the intended submodule header. This may break if the system header isn't at `libpng16/png.h`. Fix the include header to get the genreated include files and the `png.h` from the submodule as described in https://github.com/glennrp/libpng/issues/342#issuecomment-864589614 Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/19 --- CMakeLists.txt | 2 ++ main.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7981c1e..c6d4b78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,8 @@ option(WITH_PNG "Compile with libpng support to dump current screen as png" ON) if(WITH_PNG) target_compile_definitions(infinisim PRIVATE WITH_PNG) add_subdirectory(libpng EXCLUDE_FROM_ALL) + target_include_directories(infinisim PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") + target_include_directories(infinisim PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/libpng") target_link_libraries(infinisim PRIVATE png_static) endif() diff --git a/main.cpp b/main.cpp index b090f6c..a0a823a 100644 --- a/main.cpp +++ b/main.cpp @@ -61,7 +61,7 @@ #include #include #if defined(WITH_PNG) -#include +#include #endif /*********************