2020-10-20 21:40:02 -07:00
|
|
|
if(NOT WIN32 AND NOT APPLE AND NOT NX) # remove WIN32 when specter/freetype is gone
|
2020-06-13 14:18:57 -07:00
|
|
|
find_library(PNG_LIB NAMES png libpng)
|
|
|
|
endif()
|
|
|
|
if(NOT PNG_LIB)
|
2015-11-10 20:01:36 -08:00
|
|
|
message(STATUS "Using HECL's built-in libpng")
|
2021-01-06 17:46:56 -08:00
|
|
|
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm(64)?")
|
2020-10-20 21:40:02 -07:00
|
|
|
set(INTRINSICS
|
|
|
|
arm/arm_init.c
|
|
|
|
arm/filter_neon.S
|
|
|
|
arm/filter_neon_intrinsics.c
|
|
|
|
arm/palette_neon_intrinsics.c)
|
2021-01-06 17:46:56 -08:00
|
|
|
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL x86_64)
|
2020-10-20 21:40:02 -07:00
|
|
|
set(INTRINSICS
|
|
|
|
intel/filter_sse2_intrinsics.c
|
|
|
|
intel/intel_init.c)
|
|
|
|
endif()
|
2015-07-06 20:24:09 -07:00
|
|
|
add_library(png
|
|
|
|
png.h
|
|
|
|
pngconf.h
|
|
|
|
pngdebug.h
|
|
|
|
pnginfo.h
|
|
|
|
pngpriv.h
|
|
|
|
pngstruct.h
|
|
|
|
pnglibconf.h
|
2020-10-20 21:40:02 -07:00
|
|
|
|
2015-07-06 20:24:09 -07:00
|
|
|
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
|
2020-10-20 21:40:02 -07:00
|
|
|
pngwutil.c
|
|
|
|
${INTRINSICS})
|
2021-01-06 17:46:56 -08:00
|
|
|
if(APPLE)
|
|
|
|
target_compile_options(png PRIVATE -Wno-implicit-fallthrough)
|
|
|
|
endif()
|
2020-06-13 14:18:57 -07: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-27 18:38:07 -07:00
|
|
|
set(PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "PNG include path" FORCE)
|
2015-11-22 15:50:11 -08:00
|
|
|
else()
|
2020-06-13 14:18:57 -07:00
|
|
|
set(PNG_LIBRARIES ${PNG_LIB} CACHE PATH "PNG libraries" FORCE)
|
2020-05-27 18:38:07 -07:00
|
|
|
find_path(PNG_INCLUDE_DIR png.h)
|
2020-06-13 20:45:38 -07:00
|
|
|
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE PATH "PNG include path" FORCE)
|
2020-06-25 18:22:59 -07:00
|
|
|
endif()
|