Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
CMake Cookbook

You're reading from   CMake Cookbook Building, testing, and packaging modular software with modern CMake

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781788470711
Length 606 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Radovan Bast Radovan Bast
Author Profile Icon Radovan Bast
Radovan Bast
Roberto Di Remigio Roberto Di Remigio
Author Profile Icon Roberto Di Remigio
Roberto Di Remigio
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Setting up Your System 2. From a Simple Executable to Libraries FREE CHAPTER 3. Detecting the Environment 4. Detecting External Libraries and Programs 5. Creating and Running Tests 6. Configure-time and Build-time Operations 7. Generating Source Code 8. Structuring Projects 9. The Superbuild Pattern 10. Mixed-language Projects 11. Writing an Installer 12. Packaging Projects 13. Building Documentation 14. Alternative Generators and Cross-compilation 15. Testing Dashboards 16. Porting a Project to CMake 17. Other Books You May Enjoy

Detecting required dependencies and linking

We have now all generated files in place, so let us retry the build. We should be able to configure and compile the sources, but we will not be able to link:

$ mkdir -p build
$ cd build
$ cmake ..
$ cmake --build .

...
Scanning dependencies of target vim
[ 98%] Building C object src/CMakeFiles/vim.dir/main.c.o
[100%] Linking C executable ../bin/vim
../lib64/libbasic_sources.a(term.c.o): In function `set_shellsize.part.12':
term.c:(.text+0x2bd): undefined reference to `tputs'
../lib64/libbasic_sources.a(term.c.o): In function `getlinecol':
term.c:(.text+0x902): undefined reference to `tgetent'
term.c:(.text+0x915): undefined reference to `tgetent'
term.c:(.text+0x935): undefined reference to `tgetnum'
term.c:(.text+0x948): undefined reference to `tgetnum'

... many other undefined references ...

Again, we can take the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime