Skip to content

Commit c6a76f4

Browse files
committed
Use vcpkg for most dependencies
glad still doesn't use vcpkg, alongside rapidobj which for some reason the port is windows only
1 parent 463575e commit c6a76f4

File tree

10 files changed

+29
-32
lines changed

10 files changed

+29
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
build
22
release/resources
33
.cache
4+
vcpkg_installed
45

56
release/*
67
!release/shaders

.gitmodules

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
[submodule "thirdparty/rapidobj"]
22
path = thirdparty/rapidobj
33
url = https://github.com/guybrush77/rapidobj
4-
[submodule "thirdparty/stb"]
5-
path = thirdparty/stb
6-
url = https://github.com/nothings/stb
7-
[submodule "thirdparty/entt"]
8-
path = thirdparty/entt
9-
url = https://github.com/skypjack/entt
10-
[submodule "thirdparty/fastgltf"]
11-
path = thirdparty/fastgltf
12-
url = https://github.com/spnda/fastgltf

CMakeLists.txt

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,24 @@ project(qun VERSION 0.1.0 LANGUAGES C CXX)
44
find_package(OpenGL REQUIRED)
55
find_package(glfw3 REQUIRED)
66
find_package(glm REQUIRED)
7+
find_package(Stb REQUIRED)
8+
find_package(EnTT CONFIG REQUIRED)
9+
find_package(fastgltf CONFIG REQUIRED)
710

811
set(CMAKE_CXX_STANDARD 23)
912
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1013
set(CMAKE_CXX_EXTENSIONS OFF)
1114

12-
# Glad
15+
# glad
1316
add_library(glad STATIC ./thirdparty/glad/src/gl.c)
1417
target_include_directories(glad PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
1518
target_include_directories(glad PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glad/include)
1619

17-
# Rapidobj
20+
21+
# rapidobj
1822
add_library(rapidobj INTERFACE)
1923
target_include_directories(rapidobj SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/rapidobj/include)
2024

21-
# stb_image
22-
add_library(stb INTERFACE)
23-
target_include_directories(stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/stb)
24-
25-
# entt
26-
add_library(entt INTERFACE)
27-
target_include_directories(entt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/entt/single_include)
28-
29-
# fastgltf
30-
add_subdirectory(thirdparty/fastgltf)
31-
3225
# qun
3326
add_executable(qun
3427
./src/main.cpp
@@ -73,16 +66,15 @@ add_executable(qun
7366
target_include_directories(qun
7467
PRIVATE
7568
./thirdparty
76-
./thirdparty/fastgltf/include
7769
./thirdparty/glad/include
7870
./src
7971
)
8072

8173
target_link_libraries(qun
8274
glad
8375
rapidobj
84-
entt
85-
fastgltf
76+
EnTT::EnTT
77+
fastgltf::fastgltf
8678
glfw
8779
OpenGL::GL
8880
glm::glm

CMakePresets.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"binaryDir": "${sourceDir}/release",
88
"cacheVariables": {
99
"CMAKE_BUILD_TYPE": "Release",
10-
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES"
10+
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
11+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
1112
}
1213
},
1314
{
@@ -16,7 +17,8 @@
1617
"binaryDir": "${sourceDir}/release",
1718
"cacheVariables": {
1819
"CMAKE_BUILD_TYPE": "Debug",
19-
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES"
20+
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
21+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
2022
},
2123
"environment": {
2224
"CFLAGS": "-DDEBUG=1,-DSHADER_HOTRELOADING=1",

src/asset/img/img.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "render/texture.hpp"
33

44
#define STB_IMAGE_IMPLEMENTATION
5-
#include <stb/stb_image.h>
5+
#include <stb_image.h>
66

77
#define STBI_FORCE_RGBA 4
88

src/asset/img/img.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string>
55
#include <filesystem>
66

7-
#include <stb/stb_image.h>
7+
#include <stb_image.h>
88

99
#include "asset/asset.hpp"
1010

thirdparty/entt

Lines changed: 0 additions & 1 deletion
This file was deleted.

thirdparty/fastgltf

Lines changed: 0 additions & 1 deletion
This file was deleted.

thirdparty/stb

Lines changed: 0 additions & 1 deletion
This file was deleted.

vcpkg.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
3+
"name": "qun",
4+
"version": "0.1.0",
5+
"description": "A graphics application using modern OpenGL",
6+
"dependencies": [
7+
"opengl",
8+
"glfw3",
9+
"glm",
10+
"stb",
11+
"entt",
12+
"fastgltf"
13+
]
14+
}

0 commit comments

Comments
 (0)