Better CMake Part 4 -- find_package() Basics

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 26

  • @xephyr417
    @xephyr417 2 роки тому +7

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

  • @alexiswinters9364
    @alexiswinters9364 3 роки тому +8

    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.

  • @AbamaCai
    @AbamaCai 3 роки тому +1

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

  • @jacekwieczorek5850
    @jacekwieczorek5850 4 роки тому +4

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

  • @luvon1114
    @luvon1114 4 місяці тому

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

  • @jamesdhanoa7599
    @jamesdhanoa7599 2 роки тому +3

    This has been so helpful

  • @oliviercloud5393
    @oliviercloud5393 11 місяців тому

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

  • @AntonHelm
    @AntonHelm 4 роки тому +7

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

    • @jeffersonamstutz
      @jeffersonamstutz  4 роки тому +3

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

  • @jeffersoncarpenter2
    @jeffersoncarpenter2 Рік тому

    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.

  • @serhankars
    @serhankars Рік тому

    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.

  • @trading_for_living888
    @trading_for_living888 8 місяців тому

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

  • @Retroiu99_01
    @Retroiu99_01 3 місяці тому

    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

  • @Micha-wr1px
    @Micha-wr1px 3 роки тому

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

    • @ivozubovic3848
      @ivozubovic3848 2 роки тому

      Did you maybe look into "add_dependencies" cmake command? It might be the thing you are looking for

  • @dagoberttrump9290
    @dagoberttrump9290 2 роки тому

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

  • @xuxusito
    @xuxusito 3 роки тому

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

  • @kartikpodugu
    @kartikpodugu Рік тому

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

  • @SoyoCraft
    @SoyoCraft 3 роки тому

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

  • @hedii77
    @hedii77 3 роки тому

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

  • @yy84869
    @yy84869 2 роки тому

    Thanks

  • @stevenbroshar7948
    @stevenbroshar7948 5 днів тому

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

  • @jamesdhanoa7599
    @jamesdhanoa7599 2 роки тому +1

    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