How I use CMake with Visual Studio

  Рет қаралды 4,677

Low Level Game Dev

Low Level Game Dev

Күн бұрын

In this video I will show what I think is a better way of using CMake than what people usually do.
#cpp #cmake #gamedev
Link to the repo and video of my CMake Setup 😻:
• Best C++ projects setu...
github.com/meemknight/cmakeSetup
Join my Discord:
/ discord
My Steam Game Midnight Arrow:
store.steampowered.com/app/23...
Join this channel if you want to support me 😻:
/ @lowlevelgamedev9330
Music:
Evan King - Everything is Okay
/ contextsensitive
contextsensitive.bandcamp.com/
Minecraft soundtrack: C418 - Aria Math

Пікірлер: 62
@darkfllame
@darkfllame 3 ай бұрын
here the little catch: i use zig to build C 🗿🍷
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
yo for real? that sounds so cool let's go 💪
@Lurmog
@Lurmog 3 ай бұрын
zig cc 🗿🍷
@TheoParis
@TheoParis 3 ай бұрын
based
@Broom-fz2gm
@Broom-fz2gm 3 ай бұрын
uhh... now the c++ tutorial series.
@maniumek9907
@maniumek9907 2 ай бұрын
Hey, I wonder why when std::cout is execuded in your code it ends up as segmentation fault when trying to run it
@Le0nard_27
@Le0nard_27 3 ай бұрын
What do you think about vcpkg? I heard quite a lot about it when trying to set up libraries. Great video btw
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
I never used it and I don't really see the point for me since it's easier for me to just place the library there and than I can just modify it. + I use like a lot of my own libraries anyway. But you can give it a try if you want maybe you find it usefull, some people like it 💪
@notmanciv5016
@notmanciv5016 3 ай бұрын
I use vcpkg and it’s so useful
@flipfloppy1
@flipfloppy1 3 ай бұрын
vcpkg can be annoying sometimes. if you’re using cmake anyway there’s not really any point because you can add subdirectories for libs or use fetchcontent which make it easier to get things to build on another machine
@nyyakko
@nyyakko 3 ай бұрын
⁠@@flipfloppy1"cmake can be annoying sometimes" I'd argue its not sometimes but pretty much *all the times*, even more so if you're not only consuming but also producing packages. it was so god damn annoying to deal with that registries bullcrap. nowadays I only use CPM.cmake, so much better, so much simpler (basically FetchContent but fancier).
@caiovinicius5745
@caiovinicius5745 3 ай бұрын
Hi, is there any way you know to disable warnings from third_party libraries? I like to compile with a lot of warnings enabled, but I can't control third_party code. I tried using the SYSTEM specifier to target_link_libraries but it didn't work. It would also be more convenient a solution that fits add_subdirectory(), as it's easier to use to add libraries. The issue is in files from my project that include third_party headers, and in the headers they have warnings. I did not want to surround every include with #pragma push and #pragma pop thought...
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
nope, maybe chat gpt knows, I ignore warnings :)))
@finrodf8442
@finrodf8442 3 ай бұрын
Hi! I watched your tutorial for cmake, but can't set it up with OpenGL. Can you please make a video about that?
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
I could do that but it will take some time probably so untill than, I have a video called easiest opengl configuration and you can just steal the cmake configuration from there and see how it's made, also my cmake setup that I linked in the vid already has opengl so you cal also use that 💪
@EscoGuy
@EscoGuy 3 ай бұрын
With what do you edit your vids? thx
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
davinci resolve
@odb7393
@odb7393 3 ай бұрын
Thank you so much for your inspiring videos. The explanations and reference code are helping many people figure out how to get started. :)
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
thx bro 💪
@silloo2072
@silloo2072 3 ай бұрын
Is Makefile a good alternative?
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
well that works only on linux, so if you can link libraries easily and you only want to use linux probably, but libraries usually come with cmake already, so for make you would need to generate your make from that and link to it, idk if that's hard or not but that will probably determine if it is a good alternative
@silloo2072
@silloo2072 3 ай бұрын
@@lowlevelgamedev9330 I tell to chat gpt to generate my Makefile 😂 and yes It works pretty well and I use flags to debug, like -g -Wall...
@silloo2072
@silloo2072 3 ай бұрын
Why KZfaq keeps deleting my comments 😡😡​@@lowlevelgamedev9330
@MommysGoodPuppy
@MommysGoodPuppy 2 ай бұрын
i be using the cmake extensions in vscode its pretty aight
@lowlevelgamedev9330
@lowlevelgamedev9330 2 ай бұрын
yes it's kinda the same thing so that's an option if you want vs code instead of vs
@joaoaugusto6290
@joaoaugusto6290 Ай бұрын
Do you know how to link external libraries in Cmake with vscode? Im Struggling a lot and it keeps throwing errors...
@nazihboudaakkar8117
@nazihboudaakkar8117 3 ай бұрын
Who.. in the world uses the cmake GUI.. it's like using git gui client :') Also, why do you put your libraries in an 3rd party folder / external and not use git submodules? you get the same benefits but truly gain control over the version you're compiling and all and you don't have to push all that code to your repo, making it super lightweight to download
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
ok so first part of the comment yes 😂😂 for real that's a perfect comparison but people actually use that and from my experience they teach it like that in every university 😭😭 ok for the second part I have alreadt answered here: github.com/meemknight/ourCraft/issues/6 (also lol it's not light weight you still have to download dependences) also idk how I gain an extra benefit I still can put a repo as a third party
@nazihboudaakkar8117
@nazihboudaakkar8117 2 ай бұрын
@@lowlevelgamedev9330 By lightweight i meant for the server hosting the repo lol, at the end of the day you're still limited in github For the dependencies, I use submodules basically to: 1. Keep track of the actual repository's link 2. Being able to easily update any time needed, not having to re-download and move the folder, just git submodule update 3. Pinning the actual submodule to a specific commit, even if i clone it again i'm sure i'll get the same behaviour (assuming the toolchain didn't break something)
@evilwizardtherapist
@evilwizardtherapist 3 ай бұрын
Hey there. 👋🧙🏾‍♂️
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
yo 💪
@tuhkiscgibin6627
@tuhkiscgibin6627 3 ай бұрын
I just do a build.bat with unity builds
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
that's actually a good way of doing it, the only problem is that it's hard to link to libraries :((( so that's why I don't do it like this
@tuhkiscgibin6627
@tuhkiscgibin6627 3 ай бұрын
@lowlevelgamedev9330 Linking libraries sucks until it clicks. I've come into just including the source files to my libraries (I don't use many). You can check out the repo for the Gunslinger framework for an example.
@sjoerdev
@sjoerdev 2 ай бұрын
c++ build systems generally suck
@lowlevelgamedev9330
@lowlevelgamedev9330 2 ай бұрын
yup :((
@user-ro7qo3hl8k
@user-ro7qo3hl8k 3 ай бұрын
Nice video and this is first comment
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
nice, always appreciate when people comment so early 💪
@Qohist
@Qohist 3 ай бұрын
fix: use meson for god sake
@somedudenamedanthony
@somedudenamedanthony 3 ай бұрын
...
@marks_shot
@marks_shot 3 ай бұрын
cmaek
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
cmek
@UAVXP
@UAVXP 3 ай бұрын
CMake? More like CMan Premake is much better, guys, I tell ya
@mostrealtutu
@mostrealtutu 3 ай бұрын
super confusing video, ideal for the tutorial hell people. you youtube people could do better.
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
hm yes I think I could have done better, but maybe you can give some constructive feedback and tell me (in another new comment so youtube notifies me and I can see it) so I can do it better next time
@user-ek2jc1xf3y
@user-ek2jc1xf3y 2 ай бұрын
what's so complicated about downloading the source code of a library and compiling it along with your project?
@okanakyuz
@okanakyuz 3 ай бұрын
Sorry But This is a terrible project management strategy. If you want your sovereign libraries to be isolated, you need to link a specific Tag to the folder with gitsubmodule. OR use a Fetch library like CPM.cmake. In this way, include the relevant specific version in your project during cmake configuration Also, instead of changing libraries, it is better to create and use extensions of the classes.
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
idk why I would do that, I said my points and you just said that I need to do something specific without saying what's the benefit, for a big company it's probably better to do it like you say but for personal projects big or small I find it better to do it my way + there are gamedev companies that do exactly what I do (there is one big one in particular that I know for sure but idk if I can talk about that because of their rules)
@user-ek2jc1xf3y
@user-ek2jc1xf3y 2 ай бұрын
If you don't need full control under the core libraries for your project then yeah. But it's fairly common to have a modified version of a library in your project, so in order to be consistent you just drop them all there. We do that a lot with Lua!
@klewyk
@klewyk 3 ай бұрын
visual studio is shit windows is shit i use arch and nvim
@lowlevelgamedev9330
@lowlevelgamedev9330 3 ай бұрын
visual studio has the best debugger, also I have to use nsight good luck using that there :))
@silloo2072
@silloo2072 3 ай бұрын
I use fedora and Vs code(the blue one) with Makefile
@pewpewxdx12
@pewpewxdx12 3 ай бұрын
I use Arch and VScodium
@Pedro-jj7gp
@Pedro-jj7gp 3 ай бұрын
@@lowlevelgamedev9330 can you make a video on using nsight?
@a_cats
@a_cats 3 ай бұрын
yeah that tracks, arch user must tell everyone they use arch lol
@moderndragon055
@moderndragon055 3 ай бұрын
20 views in 3 mins, bro fell off
@Vo0idsEmbrace
@Vo0idsEmbrace 2 ай бұрын
The best way to use cmake is to not use it at all because it sucks
I Remade Minecraft But It is Optimized!
9:39
Low Level Game Dev
Рет қаралды 99 М.
You will never ask again about pointers after watching this video!
20:48
Low Level Game Dev
Рет қаралды 13 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 5 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 50 МЛН
How Google's Chromium Took Over the Browser World
9:59
Eric Murphy
Рет қаралды 268 М.
There are Random Numbers in Computers!
9:46
Low Level Game Dev
Рет қаралды 6 М.
Why Don't You Make Your OWN Game Engine?
7:23
Skeffles
Рет қаралды 10 М.
Why Are Open Source Alternatives So Bad?
13:06
Eric Murphy
Рет қаралды 591 М.
Explaining Pointers Until I Go Insane
6:42
Mults
Рет қаралды 244 М.
How to make Minecraft in C++ or any other language
9:28
Low Level Game Dev
Рет қаралды 41 М.
How to: Modern CMAKE
28:06
Practical Software
Рет қаралды 1,3 М.
You Are WRONG About 0 Based Indexing
25:02
ThePrimeTime
Рет қаралды 263 М.
Making A Perfect Minecraft Clone
14:41
scasz
Рет қаралды 359 М.
CMake основы
12:46
S0ER
Рет қаралды 48 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 5 МЛН