set(H_LIST
	Draw.h
	FontInt.h
	Display.h
	Image.h
	Raster.h
	ImageOp.h
	iml.h
	iml_header.h
	iml_source.h
	DrawImg.iml
	Cham.h
	gobj.dli
	gdk.dli
	gpixbuf.dli
	gtk.dli
	gnome.dli
	Copying
)

set(SRC_LIST
	DrawLock.cpp
	Font.cpp
	FontCR.cpp
	FontWin32.cpp
	FontFc.cpp
	Draw.cpp
	DrawText.cpp
	DrawData.cpp
	Drawing.cpp
	ImageAnyDraw.cpp
	DrawUtil.cpp
	DrawTextUtil.cpp
	Display.cpp
	Image.cpp
	ImageBlit.cpp
	RasterFormat.cpp
	RasterWrite.cpp
	Palette.cpp
	Raster.cpp
	RasterEncoder.cpp
	ImageOp.cpp
	ImageChOp.cpp
	ImageScale.cpp
	MakeCache.cpp
	DrawRasterData.cpp
	Cham.cpp
	SSettings.cpp
)

set_source_files_properties(${H_LIST} PROPERTIES HEADER_FILE_ONLY ON)
set_source_files_properties(init PROPERTIES LANGUAGE CXX LINKER_LANGUAGE CXX)

add_library(Draw init ${SRC_LIST} ${H_LIST})

set(USES_LIST Core)

#library(WIN32 !MSC8ARM) "user32 gdi32";
if(WIN32)
	set(LINK_LIST user32 gdi32)
endif()

#library(LINUX) "dl freetype";
#library(LINUX !XLFD) "fontconfig expat";
if(CMAKE_SYSTEM MATCHES Linux) # TODO: !XLFD
	set(LINK_LIST dl freetype fontconfig expat)
endif()

#library(BSD !XLFD) "fontconfig freetype expat";
if(CMAKE_SYSTEM MATCHES BSD)
	set(LINK_LIST fontconfig freetype expat)
endif()

#library(OSX11) "fontconfig freetype expat";
if(APPLE)
	set(LINK_LIST fontconfig freetype expat)
endif()

#library(FREEBSD) xcb;
if(CMAKE_SYSTEM MATCHES FreeBSD)
	set(LINK_LIST xcb)
endif()

add_dependencies(Draw ${USES_LIST})
target_link_libraries(Draw ${USES_LIST} ${LINK_LIST})
