Simplified CMake Tutorial

  Рет қаралды 119,222

kandodev

kandodev

Күн бұрын

Пікірлер: 117
@honey_sukesan
@honey_sukesan 7 ай бұрын
This is a great, simplified CMake tutorial. Highly recommended for all C++ developers who need to get a flavour of CMake in half an hour.
@Gornius
@Gornius 3 жыл бұрын
Simple, quick, knowledge-packed, easy to understand and to follow tutorial. I went from complete magic to understanding CMakeLists in 30 minutes! Thanks a lot!
@iLeno
@iLeno 2 жыл бұрын
This is the best video on C++ by far, every other people just run into coding, but no one actually takes the time to explain how to compile and automate the compilation of your projects. Very well done.
@gabrielgardin2592
@gabrielgardin2592 3 жыл бұрын
Very loud keyboard. But great video!
@hotmandead1
@hotmandead1 2 жыл бұрын
True mechanical
@polisbaba
@polisbaba 2 жыл бұрын
@@hotmandead1 What is your keyboard?
@hotmandead1
@hotmandead1 2 жыл бұрын
@@polisbaba keychron Q1
@raulcardona.
@raulcardona. 2 жыл бұрын
Amazing video! Love the keyboard ASMR
@peacemode2574
@peacemode2574 3 жыл бұрын
Best tutorial of Cmake for beginners on YT I'm not exaggerating.
@NordinDeveloper
@NordinDeveloper 7 ай бұрын
Perfect tutorial! You cover all the stuff a programmer wants to know in a very short and clear manner.
@ancientstraits9288
@ancientstraits9288 2 жыл бұрын
I still come back to this tutorial whenever I have to setup a new CMake project.
@TheHenkrik
@TheHenkrik 2 жыл бұрын
Really, really good tutorial! Great explanations, easy-to-follow and yet you still manage to add enough detail that one can imagine how to begin to scale this up beyond simple "hello world"-style projects. Thank you.
@lahianmoronta8698
@lahianmoronta8698 2 жыл бұрын
Okay this is actually really helpfull. just added a project name to a txt file that didn't work but now it does, does take a bit before you understand but its actually pretty easy.
@newsgo1876
@newsgo1876 Жыл бұрын
Thank you so much!!! Finally I can understand the CMake rather than call it fxxking-but-cant-get-rid-of magic.
@ankit14245
@ankit14245 3 жыл бұрын
This is the best CMake tutorial and the best part it is in Linux. Waiting for the next parts eagerly. It would be great, if you create content on - creating subdirectories using CMake, git, CDash and CTest.
@Roule_n_Scratche
@Roule_n_Scratche 2 жыл бұрын
Thanks for putting chapters, its very useful
@Franfran722
@Franfran722 Жыл бұрын
Thé only cmake tutorial that really helped me
@sonyerric2
@sonyerric2 2 жыл бұрын
what is the command that clears up the clutter at 4:11 ?
@StannyObelisk
@StannyObelisk 3 жыл бұрын
This is scrumptious. Thank you :)
@Kay-bm3xs
@Kay-bm3xs 3 жыл бұрын
I think it's a great video but I can't follow your commands at all if I'm new to all this stuff.
@xxbomelxx874
@xxbomelxx874 2 жыл бұрын
WTF, why is this better that than the original c++ tutorial?? 😅
@mrqwakgames
@mrqwakgames Жыл бұрын
Where's the donate button to get this guy a quiet keyboard?! ;)
@mrqwakgames
@mrqwakgames Жыл бұрын
(great tutorial btw)
@why1978
@why1978 2 жыл бұрын
Excellent tutorial , keep those keys clicking
@ihebmzoughi4841
@ihebmzoughi4841 2 жыл бұрын
the best
@ihabhatim5825
@ihabhatim5825 2 ай бұрын
cmake . does not generate a makefile in windows, why?
@tunacici
@tunacici 2 жыл бұрын
Thanks for amazing video. Helped a lot
@ItsNotAllRainbows_and_Unicorns
@ItsNotAllRainbows_and_Unicorns 2 жыл бұрын
Hmm, I am using ubuntu and the part @4:27 with cmake ../ did not work for me.
@helium73
@helium73 5 ай бұрын
I'm able to make Makefiles that work but not with cmake. When I tried using cmake it generated a huge ugly makefile that didn't work.
@zitronenfresser7089
@zitronenfresser7089 2 жыл бұрын
Unfortunately your vim plugin does not work and i have no idea why
@07ucs051
@07ucs051 3 жыл бұрын
I am stuck with this error when I try to use find_package() for SFML. By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SFML", but CMake did not find one. Could not find a package configuration file provided by "SFML" (requested version 2) with any of the following names: SFMLConfig.cmake sfml-config.cmake Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set "SFML_DIR" to a directory containing one of the above files. If "SFML" provides a separate development package or SDK, be sure it has been installed. What should I do next? In which files I should make changes? It would be very much helpful if you could help me with this error. I am using Deb(Ubuntu).
@DjSt3rios
@DjSt3rios Жыл бұрын
Great video, thank you so much for sharing your knowledge! You got a new sub 🙂
@andychess
@andychess 2 жыл бұрын
Excellent video thank you very much!
@amitozazad1584
@amitozazad1584 3 жыл бұрын
Great explanation!
@fran12659
@fran12659 2 жыл бұрын
very nice video thanks for sharing. PS: Your keyboard is quite loud for the voice volume.
@Engineer2261
@Engineer2261 Жыл бұрын
I have target_sources in my example cmake file whereas you use add_executable. Which one is recommended?
@lainarte
@lainarte 3 жыл бұрын
coc still gives me an error when I #include "headerfile", but I can make it and the executable works fine. How can I remove the errors from nvim? EDIT: By installing the vim-cmake plugin everything started working.
@sadashivsahoo
@sadashivsahoo 3 жыл бұрын
Hi How to find atlas(automatically tuned linear algebra software) in cmake v3.19
@moeenkamali1288
@moeenkamali1288 8 ай бұрын
please give me model of keyboard you are using :)
@Master-yn6ie
@Master-yn6ie 3 жыл бұрын
Nice, can't wait for the next episode in the series.
@noiseflow4306
@noiseflow4306 Жыл бұрын
fucking amazing my guy
@yashmanwani6232
@yashmanwani6232 3 жыл бұрын
I wish you covered how to make separate debug and release executables with cmake.
@kandodev
@kandodev 3 жыл бұрын
I’m planning an advanced/modern use video for cmake!
@yashmanwani6232
@yashmanwani6232 3 жыл бұрын
@@kandodev thanks
@maxmccord9883
@maxmccord9883 8 ай бұрын
@@kandodev are you still planning an advanced video? 😇 your video was extremely helpful to me and I'd love to see more!
3 жыл бұрын
Thank you for sharing.
@edinetgrunhed6000
@edinetgrunhed6000 Жыл бұрын
how to implement in windows?
@kandodev
@kandodev Жыл бұрын
Best way to just use WSL in windows and follow the unix path.
@edwardzdankiewicz9068
@edwardzdankiewicz9068 10 ай бұрын
The keyboard is too loud speaker too quiet. Hard to hear speaker when he is typing
@mxolisixulu8035
@mxolisixulu8035 2 жыл бұрын
Thst's why he's gettin paid for it
@ManuelGx2
@ManuelGx2 3 жыл бұрын
Scared me at 9:14
@jackier8266
@jackier8266 3 жыл бұрын
Nice tutorial. But the speed of command typing is too fast for new users.
@antonfernando8409
@antonfernando8409 2 жыл бұрын
cool
@godDIEmanLIVE
@godDIEmanLIVE 2 жыл бұрын
Great work man. Really got me started. One tip: don't use custom vim mappings in tutorials. Took me a while to got my bash-script running, because I was a bit confused on where cmake --build should be run and how etc.
@kandodev
@kandodev 3 жыл бұрын
One important thing I missed. Please add a CONFIGURE_DEPENDS flag to the recursive glob so that it looks like: file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS src/*.cpp). This is necessary to make sure CMake regenerates the list of files every time. (Not as efficient but beats listing source files manually!) Note that you should also bump up the min version to 3.12 when this flag was added. Edit: Some dependencies (like the latest SFML version in Ubuntu, Thanks Alex) will use imported targets instead of result variables. In those cases, after find_package, all you have to do is link to the sfml lib: l;ike sfml-graphics
@alexreinking
@alexreinking 3 жыл бұрын
It doesn't beat listing source files manually because manual source file listing is the *only* correct way to do it. See the docs: cmake.org/cmake/help/latest/command/file.html#glob 1. The developers have explicitly stated that it is wrong to do this. That should give you pause. If you encounter an issue, the developers will likely not be receptive to fixing it for you, but will rather tell you to list your sources. 2. CONFIGURE_DEPENDS is not guaranteed to work. (See point 1) 3. If globbing fails, you will have a difficult time figuring out what extra source file got added or removed. 4. Globbing, especially recursive globbing, is slow and gets worse the more files you have. This is a real issue on Windows. 5. Globbing is particularly likely to fail when doing git bisects, switching branches, or performing other source control operations that move file timestamps backward. Ignore this at your own peril.
@kandodev
@kandodev 3 жыл бұрын
@@alexreinking In my experience, I've had a lot more issues when listing files manually (imagine listing 1000 source files and trying to figure out if you missed one) than I've ever had from globbing. Even if configure_depends doesn't work, literally cleaning and rebuilding still works every time. What do you mean by globbing failure in 3? Globbing is such a small factor in terms of build time that the slightly slower builds are worth the hassle free build experience. For 5., I suggest not committing build artifacts since they are ephemeral and should be re-built locally.
@alexreinking
@alexreinking 3 жыл бұрын
@@kandodev Cleaning and rebuilding every time is absolutely unreasonable _especially_ when you have "1000 source files"! I shouldn't have to explain the utility of incremental builds. I could see using a glob to _migrate_ an existing project to CMake, but editing one line in a file is not fraught with issues relating to "missing one" source file and having the build fail. Once the build is working, you should still replace the glob with its result. Again, globbing is not fast on Windows and isn't insignificant. It can take several seconds. Globbing can fail in several ways, especially during file-system invasive operations like VCS bisects. It can pick up files you didn't intend.
@kandodev
@kandodev 3 жыл бұрын
Sorry but expecting people to manually maintain an explicit list of hundreds of source files is absolutely insane. And there’s no point in talking about whether something is minimally or reasonably slow without more quantifiable numbers in specific scenarios.
@alexreinking
@alexreinking 3 жыл бұрын
@@kandodev Take it up with the CMake devs, then. That is not ergonomic does not change the fact that it is the ONLY way to list source files efficiently and correctly in all scenarios. At least you should not be teaching people to glob without understanding the reasons it is discouraged by the devs. "CMake is not supposed to be your build system" is (a) not true and (b) doesn't communicate the very real things you trade off when you glob.
@markharrington5826
@markharrington5826 Жыл бұрын
Excellent video thank you Very well presented and by far one of the best Ive seen on cmake That really has been of help to people like myself Would you also credit chatGPT couldn't come up a solution for cmake with GTK3 C which i thought was quite amusing and after some 5 hours trying to find a solution I found the solution myself by A: watching your video and B: viewing other solutions from which I derived a working solution in under half an hour Just shows you and they suggest AI is good I beg to differ thanking you for your time an effort as without people like yourself we wouldn't know the answers
@lifeless9768
@lifeless9768 3 жыл бұрын
Thank you so much!
@rishiniranjan1746
@rishiniranjan1746 3 ай бұрын
Keyboard sound is very irritating
@CannibalWarthog
@CannibalWarthog 2 жыл бұрын
2:37
@itayalmoznino5192
@itayalmoznino5192 3 жыл бұрын
HI! thanks for the video, and the series as a whole. It helped me setup vim as a nice c++ development platform :) I have ran to a problem with the CMakeGenerate and CmakeBuild. I have this small sfml project that im working on. it has only two files, and currently no header files. in the generation phase it says it found the sfml library files, but in the build phase it does not recognize any of them :'>( I would greatly appreciate if you or anyone watching could take a quick look on the screenshots I added and suggest a solution!! :) not for the faint of heart: imgur.com/a/ILCKumw thanks!!
@kandodev
@kandodev 3 жыл бұрын
Hi, yeah sfml was probably a bad example for me to pick here since the modern versions of the library switch from the _INCLUDE_DIRS and _LIBRARIES to imported targets. So you can just do: target_link_libraries( sfml::system sfml::window sfml::graphics) instead of using SFML_LIBRARIES and the _INCLUDE_DIRS. I'm gonna make a video on some of these modern configurations soon.
@itayalmoznino5192
@itayalmoznino5192 3 жыл бұрын
@@kandodev Wow thank you very much man! it worked (instead of sfml::system it is sfml-system etc.) thanks :)
@rhts420
@rhts420 5 ай бұрын
Who finds the keyboard typing annoying ?
@cedricortencio8362
@cedricortencio8362 2 жыл бұрын
I'm convinced that the big investors and analysts are trying to scare us to keep us poor and ignorant to the market.. because its steady
@Autom_te
@Autom_te Жыл бұрын
your keyboard is very loud and annoying
@everett7903
@everett7903 3 жыл бұрын
I concur with what most people are saying, this is definitely a good introduction and directly applicable to a project I'm working on at work.
@Antagon666
@Antagon666 2 жыл бұрын
Jesus, your fingers just fly on the keyboard.
@duvvuindirapriya9052
@duvvuindirapriya9052 10 ай бұрын
You are Demi God to me 😭😭😭. Thankyou for this awesome Content. Will you able to do more content like this for helping people around.
@dr_bodling
@dr_bodling Жыл бұрын
Gosh, your keyboard sounds like a damn typewriter. Very distracting......nice info though.
@nightghost87
@nightghost87 2 жыл бұрын
Good video, only minus your keyboard is louder than your voice..........
@prasobhprakasan5921
@prasobhprakasan5921 3 жыл бұрын
Thank you very much for the knowledge
@chandusai3120
@chandusai3120 Жыл бұрын
No CMAKE_CXX_COMPILER could be found. Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. this error i got how to resolve
@Canoxix
@Canoxix 7 ай бұрын
'build-essentials' package
@bitterlemonboy
@bitterlemonboy 2 жыл бұрын
Uses vi. The most unpractical file editor.
@ratgirlflora
@ratgirlflora Жыл бұрын
28 minutes im going to literally turn into a fish
@xarax7950
@xarax7950 3 ай бұрын
every good tutorial !!!!
@KittyGeorgia-m9x
@KittyGeorgia-m9x 7 күн бұрын
Janae Turnpike
@kirkpennock2997
@kirkpennock2997 Жыл бұрын
One thing, cmake seems to have alot of variables that are not defined but are availible to use, like your example of the SFML, where do you find those ${SFML_LIBRARIES} name and ${SFML_DEPENDENCIES}?
@gurunadhan2666
@gurunadhan2666 2 жыл бұрын
Amazing
@testforcomment
@testforcomment 2 жыл бұрын
good CMake tutorial and it looks you are an i3wm user. but have several off-topic questions. Question0. what is the tool you are using to play the slide? during the whole tutorial Question1. how did you configure your shell to add an underscore to the file name like dot(.) and CMakeList.txt kzbin.info/www/bejne/o3y9Xpxjist6nbM Question2. what is the plugin of vim support offset display in the left gutter? kzbin.info/www/bejne/o3y9Xpxjist6nbM Question3. what is the plugin doing the [Indexing 50% 1/2] at the left bottom corner kzbin.info/www/bejne/o3y9Xpxjist6nbM Question4. what is the plugin for marking the error line based on build command output? kzbin.info/www/bejne/o3y9Xpxjist6nbM
@kandodev
@kandodev 2 жыл бұрын
Hey, 0: marp (I'll have a small video on it soon) 1: Provided automatically by github.com/sorin-ionescu/prezto (might be my p10k theme? I'm actually not sure on that) 3,4,5: all of these done by CoC. I have a tutorial series on this: kzbin.info/www/bejne/jJqrmKx3papssK8& (although I'm working on an updated one with neovim lsp instead)
@LS-cb7lg
@LS-cb7lg 3 жыл бұрын
good tutorial but im confused by your fast typing xD
@simonedeangelis
@simonedeangelis 2 жыл бұрын
Really amazing video! so clear! thank you so much!
@hts2425
@hts2425 2 жыл бұрын
very good explanations, thanks so much
@pooriaheidary6204
@pooriaheidary6204 2 жыл бұрын
By far, The most fluent cmake tutorial on youtube.
@lucasrodrigues9766
@lucasrodrigues9766 2 жыл бұрын
The best tutorial, thanks.
@shrikant_paliwal
@shrikant_paliwal 3 жыл бұрын
Best Video Thanks man !
@Ruddens
@Ruddens 3 жыл бұрын
nice tutorial , i find cmake is not too difficute
@malusmundus-9605
@malusmundus-9605 2 жыл бұрын
I love you. Thank you.
@alexandriati9060
@alexandriati9060 3 жыл бұрын
Very nice tutorial
@miaomiao1415
@miaomiao1415 3 жыл бұрын
only thanks can I say
@liminal6823
@liminal6823 2 жыл бұрын
Excellent tutorial. Thanks.
@canerbaba387
@canerbaba387 2 жыл бұрын
thanks for the tutorial. how is it possible to add header files to the project as well as source files?
@kandodev
@kandodev 2 жыл бұрын
Just target_include_directories to add further include dirs for your target.
@Jedlmind
@Jedlmind 2 жыл бұрын
Thank you!
@michaelmueller9635
@michaelmueller9635 3 жыл бұрын
thx, this is useful
@dynamicgecko1213
@dynamicgecko1213 3 жыл бұрын
Very informative and well-structured video. Your keyboard and breathing sounds are very distracting sometimes though.
@ANOCEANGROUND
@ANOCEANGROUND Жыл бұрын
The flow was spot on. At last I can now feel comfortable with cMake. Sir, you just earned my subscription. I tip my hat to you.
@saurabhpradhan1069
@saurabhpradhan1069 2 жыл бұрын
Love the key board sound. Great content.
@yarin1
@yarin1 3 жыл бұрын
wow!
@herbertwestiron
@herbertwestiron 3 жыл бұрын
Thanks for the tutorial. Helped me alot!
@mala235813
@mala235813 3 жыл бұрын
Thank you! Excellent tutorial.
@JeffreyHernandez-n9t
@JeffreyHernandez-n9t 3 күн бұрын
1368 Joanny Meadow
CMake vs Make - A Real Life Comparison (With Actual Code)
12:16
Kea Sigma Delta
Рет қаралды 3,3 М.
Introduction to CMake Crash Course
14:08
PunchedTape
Рет қаралды 18 М.
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 9 МЛН
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3,1 МЛН
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,4 МЛН
BEST WAY to make Desktop Applications in C++
26:00
The Cherno
Рет қаралды 917 М.
C++ Weekly - Ep 208 - The Ultimate CMake / C++ Quick Start
32:51
C++ Weekly With Jason Turner
Рет қаралды 76 М.
CMake - the essential package
27:54
Code for yourself
Рет қаралды 10 М.
CMake основы
12:46
S0ER
Рет қаралды 49 М.
Основы CMake
13:34
SimpleCoding
Рет қаралды 40 М.
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Two Minute Papers
Рет қаралды 190 М.
CMake vs Make - A developer's perspective
8:16
Kea Sigma Delta
Рет қаралды 6 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 787 М.
How-To Use C++ Libraries (without relying on a package manager)
30:22
Code, Tech, and Tutorials
Рет қаралды 56 М.
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 9 МЛН