Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ set(SOURCES
add_executable(App ${SOURCES})
target_link_libraries(App glfw)
target_link_libraries(App glad)
target_link_libraries(App glm)
1 change: 1 addition & 0 deletions App/Source/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <iostream>
#include <fstream>
#include <vector>

#include <glad/gl.h>

Expand Down
59 changes: 19 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,36 @@ set(CMAKE_CXX_STANDARD 20)
#

# GLFW
find_package(glfw3 3.4 QUIET)
if (NOT glfw3_FOUND)
FetchContent_Declare(
glfw3
DOWNLOAD_EXTRACT_TIMESTAMP OFF
URL https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip
)
FetchContent_GetProperties(glfw3)
if (NOT glfw3_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(glfw3)
add_subdirectory(${glfw3_SOURCE_DIR} ${glfw3_BINARY_DIR})
endif()
endif()
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.4
FIND_PACKAGE_ARGS NAMES glfw3
)
FetchContent_MakeAvailable(glfw)

# OpenGL
find_package(OpenGL REQUIRED)

# GLAD
FetchContent_Declare(
glad
DOWNLOAD_EXTRACT_TIMESTAMP OFF
URL https://github.com/Dav1dde/glad/archive/refs/tags/v2.0.8.zip
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
GIT_TAG v2.0.8
)
FetchContent_MakeAvailable(glad)

FetchContent_GetProperties(glad)
if(NOT glad_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_MakeAvailable(glad)

add_subdirectory("${glad_SOURCE_DIR}/cmake" glad_cmake)
glad_add_library(glad REPRODUCIBLE EXCLUDE_FROM_ALL LOADER API gl:core=4.6)
endif()
set_target_properties(glad PROPERTIES FOLDER "Dependencies")
add_subdirectory("${glad_SOURCE_DIR}/cmake" glad_cmake)
glad_add_library(glad REPRODUCIBLE EXCLUDE_FROM_ALL LOADER API gl:core=4.6)

# GLM
find_package(glm 1.0.1 QUIET)
if (NOT glm_FOUND)
FetchContent_Declare(
glm
DOWNLOAD_EXTRACT_TIMESTAMP OFF
URL https://github.com/g-truc/glm/archive/refs/tags/1.0.1.zip
)
FetchContent_GetProperties(glm)
if (NOT glm_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(glm)
add_subdirectory(${glm_SOURCE_DIR} ${glm_BINARY_DIR})
endif()
endif()
set_target_properties(glm PROPERTIES FOLDER "Dependencies")
FetchContent_Declare(
glm
GIT_REPOSITORY https://github.com/g-truc/glm.git
GIT_TAG 1.0.1
FIND_PACKAGE_ARGS
)
FetchContent_MakeAvailable(glm)

#
# Projects
Expand Down