Professional Documents
Culture Documents
CMake
Sixth Edition
Bill
Ken
Julien
Jomier,
Brad
Alex Neundorf
Published
by Kitware Inc.
community
at
www.cmake.org
Contents
CHAPTER 1
The
WHY CMAKE?
History of CMake
Not Use
or
ANT?
CHAPTER 2
Getting
GETTING STARTED
and
Building
Installing CMake
on
Your
Computer
Windows
Binary Installation
CMake Yourself
Basic CMake
Usage
and
Syntax
10
to Run CMake?
11
11
Running the
14
ccmake Curses
Interface
16
16
Dependency A nalysis
Editing CMakeLists Files
17
18
CHAPTER 3
KEY CONCEPTS
18
19
21
Main Structures
21
Targets
24
Source Files
25
26
27
Build
32
Configurations
CHAPTER 4
CMake
33
Language
33
Basic Commands
34
Flow Control
34
Regular Expressions
41
iv
Checking
Using
Versions of CMake
43
Modules
44
45
CMake with
46
Using
Using
Qt
47
Policies
48
Updating
Linking
Project
For
New Version
of CMake
Libraries
51
54
Specifying Optimized
Linking
Advanced
Object
or
Debug
Libraries with
Target
56
57
Libraries
58
59
Shared
64
Library Versioning
Installing Files
Installing Prerequisite
66
Shared Libraries
Advanced Commands
CHAPTER 5
76
81
SYSTEM INSPECTION
85
87
Finding Packages
92
85
93
Configure a
95
Compilation?
Header File
97
CHAPTER 6
Using add_custom_command
How to
an
an
Target
107
Executable
to
File
108
109
Command
113
113
113
114
115
CHAPTER 7
Source Code
Single
108
110
and
Outputs
When There Isn't One Rule For One Output
A
105
105
on a
Copy
Using add_custom_command to Generate
Using
99
102
Directory
Build Directories
Structures
115
117
Converting Projects
119
UNIX Makefiles
120
121
Converting
CHAPTER 8
122
CROSS-COMPILING WITH
CMAKE
125
Toolchain Files
126
128
147
CHAPTER 9
CPack Basics
131
133
136
140
143
145
149
149
Simple Example
150
What
Is Included?
151
152
153
154
15 5
156
156
Creating
162
Options
13 0
Time Libraries
162
163
164
164
Cygwin Setup
174
177
179
181
183
Packages
184
CPack Files
184
CHAPTER 10
185
185
Testing Using
Using
186
Testing?
187
Properties
189
CTest
CTest to Drive
Complex
191
Tests
Number of Tests
192
Handling a Large
Managing Test Data
Producing Test Dashboards
Adding
194
196
CDash Dashboard
Support
to a
Project
203
Client Setup
Customizing Dashboards for a Project
Dashboard Submissions Settings
Filtering Errors and Warnings
Adding Notes to a Dashboard
Setting up Automated Dashboard Clients
205
205
206
208
209
of Traditional CTest
Limitations
Advanced CTest
Scripting
213
215
215
216
Scripting
Setting up
199
216
Dashboard Server
221
CDash Server
221
Advanced Server
Management
223
Build Groups
226
228
Sites
229
230
Graphs
Adding
Notes to
Build
231
Logging
Test Timing
232
Mobile Support
233
Backing up CDash
Upgrading CDash
233
CDash Maintenance
235
232
234
Subprojects
Using ctestjsubmit with PARTS and FILES
Splitting
CHAPTER 11
Project
into
Multiple Subprojects
239
240
The Determine
The Enable
Your
236
System Process
Language
Process
245
246
248
Rule Variable
251
Listing
General
Tag Variables
250
251
Compiler
252
Borland
253
and Platform
Extending
Compiler
CMake
CHAPTER 12
Loaded Command
Loaded Command
TUTORIALS
Adding
Building
(Step 6)
Adding Support for a Dashboard (Step 7)
an
CHAPTER 13
APPENDIX A
Variables That
Change
Variables for
VARIABLES
Behavior
254
255
259
A Basic
252
254
Creating
Using a
252
259
260
262
264
266
267
271
272
273
273
System
280
283
Languages
288
293
CHAPTER 14 APPENDIX B
Options
302
302
Name
302
Usage
302
Description
Options
302
303
CMake Generators
308
312
Options
317
Options
CPack Generators
CHAPTER 15
317
APPENDIX C
CMake Generator
Expressions
GENERATOR EXPRESSIONS
318
319
viii
CHAPTER 16
APPENDIX D
LISTFILE COMMANDS
Current Commands
Compatibility
CHAPTER 17
321
Commands
APPENDIX E
399
SELECTED MODULES
CHAPTER 18
APPENDIX F
CMake Properties
321
407
407
PROPERTIES
583
Generator.
583
Properties
of Global Scope
Properties
Properties
on
Directories
587
on
Targets
591
on
Tests
615
on
Source Files
617
on
Cache Entries
620
Properties
Properties
Properties
CHAPTER 19
APPENDIX G
CHAPTER 20
INDEX
583
CMAKE POLICIES
623
635