Better CMake Part 4 -- find_package() Basics

preview_player
Показать описание
Topic time stamps:

0:00 - Intro
0:47 - Motivation
2:20 - find_package() overview
3:35 - VERSION
4:03 - REQUIRED
4:23 - QUIET
5:07 - MODULE and COMPONENTS
6:06 - Imported target names matter!
7:39 - Configs vs. modules
7:54 - Talk through a config example
8:55 - What is a config anyway?
11:08 - Talk through a module example
14:39 - Tell CMake how to find a config
17:52 - Don't panic when find_package() failes
22:13 - Environment organization matters!
22:43 - Wrap up

--------------------

Рекомендации по теме
Комментарии
Автор

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.
😁

xephyr
Автор

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.

alexiswinters
Автор

You have no idea how much i love you. Thanks!

luvon
Автор

So exciting to see this video series. Many thanks to UP.

AbamaCai
Автор

Fantastic explanation! I'm really looking forward to your future videos

jacekwieczorek
Автор

Amazing tutorial series man !!! You’re awesome thanks

oliviercloud
Автор

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.

jeffersoncarpenter
Автор

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? :)

AntonHelm
Автор

may I know how to install the libraries to /opt like you mentioned? any best practices ?

trading_for_living
Автор

Does cmake look for modules only in the source directory? In a stackoverflow post I came across says Fİnd<package_name>.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.

serhankars
Автор

Great video! How to force bulid order in cmake? I have a problem with dependencies in cmake.

Micha-wrpx
Автор

what if we do not have config.cmake files itself ?

kartikpodugu
Автор

Can you make a video on how you write a FindModule? There's few good sources out there..

dagoberttrump
Автор

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: has not been declared
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

Retroiu_
Автор

Would like to know how to cross-compile with cmake for embedded targets

xuxusito
Автор

the guy who´s gives the 100th thump up, you have to find his secret config.make file :D

hedii
Автор

Greate tutorials.i`m confused with find_packages these days, and stackoverflow and other books don`t help.

SoyoCraft
Автор

OMG. too complicated. I do not understand the value of find_package()

stevenbroshar
Автор

vcpkg package manager mentions to add this in CmakeList.txt
set(CMAKE_TOOLCHAIN_FILE

is CMAKE_TOOLCHAIN_FILE an alternative to CMAKE_PREFIX_PATH
It does not work though, prefix_path is working for me

jamesdhanoa