Creating CMake Libraries - That others can find and use.

  Рет қаралды 484

constref

constref

Күн бұрын

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/constref/cmake-exa...
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
Ай бұрын
This is god sent stuff.
@hansdorfer3371
@hansdorfer3371 16 күн бұрын
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 14 күн бұрын
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 18 күн бұрын
What happens to all that on Windows? Is there a Windows equivalent to the linux usr/lib system?
@constref1983
@constref1983 17 күн бұрын
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 3 күн бұрын
Why even make a video when there's no github link to example project?
@constref1983
@constref1983 2 күн бұрын
Here you go: github.com/constref/cmake-examples/tree/master/cmake-library
Debugging C/C++ with LLDB Tutorial
40:06
constref
Рет қаралды 24 М.
Introduction to CMake Crash Course
14:08
PunchedTape
Рет қаралды 13 М.
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
Mini Katana
Рет қаралды 30 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,8 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 1,6 МЛН
The Clever Way to Count Tanks - Numberphile
16:45
Numberphile
Рет қаралды 760 М.
Stop, Intel’s Already Dead!
13:47
Linus Tech Tips
Рет қаралды 163 М.
20 years of Linux experience in 10 minutes
10:07
MakeITsexyAgain
Рет қаралды 154
What is the Smallest Possible .EXE?
17:57
Inkbox
Рет қаралды 340 М.
The Greenwich Meridian is in the wrong place
25:07
Stand-up Maths
Рет қаралды 483 М.
WHY did this C++ code FAIL?
38:10
The Cherno
Рет қаралды 242 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 129 М.
98% Cloud Cost Saved By Writing Our Own Database
21:45
ThePrimeTime
Рет қаралды 341 М.
The Art of Code - Dylan Beattie
1:00:49
NDC Conferences
Рет қаралды 4,7 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 117 М.
Это - iPhone 16!
16:29
Rozetked
Рет қаралды 440 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 7 МЛН
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,9 МЛН
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 2,3 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 553 М.