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_OPTIONSvariable. - The new
CheckFortranSourceRunsmodule 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_WLEandLAST_EXToptions added in CMake 3.14 forget_filename_component(). - New
file()subcommandsREAD_SYMLINK,CREATE_LINKandSIZEadded in CMake 3.14.
Toolchains And Cross Compiling chapter:
- Added comment regarding new support in CMake 3.14 for
iOS,watchOSandtvOSasCMAKE_SYSTEM_NAMEvalues. - 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_NAMEtoiOS,watchOSandtvOS. - Corrected and expanded statements about how
CMAKE_XCODE_ATTRIBUTE_XXXvariables andXCODE_ATTRIBUTE_XXXtarget 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_SPECIFIERtarget property. - With CMake 3.14, code signing is no longer needed or used in
try_compile()tests. Combined with the newCMAKE_SYSTEM_NAMEsupport, 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_ARCHandCMAKE_OSX_ARCHITECTURESvariables.
Finding Things chapter:
- Clarified the interaction of
QUIETandREQUIREDoptions to find_package().
Testing chapter:
- Added a brief mention of the
ctest --progressoption added in CMake 3.13. - New for CMake 3.14, the
CTestmodule now supports aCTEST_SUBMIT_URLvariable for more convenient dashboard URL definition. - New for CMake 3.14, dashboard submissions now support a new
Donepart.
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_ORIGINtarget property and an associatedCMAKE_BUILD_RPATH_USE_ORIGINvariable. - Added discussion of the
EXPORT_NAMEtarget 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_INDEPENDENToption 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_DIRandLOG_MERGED_STDOUTERRoptions toExternalProject_Add(). - Added a brief note mentioning a drawback to the
BUILD_ALWAYSoption 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_NAMEtarget property.