Это видео недоступно.
Сожалеем об этом.

Creating CMake Libraries - That others can find and use.

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • In this video we're going to create a CMake library, and then configure that library so that we can generate everything needed for it to be properly built, installed and distributed. We'll go over installing files with cmake, generating the required cmake files so users can install and find it on their system, and finally build and link against it!
    github.com/con...
    00:00 - Introduction
    01:25 - The build configuration
    02:48 - Setting up include directories
    04:36 - Creating the EXPORT target
    05:40 - Installing the EXPORT target
    07:35 - Installing the public header
    09:06 - Making it findable!
    10:02 - Find vs Config Scripts
    11:36 - Creating the Config File
    14:17 - Installing and Testing the Library
    19:01 - Calling into our Library
    19:41 - Finding and Linking
    23:23 - Using the library
    24:16 - Debug vs Release Mismatch

Комментарии • 7

  •  Месяц назад +2

    This is god sent stuff.

  • @hansdorfer3371
    @hansdorfer3371 27 дней назад +1

    Nice Video, you are accually the first guy on youtube who explained it. But I have a question: 20:40 - When I use this command, it says that the source directory does not appear to contain CMakeLists.txt - And indeed, there is no file like this in the whole file tree after using cmake --install. What should I do? I have to use Qt so its a bit different I quess

    • @constref1983
      @constref1983  25 дней назад +1

      Hey, there should be no CMakeLists.txt in the tree AFTER doing a --install. You are installing the library and the CMakeLists.txt file is the instructions on how to build/install. After installing, you would have the other scripts that I outline in the video which other projects would use to find all your headers and libs. What I'm showing at 20:40 is how one would pass the CMAKE_PREFIX_PATH variable to CMake if they weren't using Visual Studio/IDE and wanted to actually find and link with our library. This part of the video was a test project showing that we had set things up correctly and can actually find and link with our library. If you have gotten to that part, was able to build and install your library, and the files in installed directory match what I showed earlier in the video, congratulations, you did things correctly :)

  • @edwardzdankiewicz9068
    @edwardzdankiewicz9068 29 дней назад

    What happens to all that on Windows? Is there a Windows equivalent to the linux usr/lib system?

    • @constref1983
      @constref1983  28 дней назад

      The entire video is based in Windows. What are you having trouble with? There is no standard usr/lib equivalent, check the video again, I go over how to install a package and how to then find it on Windows.

  • @user-fj9hf4bu9f
    @user-fj9hf4bu9f 14 дней назад

    Why even make a video when there's no github link to example project?

    • @constref1983
      @constref1983  13 дней назад +1

      Here you go: github.com/constref/cmake-examples/tree/master/cmake-library