message(FATAL_ERROR"This module can only be used if you are using the 3DS toolchain file. Please erase this build directory or create another one, and then use -DCMAKE_TOOLCHAIN_FILE=DevkitArm3DS.cmake when calling cmake for the 1st time. For more information, see the Readme.md for more information.")
endif()
if(PNG_INCLUDE_DIR)
# Already in cache, be silent
set(PNG_FIND_QUIETLYTRUE)
endif(PNG_INCLUDE_DIR)
include(LibFindMacros)
include(try_add_imported_target)
libfind_package(PNGZLIB)
set(_PNG_SEARCHES)
# Search PNG_ROOT first if it is set.
if(PNG_ROOT)
set(_PNG_SEARCH_ROOT
PATHS${PNG_ROOT}
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH)
list(APPEND_PNG_SEARCHES_PNG_SEARCH_ROOT)
endif()
# Search below ${DEVKITPRO}, ${DEVKITARM}, portlibs (if enabled) etc.