set(platform_LIB_INCLUDES "")
set(platform_INCLUDE_DIRS "")
set(platform_HEADERS "")
set(platform_LIBS "")

if (UNIX)
list(APPEND platform_LIBSs
	GL
)
else()
list(APPEND platform_LIBS
	OpenGL32.lib
)
endif()

list(APPEND graphics_LIB_INCLUDES 
    DrawingContext.cpp
    DrawingManager.cpp
    DrawingSurface.cpp
    Rasterizer.cpp
    opengl/OpenGlInterface.cpp
	${platform_LIB_INCLUDES}
)
    
list(APPEND graphics_HEADERS 
    opengl/OpenGlInterface.h
    ${platform_HEADERS}
    Rasterizer.h
    INativeDrawingSurface.h
    INativeDrawingContext.h)


add_library(graphics SHARED 
    ${graphics_LIB_INCLUDES} 
    ${graphics_HEADERS})
    
target_include_directories(graphics PUBLIC
                          ${platform_INCLUDE_DIRS}
                          "${CMAKE_CURRENT_SOURCE_DIR}"
                          "${CMAKE_CURRENT_SOURCE_DIR}/cairo"
                          "${CMAKE_CURRENT_SOURCE_DIR}/opengl"
                          "${PROJECT_SOURCE_DIR}/src/geometry/"
                          "${PROJECT_SOURCE_DIR}/src/visual_elements/"
                          )
                          
target_link_libraries(graphics PUBLIC visual_elements ${platform_LIBS})

set_property(TARGET graphics PROPERTY FOLDER src)
set_target_properties( graphics PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON ) 