CMake 3.3 Release Notes¶
Contents
Changes made since CMake 3.2 include the following.
New Features¶
Generators¶
- The Makefile Generators now add
.DELETE_ON_ERRORto the makefiles that contain the actual build rules for files on disk. This tells GNU make to remove rule outputs when their recipe modifies an output but fails. - The Visual Studio Generators learned to support
.xamlsource files and automatically associate them with corresponding.hand.cppsources. - A new experimental
Green Hills MULTIgenerator was added on Windows. Green Hills MULTI is an IDE for embedded real-time systems.
Commands¶
- The
add_dependencies()command learned to allow dependencies to be added to interface libraries. Dependencies added to an interface library are followed transitively in its place since the target itself does not build. - The
execute_process()command learned to support specifying the same file forOUTPUT_FILEandERROR_FILE. - The
file(GLOB)andfile(GLOB_RECURSE)commands learned a newLIST_DIRECTORIES <bool>option to specify whether the glob result should include directories. - The
find_library(),find_path(), andfind_file()commands now search in installation prefixes derived from thePATHenvironment variable. - The
if()command learned a newIN_LISToperator that evaluates to true if a given element is contained in a named list. - The
install(EXPORT)andexport()commands learned to export targets that populate theINTERFACE_SOURCEStarget property. - The
install(TARGETS)command learned to support generator expressions in theDESTINATIONvalue.
Variables¶
- The version of some Fortran compilers is now detected and stored in the
CMAKE_Fortran_COMPILER_VERSIONvariable. - The Visual Studio Generators learned a new
CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILDoption to put theINSTALLtarget in the default build of a solution (.sln) file.
Properties¶
- A
CROSSCOMPILING_EMULATORtarget property and supportingCMAKE_CROSSCOMPILING_EMULATORvariable were introduced to allow target platform binaries to run on the host during cross compiling. - A
<LANG>_INCLUDE_WHAT_YOU_USEtarget property and supportingCMAKE_<LANG>_INCLUDE_WHAT_YOU_USEvariable were introduced to tell the Makefile Generators and theNinjagenerator to runinclude-what-you-usealong with the compiler forCandCXXlanguages. - The
<LANG>_VISIBILITY_PRESETandVISIBILITY_INLINES_HIDDENtarget properties now affect compilation in sources of all target types. See policyCMP0063. - The
XCODE_ATTRIBUTE_<an-attribute>target property learned to support generator expressions.
Modules¶
- The
CheckFortranCompilerFlagmodule was introduced to checkFortrancompiler flags, much like theCheckCCompilerFlagmodule already does forC. - The
ExternalDatamodule learned a newExternalData_NO_SYMLINKSoption to disable use of symbolic links to populate the real data files and use copies instead. - The
ExternalDatamodule learned a newRECURSE:option inDATA{}references specifying directories. This allows an entire directory tree of associated files to be matched. - The
ExternalDatamodule learned a new URL template placeholder%(algo:<key>)to allow custom mapping from algorithm name to URL component through configuration of newExternalData_URL_ALGO_<algo>_<key>variables. This allows more flexibility in remote URLs. - The
ExternalProjectmodule learned to replace tokens like<BINARY_DIR>in theBYPRODUCTSof each step. - The
ExternalProjectmodule APIs learned to supportgenerator expressionswhen usingLOG_*options and in CMake initial cache options. - The
FindBoostmodule now tracks the directories containing libraries separately for RELEASE and DEBUG configurations. - The
FindCUDAmodule now defaults to using the static CUDA runtime library if it is available. A newCUDA_USE_STATIC_CUDA_RUNTIMEoption is offered to control this behavior. - The
FindMatlabmodule was completely rewritten. It learned about versions and components and to find Matlab in a more precise and multiplatform way. The module now offers APIs to create mex extensions, documentation, and unit tests. - The
FindPackageHandleStandardArgsmoduleFIND_PACKAGE_HANDLE_STANDARD_ARGSfunction now always populates both the<PackageName>_FOUNDand<UPPERCASE_NAME>_FOUNDvariables (the latter for backwards compatibility). TheFOUND_VARoption is now ignored except to enforce its allowed values. - The
InstallRequiredSystemLibrariesmodule learned a newCMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENToption to specify the installation component.
Generator Expressions¶
- A new
COMPILE_LANGUAGEgenerator expression was introduced to allow specification of compile options for target files based on theLANGUAGEof each source file. Due to limitations of the underlying native build tools, this feature has varying support across generators. See thecmake-generator-expressions(7)manual for details.
CTest¶
- The
ctest(1)tool learned a new--repeat-until-fail <n>option to help find sporadic test failures. - The
CTestCoverageCollectGCOVmodule learned to support the sameCTEST_CUSTOM_COVERAGE_EXCLUDEoption as thectest_coverage()command.
CPack¶
- The
CPack IFW Generatorlearned to support Qt Framework Installer 2.0 tools. - The
CPack DEB Generatorlearned a newCPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPSvariable to specify per-component use ofdpkg-shlibdeps. - The
CPack DEB Generatorlearned a newCPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDSoption to specify per-component dependencies. - The
CPack RPM Generatorlearned to package symbolic links more cleanly and now supports directory symlinks with recentrpmbuildversions. - The
CPack RPM Generatorlearned a newCPACK_RPM_ADDITIONAL_MAN_DIRSvariable to specify directories containing man pages for the brp-compress RPM macro. - The
CPack RPM Generatorlearned a newCPACK_RPM_<component>_PACKAGE_ARCHITECTUREvariable to specify a component-specific package architecture. - The CPack WIX generator learned the new
CPACK_START_MENU_SHORTCUTS,CPACK_DESKTOP_SHORTCUTSandCPACK_STARTUP_SHORTCUTSinstalled file properties which can be used to install shorcuts in the Start Menu, on the Desktop and in the Startup Folder respectively.
Other¶
- The
Compile Featuresfunctionality is now aware of features supported by GNU compilers on Windows, versions 4.4 through 5.0. - The
cmake(1)-E tarcommand learned a new--format<format>option to specify the archive format to be written. - On OS X, CMake learned to create XCTest bundles to test Frameworks
and App Bundles within Xcode. The
FindXCTestmodule provides convenience functions to handleXCTESTbundles.
Deprecated and Removed Features¶
On OS X the
cmake-gui(1)no longer has theInstall For Command Line Usemenu item. Instead there is aHow to Install For Command Line Usemenu item that shows an informational dialog box explaining how to make the command line tools available. For example:/Applications/CMake.app/Contents/bin/cmake-gui --install
The
ctest_build()andbuild_command()commands no longer tellmaketools to ignore errors with the-ioption. Previously this was done for Makefile Generators but not others. See policyCMP0061.The
Visual Studio 10 2010generator no longer checks for running VS IDEs with the project open or asks them to reload. This was originally done for VS 10 because it had been done for VS 7 through 9 to avoid prompting for every project in a solution. Since VS >= 10 allow the whole solution to reload at once they do not need CMake to help them.The
Visual Studio 7generator (.NET 2002) is now deprecated and will be removed in a future version of CMake.The
Visual Studio 6generator is now deprecated and will be removed in a future version of CMake.The
find_package()command no longer considers project build trees recently configured in acmake-gui(1). This was previously done only on Windows and is now never done. TheNO_CMAKE_BUILDS_PATHoption is now ignored if given and effectively always on. Projects may populate the User Package Registry to aid users building multiple dependent projects one after another.The
add_definitions()command no longer causes aDEFINITIONSdirectory property to be populated. See policyCMP0059.With Visual Studio 7, 8, and 9 generators the value of the
$(OutDir)placeholder no longer evaluates to the configuration name. Projects should use$(ConfigurationName)for that instead.Using the output of
export()with theinstall(FILES)command is no longer allowed. See policyCMP0062for details.
Other Changes¶
- The
Ninjagenerator now requires that calls to theadd_custom_command()andadd_custom_target()commands use theBYPRODUCTSoption to explicitly specify any files generated by the custom commands that are not listed as outputs (perhaps because their timestamps are allowed to be older than the inputs). See policyCMP0058. - Build-time progress output of Makefile Generators has been improved. It no longer mixes progress and build rule messages during parallel builds. The link rule messages now have progress and are displayed as bold green instead of bold red (since red is often associated with an error message).
- The
CMAKE_CFG_INTDIRvariable value for Visual Studio 7, 8, and 9 is now$(ConfigurationName)instead of$(OutDir). This should have no effect on the intended use cases of the variable. - Linking to library files by a full path in an implicit linker search
directory (e.g.
/usr/lib/libfoo.a) no longer asks the linker to search for the library (e.g.-lfoo) and now links by full path. See policyCMP0060.