Release Date: 10th December 2019
This is part of the change history for the book Professional CMake: A Practical Guide. The 5th Edition has been updated for the CMake 3.16.0 release and covers a number of new significant features as well as the usual set of minor improvements. Major highlights of this edition are a new chapter on build performance and a substantial new section in the Testing chapter covering the new fine-grained test resources functionality. The following lists the main changes in this edition.
- CMake 3.16 renamed the
- Added note about changed behavior in CMake 3.5.0 for whether
DEPRECATIONmessages are shown by default or not.
Flow Control chapter:
- Addressed some minor inaccuracies in how the
if()command interprets quoted constants.
- Fixed incorrect logic and output for example for Interrupting Loops section.
Functions And Macros chapter:
- Removed unnecessary extra variable dereference in example for parsing function arguments.
- Mention that source properties can impact build performance due to interaction with unity builds.
Language Requirements chapter:
- CMake 3.16 added support for recognizing
OBJCXXas their own distinct languages.
Target Types chapter:
- Fixed object library example that used
$<TARGET_SOURCES:...>(which isn’t a valid generator expression) instead of
Custom Tasks chapter:
- Fixed missing quote for a
message()command in an
Specifying Version Details chapter:
- Added quotes around
COMPILE_DEFINITIONSproperty value in example because it could be a list.
- Added a call to
target_include_directories()in example so that
foobar_version.hcan be found.
Working With Files chapter:
- Added note highlighting that the
cmake -E removedoes not behave as documented.
Toolchains And Cross Compiling chapter:
- CMake 3.16 restored support for Android NDK r19.
- Briefly expanded discussion of Android toolchain examples to compare results for GCC and Clang for NDK <r18, r18 and r19.
Apple Features chapter:
- Corrected and updated discussion of
- Mention new
OBJCXXlanguage support added in CMake 3.16.
Finding Things chapter:
- CMake 3.16 added support for a number of new variables of the form
CMAKE_FIND_USE_...which can be used to change the defaults for the associated keyword options in the various
- From CMake 3.16,
<prefix>_MODULE_NAMEwith the module that was found.
- Replaced all uses of the term “build slave” with other alternatives.
- Added a substantial new section Managing Test Resources which covers the new fine-grained test resource allocation functionality added in CMake 3.16.
- CMake 3.16 added support for a
- CMake 3.16 added support for a new test property
- Gave the ambiguity of the
ctestmore prominence. It now has its own specific warning callout in the text.
- Mentioned the new
file(GET_RUNTIME_DEPENDENCIES)subcommand added in CMake 3.16.
- Fixed variable dereferencing, naming and typos in main example of Config Files For CMake Projects section. The dependency on
BagOfBeanswas also switched to the mandatory
Runtimecomponent to simplify the example a little.
- CMake 3.16 added direct support for creating multi-configuration packages with
- CMake 3.16 added support for creating archives using Zstandard compression.
Build Performance chapter:
- New chapter focusing on techniques and CMake features for improving build performance.
- CMake 3.16 added support for unity builds and precompiled headers.
- Also contains sections covering
ccache, split dwarf and using alternative linkers. The interaction between these and other features mentioned in the chapter is also discussed.