Release Date: 15th March 2019
This is part of the change history for the book Professional CMake: A Practical Guide. The 3rd Edition has been updated for the CMake 3.14.0 release and also contains some other minor improvements. The following lists the main changes in this edition.
Flow Control chapter:
- New for CMake 3.14, the
if()
command can now check specifically whether a variable is a cache variable usingif(CACHE{name})
.
Modules chapter:
- New for CMake 3.14, the
try_compile()
command now supports link options through the newCMAKE_REQUIRED_LINK_OPTIONS
variable. - The new
CheckFortranSourceRuns
module added in CMake 3.14 is now mentioned and has been added to the existing examples for C and C++.
Target Types chapter:
- Added comments about fixes in CMake 3.14 for transitive behavior of object libraries.
- Added brief comment that the name of an exported target can be different to the original.
Working With Files chapter:
- New
NAME_WLE
andLAST_EXT
options added in CMake 3.14 forget_filename_component()
. - New
file()
subcommandsREAD_SYMLINK
,CREATE_LINK
andSIZE
added in CMake 3.14.
Toolchains And Cross Compiling chapter:
- Added comment regarding new support in CMake 3.14 for
iOS
,watchOS
andtvOS
asCMAKE_SYSTEM_NAME
values. - Fixed an example where a generator expression was split across multiple lines.
- Added notes highlighting that Android NDK r19 breaks CMake’s built-in Android support.
Apple chapter:
- New for CMake 3.14, the target Apple platform can now be selected by setting
CMAKE_SYSTEM_NAME
toiOS
,watchOS
andtvOS
. - Corrected and expanded statements about how
CMAKE_XCODE_ATTRIBUTE_XXX
variables andXCODE_ATTRIBUTE_XXX
target properties relate to each other and where the variable will and won’t have any effect. - Cleaned up discussion of provisioning and added material covering manual provisioning with the
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER
target property. - With CMake 3.14, code signing is no longer needed or used in
try_compile()
tests. Combined with the newCMAKE_SYSTEM_NAME
support, toolchain files are no longer needed for iOS, watchOS or tvOS. - Clarified some comments in the Recommendations section around the use of the
CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH
andCMAKE_OSX_ARCHITECTURES
variables.
Finding Things chapter:
- Clarified the interaction of
QUIET
andREQUIRED
options to find_package().
Testing chapter:
- Added a brief mention of the
ctest --progress
option added in CMake 3.13. - New for CMake 3.14, the
CTest
module now supports aCTEST_SUBMIT_URL
variable for more convenient dashboard URL definition. - New for CMake 3.14, dashboard submissions now support a new
Done
part.
Installing chapter:
- New for CMake 3.14, A number of
install()
commands now support a default destination based onGNUInstallDirs
. - CMake 3.14 added a new
BUILD_RPATH_USE_ORIGIN
target property and an associatedCMAKE_BUILD_RPATH_USE_ORIGIN
variable. - Added discussion of the
EXPORT_NAME
target property to allow the exported target name to be different from the original target. - The order in which
install()
commands are used during an install has been made much clearer with CMake 3.14. Changes in behavior are noted with an example to illustrate. - CMake 3.14 added support for generator expressions within custom code or a custom script file name given to
install()
. - A new
ARCH_INDEPENDENT
option was added towrite_basic_package_version_file()
in CMake 3.14.
External Content chapter:
- CMake 3.14 added a new
FetchContent_MakeAvailable()
command for bringing in dependencies much more concisely. - CMake 3.14 added new
LOG_DIR
andLOG_MERGED_STDOUTERR
options toExternalProject_Add()
. - Added a brief note mentioning a drawback to the
BUILD_ALWAYS
option ofExternalProject_Add()
.
Project Organization chapter:
- Updated discussion and examples to account for the new
FetchContent_MakeAvailable()
command added in CMake 3.14. - Updated examples to show how to use the
EXPORT_NAME
target property.