Thank you for making a good tutorial. Most people make "getting started with CMake" tutorials that just show a bunch of code, but none of the principles behind it. This is excellent. 😁
This was exactly the kind of video I was looking to dive into CMake with. The docs are a lot and this really helps me ask more targeted questions and get easy to understand answers quickly.
Thanks for the amazing video. I really like how calm and structured you explain the thing I bet everyone tripped over. What is your opinion on things like FetchContent or using a package manager like vcpkg for managing external dependencies? Or maybe use git submodules? All of them have positive and negative aspects. Maybe it is a good idea for a video? :)
Thanks, I appreciate it! Package managers are wonderful and I use them all the time for the vast majority of dependencies I bring onto my system. I suppose I brought up the non-standard install stuff because it is the easiest way to get find_package() to fail. If what you need can be found with a package manager, awesome! I've heard great things about vcpkg, so if I was a regular on Windows I'm sure I'd use it as much as Homebrew or whatever Linux distro PM I have available. All of the topics you mention are good ones! The one I want to do first is CMake's ExternalProject to make superbuild projects, as I find superbuilds to be VERY helpful...but FetchContent and submodules will probably come someday too. :)
I also use a custom installation prefix, it's really useful. Exactly the same reasons, it's a lot cleaner not to have everything piled into /usr/local and I can blow it away fearlessly.
Does cmake look for modules only in the source directory? In a stackoverflow post I came across says Fİnd.cmake must be located in project. But I can not see this information in Cmake's find_package documentation. Also you did not explain that way either but files were in the project directory/cmake. Thanks btw, really great video. I have subscribed and will watch all of your other videos.
Hi, nice video, I found it very helpful to understand some concepts, and some lines of cmake. Although I got some questions, if you don't mind. Basically, when I built the project it throws me an error saying it was not able to find my headers, so in the cmake of my project I added an include_libreries with the path to those headers, when I reran the build command again It throws me an error saying that it didn't identify the namespace that are in the hpp files, something like this "error: ‘MyNamespace::secondNamespace’ has not been declared MyNamespace::secondNamespace::Myfunction" and highlights the second Namespace, to be honest I don't know what could be causing this error could you help me to understand? by the way I'm working with ubuntu and the library has several headers and their own cpp file. thank you again for the video
vcpkg package manager mentions to add this in CmakeList.txt set(CMAKE_TOOLCHAIN_FILE "/scripts/buildsystems/vcpkg.cmake") is CMAKE_TOOLCHAIN_FILE an alternative to CMAKE_PREFIX_PATH It does not work though, prefix_path is working for me
Thank you for making a good tutorial.
Most people make "getting started with CMake" tutorials that just show a bunch of code, but none of the principles behind it. This is excellent.
😁
This was exactly the kind of video I was looking to dive into CMake with. The docs are a lot and this really helps me ask more targeted questions and get easy to understand answers quickly.
So exciting to see this video series. Many thanks to UP.
Fantastic explanation! I'm really looking forward to your future videos
Thanks!
You have no idea how much i love you. Thanks!
This has been so helpful
Amazing tutorial series man !!! You’re awesome thanks !!!!!
Thanks for the amazing video. I really like how calm and structured you explain the thing I bet everyone tripped over. What is your opinion on things like FetchContent or using a package manager like vcpkg for managing external dependencies? Or maybe use git submodules? All of them have positive and negative aspects. Maybe it is a good idea for a video? :)
Thanks, I appreciate it!
Package managers are wonderful and I use them all the time for the vast majority of dependencies I bring onto my system. I suppose I brought up the non-standard install stuff because it is the easiest way to get find_package() to fail. If what you need can be found with a package manager, awesome!
I've heard great things about vcpkg, so if I was a regular on Windows I'm sure I'd use it as much as Homebrew or whatever Linux distro PM I have available.
All of the topics you mention are good ones! The one I want to do first is CMake's ExternalProject to make superbuild projects, as I find superbuilds to be VERY helpful...but FetchContent and submodules will probably come someday too. :)
I also use a custom installation prefix, it's really useful. Exactly the same reasons, it's a lot cleaner not to have everything piled into /usr/local and I can blow it away fearlessly.
Does cmake look for modules only in the source directory? In a stackoverflow post I came across says Fİnd.cmake must be located in project. But I can not see this information in Cmake's find_package documentation. Also you did not explain that way either but files were in the project directory/cmake. Thanks btw, really great video. I have subscribed and will watch all of your other videos.
may I know how to install the libraries to /opt like you mentioned? any best practices ?
Hi, nice video, I found it very helpful to understand some concepts, and some lines of cmake. Although I got some questions, if you don't mind. Basically, when I built the project it throws me an error saying it was not able to find my headers, so in the cmake of my project I added an include_libreries with the path to those headers, when I reran the build command again It throws me an error saying that it didn't identify the namespace that are in the hpp files, something like this "error: ‘MyNamespace::secondNamespace’ has not been declared
MyNamespace::secondNamespace::Myfunction" and highlights the second Namespace, to be honest I don't know what could be causing this error could you help me to understand? by the way I'm working with ubuntu and the library has several headers and their own cpp file. thank you again for the video
Great video! How to force bulid order in cmake? I have a problem with dependencies in cmake.
Did you maybe look into "add_dependencies" cmake command? It might be the thing you are looking for
Can you make a video on how you write a FindModule? There's few good sources out there..
Would like to know how to cross-compile with cmake for embedded targets
what if we do not have config.cmake files itself ?
Greate tutorials.i`m confused with find_packages these days,and stackoverflow and other books don`t help.
the guy who´s gives the 100th thump up, you have to find his secret config.make file :D
Thanks
OMG. too complicated. I do not understand the value of find_package()
vcpkg package manager mentions to add this in CmakeList.txt
set(CMAKE_TOOLCHAIN_FILE "/scripts/buildsystems/vcpkg.cmake")
is CMAKE_TOOLCHAIN_FILE an alternative to CMAKE_PREFIX_PATH
It does not work though, prefix_path is working for me