cmake_minimum_required(VERSION 2.6...3.29)
project(libgldemo)

if(WIN32)
    set(LIBGLDEMO_SOURCES WIN32 wgl.c)
    set(GLDEMO_LINK libvitaboy FileHandler opengl32 glu32)
else()
    set(LIBGLDEMO_SOURCES glx.c)
    set(GLDEMO_LINK libvitaboy FileHandler Xxf86vm rt Xext X11 GL GLU)
    add_definitions(-D_POSIX_C_SOURCE=200112)
endif()

include_directories(${libvitaboy_SOURCE_DIR} ${filehandler_SOURCE_DIR})
add_executable(libgldemo ${LIBGLDEMO_SOURCES} Renderer.cpp)
target_link_libraries(libgldemo ${GLDEMO_LINK})

set_target_properties(libgldemo PROPERTIES FOLDER examples)
