Skip to content

Commit

Permalink
Added libpng as submodule (close #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 27, 2022
1 parent 471cb0a commit b435acf
Show file tree
Hide file tree
Showing 248 changed files with 33 additions and 112,803 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "ThirdParty/zlib"]
path = ThirdParty/zlib
url = https://github.com/DiligentGraphics/zlib
[submodule "ThirdParty/libpng"]
path = ThirdParty/libpng
url = https://github.com/DiligentGraphics/libpng
8 changes: 7 additions & 1 deletion Tests/DiligentToolsTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ if (NOT ARCHIVER_SUPPORTED)
list(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/RenderStatePackager/RenderStatePackagerTest.cpp)
endif()

set_property(SOURCE src/PNGCodecTest.cpp
APPEND PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/../../ThirdParty/libpng" # png_static target does not define any public include directories
"${CMAKE_CURRENT_BINARY_DIR}/../../ThirdParty/libpng" # pnglibconf.h is generated in the binary directory
)

set_source_files_properties(${ASSETS} PROPERTIES VS_TOOL_OVERRIDE "None")

add_executable(DiligentToolsTest ${SOURCE} ${MAIN_CPP} ${INCLUDE} ${ASSETS})
Expand All @@ -25,7 +31,7 @@ PRIVATE
Diligent-GraphicsEngine
Diligent-RenderStateNotation
Diligent-TestFramework
LibPng
PNG::PNG
Diligent-JSON
)

Expand Down
6 changes: 6 additions & 0 deletions TextureLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ set(SOURCE
add_library(Diligent-TextureLoader STATIC ${SOURCE} ${INCLUDE} ${INTERFACE})
set_common_target_properties(Diligent-TextureLoader)

set_property(SOURCE src/PNGCodec.c src/Image.cpp
APPEND PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/libpng" # png_static target does not define any public include directories
"${CMAKE_CURRENT_BINARY_DIR}/../ThirdParty/libpng" # pnglibconf.h is generated in the binary directory
)

target_include_directories(Diligent-TextureLoader
PUBLIC
interface
Expand Down
15 changes: 12 additions & 3 deletions ThirdParty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ if (NOT TARGET ZLIB::ZLIB)
endif()

if (NOT TARGET PNG::PNG)
add_subdirectory(lpng-1.6.17)
install(FILES lpng-1.6.17/LICENSE DESTINATION ${LICENSE_INSTALL_PATH} RENAME lpng-license.txt)
list(APPEND THIRD_PARTY_TARGETS LibPng)
set(PNG_BUILD_ZLIB ON CACHE BOOL "Use find_package(zlib) to find ZLib location")
set(PNG_SHARED OFF CACHE BOOL "Build shared version of libpng")
set(PNG_EXECUTABLES OFF CACHE BOOL "Build libpng executables")
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests")
set(SKIP_INSTALL_ALL ON)
add_subdirectory(libpng)
set_target_properties(png_static genfiles PROPERTIES
FOLDER DiligentTools/ThirdParty/png
)
install(FILES libpng/LICENSE DESTINATION ${LICENSE_INSTALL_PATH} RENAME lpng-license.txt)
add_library(PNG::PNG ALIAS png_static)
list(APPEND THIRD_PARTY_TARGETS png_static)
endif()


Expand Down
1 change: 1 addition & 0 deletions ThirdParty/libpng
Submodule libpng added at 07b880
72 changes: 0 additions & 72 deletions ThirdParty/lpng-1.6.17/ANNOUNCE

This file was deleted.

Loading

0 comments on commit b435acf

Please sign in to comment.