set(MODULE_NAME image)

set(platform_LIB_INCLUDES)

list(APPEND image_HEADERS 
    Image.h
	IImageWriter.h
	PlatformImage.h
	PlatformImageWriter.h
    png/PngWriter.h
	png/BasicPngWriter.h
	png/PngReader.h
    )

list(APPEND image_LIB_INCLUDES 
    Image.cpp
	ImageBitStream.cpp
	PlatformImage.cpp
	png/BasicPngWriter.cpp
    png/PngWriter.cpp
    png/PngReader.cpp
    png/PngHeader.cpp
    png/PngInfo.cpp
    )

if(WIN32)
list(APPEND platform_LIB_INCLUDES 
    win32/Win32WicImage.h
	win32/Win32WicImage.cpp
	win32/Win32WicImageWriter.h
	win32/Win32WicImageWriter.cpp
	win32/Win32WicInterface.h
	win32/Win32WicInterface.cpp
    )
endif()

list(APPEND image_LIBS core compression geometry)
list(APPEND image_DEFINES "")

add_library(image SHARED ${image_LIB_INCLUDES} ${platform_LIB_INCLUDES} ${image_HEADERS})

target_include_directories(${MODULE_NAME} PUBLIC 
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/png
	${CMAKE_CURRENT_SOURCE_DIR}/win32
	)
	
	
set_target_properties( ${MODULE_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON ) 

target_link_libraries( ${MODULE_NAME} PUBLIC ${image_LIBS})

set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER src/media)
