Skip to content

Commit 8d5808e

Browse files
committed
CMake presets for easy dev setups
Presets can be only used if you are using cmake 3.20 (cherry picked from commit 5f5b813)
1 parent 7b13937 commit 8d5808e

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

CMakePresets.json

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"version": 2,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 20,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "ninja-gl-glfw3-debug",
11+
"description": "Forge build with OpenGL backend using GLFW in Debug configuration",
12+
"binaryDir": "${sourceDir}/build/${presetName}",
13+
"generator": "Ninja",
14+
"cacheVariables": {
15+
"CMAKE_BUILD_TYPE": {
16+
"type": "String",
17+
"value": "Debug"
18+
},
19+
"FG_RENDERING_BACKEND": {
20+
"type": "String",
21+
"value": "OpenGL"
22+
},
23+
"FG_USE_WINDOW_TOOLKIT": {
24+
"type": "String",
25+
"value": "glfw3"
26+
},
27+
"FG_BUILD_DOCS": {
28+
"type": "BOOL",
29+
"value": "OFF"
30+
},
31+
"FG_BUILD_EXAMPLES": {
32+
"type": "BOOL",
33+
"value": "ON"
34+
},
35+
"FG_WITH_FREEIMAGE": {
36+
"type": "BOOL",
37+
"value": "ON"
38+
},
39+
"CMAKE_INSTALL_PREFIX": {
40+
"type": "PATH",
41+
"value": "${sourceDir}/build/${presetName}/pkg"
42+
}
43+
}
44+
},
45+
{
46+
"name": "ninja-gl-glfw3-relwithdebinfo",
47+
"description": "Build Forge using OpenGL backend and GLFW in RelWithDebInfo Configuration",
48+
"inherits": "ninja-gl-glfw3-debug",
49+
"cacheVariables": {
50+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
51+
}
52+
},
53+
{
54+
"name": "ninja-gl-sdl2-debug",
55+
"description": "Build Forge using OpenGL backend and SDL2 in Debug Configuration",
56+
"inherits": "ninja-gl-glfw3-debug",
57+
"cacheVariables": {
58+
"FG_USE_WINDOW_TOOLKIT": "sdl2"
59+
}
60+
},
61+
{
62+
"name": "ninja-gl-sdl2-relwithdebinfo",
63+
"description": "Build Forge using OpenGL backend and SDL2 in RelWithDebInfo Configuration",
64+
"inherits": "ninja-gl-sdl2-debug",
65+
"cacheVariables": {
66+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
67+
}
68+
},
69+
{
70+
"name": "ninja-docs",
71+
"description": "Build Forge Documentation, needs doxygen installed",
72+
"inherits": "ninja-gl-glfw3-debug",
73+
"cacheVariables": {
74+
"FG_BUILD_EXAMPLES": "OFF",
75+
"FG_BUILD_DOCS": "ON"
76+
}
77+
},
78+
{
79+
"name": "msvc2019-gl-glfw3",
80+
"description": "Forge build with OpenGL backend using GLFW",
81+
"binaryDir": "${sourceDir}/build/${presetName}",
82+
"generator": "Visual Studio 16 2019",
83+
"architecture": "x64",
84+
"cacheVariables": {
85+
"FG_RENDERING_BACKEND": {
86+
"type": "String",
87+
"value": "OpenGL"
88+
},
89+
"FG_USE_WINDOW_TOOLKIT": {
90+
"type": "String",
91+
"value": "glfw3"
92+
},
93+
"FG_BUILD_DOCS": {
94+
"type": "BOOL",
95+
"value": "OFF"
96+
},
97+
"FG_BUILD_EXAMPLES": {
98+
"type": "BOOL",
99+
"value": "ON"
100+
},
101+
"FG_WITH_FREEIMAGE": {
102+
"type": "BOOL",
103+
"value": "ON"
104+
},
105+
"CMAKE_INSTALL_PREFIX": {
106+
"type": "PATH",
107+
"value": "${sourceDir}/build/${presetName}/pkg"
108+
}
109+
}
110+
},
111+
{
112+
"name": "msvc2019-gl-sdl2",
113+
"description": "Forge build with OpenGL backend using SDL",
114+
"inherits": "msvc2019-gl-glfw3",
115+
"cacheVariables": {
116+
"FG_USE_WINDOW_TOOLKIT": "sdl2"
117+
}
118+
}
119+
]
120+
}

0 commit comments

Comments
 (0)