From df628593e05435fc7664b0f33ecffffc582baf34 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Fri, 2 Dec 2016 15:43:08 -0800 Subject: [PATCH] cmake: Use FindPNG instead of find_path/find_library dEQP's use of find_path() and find_library() failed to find the png paths if the paths contained a version suffix. For example, they failed to find /usr/include/libpng12/png.h and /usr/lib64/libpng12.so. CMake ships a standard FindPNG module that does not get confounded by version-suffixed paths. The module also respects cross-compilation environments. Change-Id: I636be9430697a9d883040b53e79767466fbd2ad5 Signed-off-by: Chad Versace --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ecdd52..445cf7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,14 @@ endif () include_directories(${ZLIB_INCLUDE_PATH}) # libpng -find_path(PNG_INCLUDE_PATH png.h) -find_library(PNG_LIBRARY png) +# +# The FindPNG module defines PNG_INCLUDE_DIRS and PNG_LIBRARIES. But dEQP's +# CMake files expect the non-standard PNG_INCLUDE_PATH and PNG_LIBRARY. Set the +# non-standard variables here to retain compatibility with dEQP's existing +# CMake files. +include(FindPNG) +set(PNG_INCLUDE_PATH ${PNG_INCLUDE_DIRS}) +set(PNG_LIBRARY ${PNG_LIBRARIES}) if (NOT PNG_INCLUDE_PATH OR NOT PNG_LIBRARY) message(STATUS "System version of libpng not found, using external/libpng") -- 2.7.4