Skip to content

Commit

Permalink
deps(PNG): if building PNG, guard against refinding system PNG
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Lewis <zachcanbereached@gmail.com>
  • Loading branch information
zachlewis committed Sep 25, 2024
1 parent 6f2d3a7 commit 4494a73
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cmake/build_PNG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ build_dependency_with_cmake(PNG

# Set some things up that we'll need for a subsequent find_package to work
set (PNG_ROOT ${PNG_LOCAL_INSTALL_DIR})
set (PNG_DIR ${PNG_LOCAL_INSTALL_DIR})

# Signal to caller that we need to find again at the installed location
set (PNG_REFIND TRUE)
set (PNG_REFIND_VERSION ${PNG_BUILD_VERSION})

# If building PNG >= 1.6.44, refind with PNG's CMake Config
if (${PNG_BUILD_VERSION} VERSION_GREATER_EQUAL 1.6.44)
message (STATUS "PNG ${PNG_BUILD_VERSION} >= 1.6.44, refinding with CMake Config")
if (${PNG_BUILD_VERSION} VERSION_GREATER_EQUAL 1.6.45)
message (STATUS "PNG ${PNG_BUILD_VERSION} >= 1.6.45, refinding with PNG Config")
set(_refind_config REQUIRED CONFIG)
endif ()

set(PNG_REFIND_ARGS ${_refind_config}
HINTS ${PNG_LOCAL_INSTALL_DIR}/lib/libpng
NO_DEFAULT_PATH
HINTS ${PNG_LOCAL_INSTALL_DIR}/include/libpng16
)

if (PNG_BUILD_SHARED_LIBS)
Expand Down

0 comments on commit 4494a73

Please sign in to comment.