Skip to Main Content
Modern CMake for C++
book

Modern CMake for C++

by Rafał Świdziński
February 2022
Intermediate to advanced content levelIntermediate to advanced
460 pages
9h 35m
English
Packt Publishing
Content preview from Modern CMake for C++

Chapter 6: Linking with CMake

You might think that after we have successfully compiled the source code into a binary file, our job as build engineers is done. That's almost the case – binary files contain all the code for a CPU to execute, but the code is scattered across multiple files in a very complex way. Linking is a process that simplifies things and makes machine code neat and quick to consume.

A quick glance at the list of commands will tell you that CMake doesn't provide that many related to linking. Admittedly, target_link_libraries() is the only one that actually configures this step. Why dedicate a whole chapter to a single command then? Unfortunately, almost nothing is ever easy in computer science, and linking is no exception. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern CMake for C++ - Second Edition

Modern CMake for C++ - Second Edition

Rafał Świdziński

Publisher Resources

ISBN: 9781801070058Supplemental Content