CMAKE_MINIMUM_REQUIRED(VERSION 3.8)

PROJECT(minceraft)

SET(CMAKE_CXX_STANDARD 11)

SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")

SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall")

FIND_PACKAGE(OpenGL REQUIRED)

FIND_PACKAGE(SDL2 REQUIRED)

FIND_PACKAGE(glm REQUIRED)

INCLUDE_DIRECTORIES(

    ${CMAKE_SOURCE_DIR}/lib

    ${CMAKE_SOURCE_DIR}/src

    ${CMAKE_SOURCE_DIR}/src/inc

    ${OPENGL_INCLUDE_DIRS}

    ${SDL2_INCLUDE_DIRS}

    ${GLM_INCLUDE_DIRS}
)

SET(SOURCE_FILES

    ${CMAKE_SOURCE_DIR}/src/main.cpp

    ${CMAKE_SOURCE_DIR}/src/glad/glad.c

    ${CMAKE_SOURCE_DIR}/src/FastNoise/FastNoise.cpp
)

ADD_EXECUTABLE(minceraft ${SOURCE_FILES})

IF (WIN32)

    TARGET_LINK_LIBRARIES(minceraft ${OPENGL_LIBRARIES} ${SDL2_LIBRARIES})

ELSE ()

    TARGET_LINK_LIBRARIES(minceraft ${OPENGL_LIBRARIES} ${SDL2_LIBRARIES} SDL2 OpenGL::GL  dl)

ENDIF (WIN32)
