CMake, How it Works (At Three Different Levels)

  Рет қаралды 5,595

Kea Sigma Delta

Kea Sigma Delta

20 күн бұрын

Want to learn CMake? Visit: cmaketutorial.com/
You've heard about CMake, and want to know how it works? Great! In this video Hans explains how it works at three different levels: the basics, internally, and in practise.
Click the following link for a summary:
keasigmadelta.com/blog/cmake-...
Other useful resources:
- Learn OpenGL ES 3 + SDL2: keasigmadelta.com/gles3-sdl2-...
- More made by us: keasigmadelta.com/store/
- Support inquiries: keasigmadelta.com/support/
Connect with us:
- / keasigmadelta
- / keasigmadelta
- t.me/keasigmadelta (Telegram)
- keasigmadelta.com/subscribe/
QUESTION - What would you like us to make next, on this channel? Comment below...
About
At Kea Sigma Delta we enjoy creating awesome stuff using software & electronics, and helping others to do the same.

Пікірлер: 35
@KeaSigmaDelta
@KeaSigmaDelta 14 күн бұрын
Blooper alert: I said CLion (and even showed the CLion logo), when I meant to say CLang. CLion is an Integrated Development Environment (IDE), whereas CLang is a compiler toolchain (based on LLVM).
@thepopeofhell3148
@thepopeofhell3148 18 күн бұрын
This channel is severely underrated. Would love a vid where you explained the entire process from a C source file to the final executable including terms like toolchain, Cmake and so on
@KeaSigmaDelta
@KeaSigmaDelta 18 күн бұрын
Thanks. Interesting idea...
@jongeduard
@jongeduard 12 күн бұрын
Small note. I would not speak in terms of "Visual Studio", which is the mostly name of the IDE, but the compiler name is actually specifically Visual C++, even though it can build both C and C++ code. Hence the abbreviation MSVC.
@KeaSigmaDelta
@KeaSigmaDelta 12 күн бұрын
Thanks for the suggestion. Yes, Visual Studio is the name of the whole package, including the IDE, the compilers, etc.. While MSVC may be more precise, "Visual Studio" is more beginner friendly. People are more likely to have heard of "Visual Studio" than "Visual C++" or "MSVC."
@Kitsune001Kei
@Kitsune001Kei 14 күн бұрын
I love this channel, it's very helpful for me. I'm using CMake with CLion and MSVC compiler (best support for a new features, like C++ named modules, I was using clang before)
@KeaSigmaDelta
@KeaSigmaDelta 13 күн бұрын
Great to hear that it's helpful.
@uuu12343
@uuu12343 16 күн бұрын
TIL its technically possible to explain CMake in a reasonably layman-understandable manner...impressive work I can forsee a potential series of videos on other compilers, compiler toolchains and build systems like ninja, yarn etc etc
@KeaSigmaDelta
@KeaSigmaDelta 16 күн бұрын
Thanks.
@human4566vv
@human4566vv 15 күн бұрын
Thanks, have never worked with build systems like c make, but will definitely check.
@KeaSigmaDelta
@KeaSigmaDelta 15 күн бұрын
You're welcome. Glad that the video is helpful.
@spounka
@spounka 13 күн бұрын
I loved the video, very simple and straightforward, no shenanigans of extra info and I like that I would be interested in a similar style video explaining the compilation process from having a source file to an actual binary executable (or library), with all the magic of linkers and preprocessing in between and maybe a video about how compiled binaries are laid in memory? (This stems from me reading about the -fpic flag) Great video, keep up the amazing content!
@KeaSigmaDelta
@KeaSigmaDelta 13 күн бұрын
Thanks. I sort of go through the compilation process in the video about toolchains: kzbin.info/www/bejne/b6faYZyFa9qqi80 AFAIK, the layout of a program in memory is platform dependent (i.e,. different OSes organize things differently).
@eddys5371
@eddys5371 16 күн бұрын
This is very valuable, thank you! Do you have any experience on using SFML? If so could you possibly making a video on setting up a C++ project with SFML. Thank you!
@KeaSigmaDelta
@KeaSigmaDelta 16 күн бұрын
Sorry, I've never used SMFL.
@kirillarionov123456
@kirillarionov123456 12 күн бұрын
Hey, I see you answer questions in comments so I have to ask too. Let’s say there are assets that have to be packaged together with the binary. How would you install them with CMake, and how would you access these assets (relative/absolute paths) from the binary?
@KeaSigmaDelta
@KeaSigmaDelta 11 күн бұрын
I use a custom post-build command that adds a symbolic link to the data directory from the directory containing the compiled executable: # Create a symbolic link to the data directory after the project is built add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SOURCE_DIR}/Data/ $/Data/) You can do a similar thing for installing, except you'd probably want to copy the data files instead of creating a symbolic link.
@kirillarionov123456
@kirillarionov123456 11 күн бұрын
@@KeaSigmaDelta thanks for the answer! Though I’ve met some problems myself with similar method. When you start your binary not from the source directory, but rather from the parent or some other directory (running from terminal for example), the assets are then discovered not from directory of the binary, but rather from directory where you run it in terminal. I’ve solved this by prepending argv[0] to the paths of assets. Maybe, I thought, there is more of an elegant solution.
@KeaSigmaDelta
@KeaSigmaDelta 10 күн бұрын
@@kirillarionov123456 That's because your program is using the Current Working Directory (CWD) instead of checking what the program's actual directory is. Everything is fine when those two are the same, but it fails the moment those are different. You can get the program's actual path from argv[0]. From there you can get the program directory by chopping off the program's filename. After that, you want to convert it to an absolute path (because the CWD can change), and open all data files relative to that. NOTE: argv[0] may point to a symbolic link, in which case you'll want to follow that link to the program's actual directory.
@kirillarionov123456
@kirillarionov123456 9 күн бұрын
@@KeaSigmaDelta ye, this is pretty much how I resolved it, thanks!
@KeaSigmaDelta
@KeaSigmaDelta 8 күн бұрын
@@kirillarionov123456 Great!
@diegoaredes2721
@diegoaredes2721 18 күн бұрын
Nice video.
@KeaSigmaDelta
@KeaSigmaDelta 18 күн бұрын
Thanks.
@krzysztofdymanowski8759
@krzysztofdymanowski8759 15 күн бұрын
What is the difference between cmake and make, and is there any practical difference?
@KeaSigmaDelta
@KeaSigmaDelta 15 күн бұрын
I have a video comparing the two: kzbin.info/www/bejne/lXWylaJ3f8tkbc0 In brief: GNU Make is part of the GCC compiler toolchain, whereas CMake is designed to build software on all platforms, with any C/C++ compiler (e.g., GCC, CLang, Visual Studio, Intel C++).
@alejandroioio6784
@alejandroioio6784 10 күн бұрын
I don't need to see the video to tell that this guy knows.
@KeaSigmaDelta
@KeaSigmaDelta 10 күн бұрын
Hehe. Got that look...
@fakegamer4815
@fakegamer4815 7 күн бұрын
Why don't game studios use it to port their games to Linux?
@KeaSigmaDelta
@KeaSigmaDelta 5 күн бұрын
I can't speak for any game studio. Nevertheless, a few possible reasons: - Most game studios don't write their own graphics engine, but use an existing one (e.g., Unity , Unreal Engine). Realistically, they can only support platforms that their chosen engine supports - Even if the game engine supports Linux, will there be enough gamers using Linux who would buy their game to justify the expense of porting?
@rretro2042
@rretro2042 5 күн бұрын
I hate CMake, but needless to say it is a necessary evil.
@KeaSigmaDelta
@KeaSigmaDelta 5 күн бұрын
I used to hate it too, but it has improved a lot.
Getting Started With C++ on Linux: Setting up GCC, CMake & VS Code
5:20
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
Stupid man 👨😂
00:20
Nadir Show
Рет қаралды 22 МЛН
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
i changed my mind about zig
9:34
Low Level Learning
Рет қаралды 136 М.
Trying Zig Part 1
1:30:00
TheVimeagen
Рет қаралды 54 М.
DIY Programming Language #1: The Shunting Yard Algorithm
37:10
How I re-created the rhythm game osu! from scratch in C++!
5:51
Omer Hasanov
Рет қаралды 16 М.
Corel Linux - The (Word)Perfect Operating System
25:40
Michael MJD
Рет қаралды 89 М.
Let's Create a Compiler (Pt.1)
1:11:03
Pixeled
Рет қаралды 441 М.
i cant stop thinking about this exploit
8:40
Low Level Learning
Рет қаралды 172 М.
Python's 5 Worst Features
19:44
Indently
Рет қаралды 58 М.
Creepy Samsung Alarm cannot be turned off 😱🤣 #shorts
0:14
Adani Family
Рет қаралды 1,3 МЛН
❌УШЛА ЭПОХА!🍏
0:37
Demin's Lounge
Рет қаралды 260 М.
Он Отказался от БЕСПЛАТНОЙ видеокарты
0:40
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,3 МЛН
🤏 САМЫЙ ТОНКИЙ гаджет #Apple! 🍏
0:29
Яблочный Маньяк
Рет қаралды 628 М.