Cmake Add Library

Cmake Add Library

1. How to CMake Good - 1b - Adding a Library

Last time we created an executable, but you might also want to make some libraries! I'll show how you can make a library and how you can control what type of library is generated, as well as how we can link that library into an executable.

Addendum: I didn't touch on MODULE libraries much, only briefly mentioning them. In general, they are used to represent "plugins" for other software. It will manifest itself as a shared library but cannot be linked into other libraries. They're not as common to see.

WARNING: This video contains chemicals known to the State of California to cause cancer and birth defects or other reproductive harm.

2. CMake Tutorial EP 2 | Libraries and Subdirectories

this episode has been re-done, new version here:

full CMake playlist:
Find me, support me:
One time donations:
Shop via my Amazon Affiliates Link:
Business inquiries: [email protected]

Thanks for coming to the channel to check out a video on Code, Tech, and Tutorials.

3. CMake Tutorials - 2. Add 3rd party library with find_package

Demonstration of using find_package to include the freetyle library into our initial CMake project.

#cmake #cpp #programming #code #freetype #emacs

4. Static Libraries with CLion and CMake

Learn how to create static C++ libraries in JetBrains CLion with CMake. The tutorial also includes the steps to link to the static library from other applications!

Text version:

If you would like to donate, please consider visiting and becoming a Patron!


5. How to CMake Good - 2e - Source/Binary Directories and add_subdirectory()

It's not big and glamorous, but this topic is essential to understand for a lot of upcoming code that will be dealing with files and paths.

It's been a while, so I'm a bit rusty. You can tell in my voice and inflection. There a bit of screen tearing, which returned after an OS upgrade a few months back. It'll be fixed in the next installment.

I've been busy for a while, but wanted to get another upload before the 2018 holidays.

Looking for help on CMake, C++, or programming in general? Maybe just want a place to hang out and talk to other C++ developers? Join us in the C++ Slack, where you can find me as @vector-of-bool.

I now have a Patreon page! You can support me and help make these videos possible! Visit my page here:

6. CMake Library Tutorial Episode 3 Linking

In this video I show you how to link a project against a custom library.

7. How to CMake Good - 1c - Subdirectories and Target Interface Properties

You probably don't want a single flat project structure, especially if you have many files and targets. You'll also want to tag "usage requirements" to libraries so that only the consumers receive the proper preprocessor definitions/include paths. That's what this video focuses on.

When typing the include path I say ".cpp" instead of ".hpp", which is wrong, of course, but not overly upsetting.

I also tried a slower, more stream-of-consciousness approach to this video. Of course I've removed periods of silence where I think about what to say next, but I think it came out pretty good and flows nicely. Tell me what you think!

This video description guaranteed to contain 5% fewer witty remarks than usual. Made from $100% mental concentration.

8. How-To Use C++ Libraries (without relying on a package manager)

In this video, we talk about C++ Libraries and how to generally use them with your project. Examples are given with Visual Studio Community Edition and GLFW3. Some basic knowledge of programming is assumed.

-- Chapters --
0:00 intro
0:51 finding available C++ libs
1:48 static vs dynamic libs
3:19 C++ package manager options
5:53 starting sample visual studio proj
7:25 x86 unable to start workaround
8:16 cloning + building open source libs
17:46 including the built library
27:04 closed source libs (binary only)
27:30 going forward options
28:30 outro

-- CTT Links --
[email protected] [Business]

-- Other CTT Playlists You Might Like --
▶ CMake:
▶ Beginner Cpp:
▶ Blender Video Editing:
▶ Matrix Math:
▶ OpenAL:
▶ OpenGL:

Thanks for coming to the channel to check out a video on Code, Tech, and Tutorials.

9. CMake and Qt (Part 4) - Using Libraries with CMake

One of CMake's strongest points is making it easy to provide and use libraries, in the same project or in different projects. This video explains the feature in more details and shows a simple example.

Learn more about CMake during the training day at QtDevCon 2021:

Every month our newsletter is featuring technical blogs on CMake, Qt 6 and C++:

All CMake and Qt videos:

About the host:
This video is presented by David Faure, Senior Software Engineer and Trainer at KDAB. David is a CMake user ever since KDE adopted it, in 2006. Over the years, he has made numerous contributions to build systems written in CMake, and even a few contributions to CMake itself. He has taught CMake development for numerous customers, and has migrated the entire buildsystem of large existing projects to CMake.

About KDAB:

KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more.

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world.  We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at [email protected] or visit our website:

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA.

10. Better CMake Part 3 -- The Basics of Targets

Topic time stamps:

0:00 - Intro
0:08 - Motivation
1:13 - add_executable()
2:07 - add_library()
2:41 - Omitting library type
3:06 - MODULE libraries
3:35 - ALIAS libraries
3:54 - IMPORTED libraries
4:36 - INTERFACE libraries
5:08 - OBJECT libraries
6:08 - Talking through a real project
7:59 - Link targets, not files!
9:29 - INTERFACE library example
10:28 - Property visibility
13:33 - Why only use target properties?
15:05 - Header-only libraries
15:43 - Wrap up



11. Shared Libraries with Cmake | Episode 7

This video tutorial teaches you how to create shared libraries using CMake. You'll learn the step-by-step process of creating and building a shared library using CMake, and how to link it to your project. We'll also discuss best practices for managing and distributing shared libraries. Improve your C++ development skills by mastering shared libraries with CMake - watch now.


12. How to Install Libraries in C++ via CMake and Vcpkg [READ DESC]


This video helps clear up issues with using 3rd party libraries in C++ in a cross platform and reusable way.

00:00 Compiler and IDE
00:45 CMake 3.22+
01:04 Installing Vcpkg
03:47 Installing a library
04:15 Visual Studio 2022 CMake Tutorial
08:38 Visual Studio Code CMake Tutorial
14:25 Opening Visual Studio Project in VS Code

13. CMake Library Tutorial - Episode 1

In this video we build a basic library with CMake.

Here is a link to the source code.

14. CMake Tutorial EP 8 | find_library(...) (part 1/2 of find lib)

Find the libraries, wherever they may be. This should help you figure out how to use external libraries that are on your computer, but not within your project. Note that it does find them if they are in your project too unless you tell it not to.

full CMake playlist:


Thanks for coming to the channel to check out a video on Code, Tech, and Tutorials.
You can support this channel on Patreon:
Please leave your feedback or questions in the comments!

15. CMake Tutorial EP 3 | Git Submodules (adding glfw windowing library example)

full CMake playlist:

Find me, support me:
One time donations:
Shop via my Amazon Affiliates Link:
Business inquiries: [email protected]

Thanks for coming to the channel to check out a video on Code, Tech, and Tutorials.

Video Terkait

Kategori General