metaforce/hecl/extern/libpng/CMakeLists.txt

39 lines
953 B
CMake
Raw Normal View History

2020-06-26 01:27:31 +00:00
if(NOT WIN32 AND NOT APPLE) # remove WIN32 when specter/freetype is gone
2020-06-13 21:18:57 +00:00
find_library(PNG_LIB NAMES png libpng)
endif()
if(NOT PNG_LIB)
2015-11-11 04:01:36 +00:00
message(STATUS "Using HECL's built-in libpng")
2015-07-07 03:24:09 +00:00
add_library(png
png.h
pngconf.h
pngdebug.h
pnginfo.h
pngpriv.h
pngstruct.h
pnglibconf.h
png.c
pngerror.c
pngget.c
pngmem.c
pngpread.c
pngread.c
pngrio.c
pngrtran.c
pngrutil.c
pngset.c
pngtrans.c
pngwio.c
pngwrite.c
pngwtran.c
2015-07-28 02:25:33 +00:00
pngwutil.c)
2020-06-13 21:18:57 +00:00
target_link_libraries(png PUBLIC ${ZLIB_LIBRARIES})
target_include_directories(png PUBLIC ${ZLIB_INCLUDE_DIR})
set(PNG_LIBRARIES png CACHE PATH "PNG libraries" FORCE)
2020-05-28 01:38:07 +00:00
set(PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "PNG include path" FORCE)
2015-11-22 23:50:11 +00:00
else()
2020-06-13 21:18:57 +00:00
set(PNG_LIBRARIES ${PNG_LIB} CACHE PATH "PNG libraries" FORCE)
2020-05-28 01:38:07 +00:00
find_path(PNG_INCLUDE_DIR png.h)
2020-06-14 03:45:38 +00:00
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE PATH "PNG include path" FORCE)
2020-06-26 01:22:59 +00:00
endif()