Software Development with C++: CMake Libraries

  Рет қаралды 1,942

Nick

Nick

Күн бұрын

Пікірлер: 4
@MrAlFuture
@MrAlFuture 10 ай бұрын
Wow this is such an excellent series. Thank you!
@sebastianwilke626
@sebastianwilke626 Жыл бұрын
Thanks for the video! @6:53: "So here we want to find this _?_ package Threads" - this what package? I'm having trouble understanding the find_package and target_link_libraries commands of the 2nd and 3rd example. From the docs on the target_link_libraries command: "Items containing ::, such as Foo::Bar, are assumed to be IMPORTED or ALIAS library target names [...]". I'm assuming they (Threads and benchmark) are imported here (since we're not aliasing anything). We're not choosing the package name of the find_package command ourselves, right? What does it mean for Threads::Threads to be populated @7:03? Is the former 'Threads' in Threads::Threads of the target_link_libraries command the same as in the find_package command and if so what's the latter 'Threads'?
@NotesByNick
@NotesByNick Жыл бұрын
As stated in the documentation, "Threads" is the thread implementation of the system you are building on (cmake.org/cmake/help/latest/module/FindThreads.html ). From the documentation "find_package" finds a package of a specified name, and loads package-specific details if it's found (cmake.org/cmake/help/latest/command/find_package.html ). In the case of "Threads", it defines the target "Threads::Threads", which is the thread library for your machine. No, we're not choosing our own name to pass to the "find_package" command (unless you wrote a package that you are now trying to find). CMake searches through files like "FindThreads.cmake" (as shown in the video), to match names to real packages. Google benchmark (used in the video), provides the name ("benchmark") to use in the "find_target" command in its documentation, and says that you should use "benchmark::benchmark" to link against it. From the documentation, "target_link_libraries" allows you to specify things you want to link against (cmake.org/cmake/help/latest/command/target_link_libraries.html ). So "find_target" is used to import targets, and "target_link_libraries" can be used to say you want to link against a target you just imported.
@sebastianwilke626
@sebastianwilke626 Жыл бұрын
@@NotesByNick Gotcha! I just didn't know where these names were coming from but this cleared things up, thank you!
Software Development with C++: Recursive CMake
7:40
Nick
Рет қаралды 1,8 М.
Software Development with C++: Debugging with GDB
15:02
Nick
Рет қаралды 1,9 М.
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН
Better CMake Part 3 -- The Basics of Targets
16:23
Jefferson Amstutz
Рет қаралды 20 М.
CMake vs Make - A developer's perspective
8:16
Kea Sigma Delta
Рет қаралды 7 М.
why do header files even exist?
10:53
Low Level
Рет қаралды 447 М.
Software Development with C++: Introduction to CMake
8:33
CMake Tutorial EP 2 | Libraries and Subdirectories
17:29
Code, Tech, and Tutorials
Рет қаралды 119 М.
Software Development with C++: Debugging with Valgrind
17:26
Software Development with C++: Recursive make
12:11
Nick
Рет қаралды 1,1 М.
Parallel C++: OpenMP Target Offloading
11:05
Nick
Рет қаралды 1,2 М.
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН