set(apps
  openslide-quickhash1sum
  openslide-show-properties
  openslide-write-png
  )

include_directories(${GTK2_GLIB_INCLUDE_DIR})
include_directories(${GTK2_CAIRO_INCLUDE_DIR})
include_directories(${GTK2_GLIBCONFIG_INCLUDE_DIR})

find_package(PNG REQUIRED)

foreach(app ${apps})
add_executable(${app} ${app}.c openslide-tools-common.c)
target_link_libraries(${app} openslide)
if(${app} STREQUAL "openslide-write-png")
target_link_libraries(${app} ${PNG_LIBRARIES})
endif()
endforeach()

set(apps
  openslide-quickhash1sum
  openslide-show-properties
  openslide-write-png
  )

include_directories(${GTK2_GLIB_INCLUDE_DIR})
include_directories(${GTK2_CAIRO_INCLUDE_DIR})
include_directories(${GTK2_GLIBCONFIG_INCLUDE_DIR})

find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIRS})

foreach(app ${apps})
add_executable(${app} ${app}.c openslide-tools-common.c)
target_link_libraries(${app} openslide)
if(${app} STREQUAL "openslide-write-png")
target_link_libraries(${app} ${PNG_LIBRARIES})
endif()
endforeach()

Fix CMake processing of libpng include directory
Fix CMake processing of libpng include directory

Patch by @gatagat:

    CMakeLists.txt in tools directory does not add the include directories
    for PNG, which results in compilation error in case png.h is not
    already on path.

Closes: 93.
