CMake 3.6 Release Notes¶
Changes made since CMake 3.5 include the following.
New Features¶
Generators¶
- The - Ninjagenerator learned to produce phony targets of the form- sub/dir/allto drive the build of a subdirectory. This is equivalent to- cd sub/dir; make allwith Makefile Generators.
- The - Ninjagenerator now includes system header files in build dependencies to ensure correct re-builds when system packages are updated.
- The - Visual Studio 14 2015generator learned to support the Clang/C2 toolsets, e.g. with the- -T v140_clang_3_7option. This feature is experimental.
Commands¶
- The - add_custom_command()and- add_custom_target()commands learned how to use the- CROSSCOMPILING_EMULATORexecutable target property.
- The - install()command learned a new- EXCLUDE_FROM_ALLoption to leave installation rules out of the default installation.
- The - list()command gained a- FILTERsub-command to filter list elements by regular expression.
- The - string(TIMESTAMP)and- file(TIMESTAMP)commands gained support for the- %splaceholder. This is the number of seconds since the UNIX Epoch.
Variables¶
- A - CMAKE_DEPENDS_IN_PROJECT_ONLYvariable was introduced to tell Makefile Generators to limit dependency scanning only to files in the project source and build trees.
- A new - CMAKE_HOST_SOLARISvariable was introduced to indicate when CMake is running on an Oracle Solaris host.
- A - CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIESvariable was added for use by toolchain files to specify system include directories to be appended to all compiler command lines.
- The - CMAKE_<LANG>_STANDARD_LIBRARIESvariable is now documented. It is intended for use by toolchain files to specify system libraries to be added to all linker command lines.
- A - CMAKE_NINJA_OUTPUT_PATH_PREFIXvariable was introduced to tell the- Ninjagenerator to configure the generated- build.ninjafile for use as a- subninja.
- A - CMAKE_TRY_COMPILE_PLATFORM_VARIABLESvariable was added for use by toolchain files to specify platform-specific variables that must be propagated by the- try_compile()command into test projects.
- A - CMAKE_TRY_COMPILE_TARGET_TYPEvariable was added to optionally tell the- try_compile()command to build a static library instead of an executable. This is useful for cross-compiling toolchains that cannot link binaries without custom flags or scripts.
Properties¶
- A - DEPLOYMENT_REMOTE_DIRECTORYtarget property was introduced to tell the- Visual Studio 9 2008and- Visual Studio 8 2005generators to generate the "remote directory" for WinCE project deployment and debugger settings.
- A - <LANG>_CLANG_TIDYtarget property and supporting- CMAKE_<LANG>_CLANG_TIDYvariable were introduced to tell the Makefile Generators and the- Ninjagenerator to run- clang-tidyalong with the compiler for- Cand- CXXlanguages.
- A - TIMEOUT_AFTER_MATCHtest property was introduced to optionally tell CTest to enforce a secondary timeout after matching certain output from a test.
- A - VS_CONFIGURATION_TYPEtarget property was introduced to specify a custom project file type for Visual Studio Generators supporting VS 2010 and above.
- A - VS_STARTUP_PROJECTdirectory property was introduced to specify for Visual Studio Generators the default startup project for generated solutions (- .slnfiles).
Modules¶
- The - CMakePushCheckStatemodule now pushes/pops/resets the variable- CMAKE_EXTRA_INCLUDE_FILESused in- CheckTypeSize.
- The - ExternalProjectmodule leared the- GIT_SHALLOW 1option to perform a shallow clone of a Git repository.
- The - ExternalProjectmodule learned to initialize Git submodules recursively and also to initialize new submodules on updates. Use the- GIT_SUBMODULESoption to restrict which submodules are initialized and updated.
- The - ExternalProjectmodule leared the- DOWNLOAD_NO_EXTRACT 1argument to skip extracting the file that is downloaded (e.g., for self-extracting shell installers or- .msifiles).
- The - ExternalProjectmodule now uses- TLS_VERIFYwhen fetching from git repositories.
- The - FindBLASand- FindLAPACKmodules learned to support OpenBLAS.
- The - FindCUDAmodule learned to find the- cublas_devicelibrary.
- The - FindGTestmodule- gtest_add_testsfunction now causes CMake to automatically re-run when test sources change so that they can be re-scanned.
- The - FindLTTngUSTmodule was introduced to find the LTTng-UST library.
- The - FindPkgConfigmodule learned to optionally create imported targets for the libraries it has found.
- The - FindProtobufmodule learned to provide a- Protobuf_VERSIONvariable and check the version number requested in a- find_package()call.
- The - InstallRequiredSystemLibrariesmodule learned a new- CMAKE_INSTALL_UCRT_LIBRARIESoption to enable app-local deployment of the Windows Universal CRT libraries with Visual Studio 2015.
Platforms¶
- The Clang compiler is now supported on CYGWIN. 
- Support was added for the Bruce C Compiler with compiler id - Bruce.
CTest¶
- The - ctest_update()command now looks at the- CTEST_GIT_INIT_SUBMODULESvariable to determine whether submodules should be updated or not before updating.
- The - ctest_update()command will now synchronize submodules on an update. Updates which add submodules or change a submodule's URL will now be pulled properly.
CPack¶
- The - CPack DEB Generatorlearned how to handle- $ORIGINin- CMAKE_INSTALL_RPATHwhen- CPACK_DEBIAN_PACKAGE_SHLIBDEPSis used for dependency auto detection.
- The - CPack DEB Generatorlearned how to generate- DEBIAN/shlibscontrol file when package contains shared libraries.
- The - CPack DEB Generatorlearned how to generate- DEBIAN/postinstand- DEBIAN/postrmfiles if the package installs libraries in ldconfig-controlled locations (e.g.- /lib/,- /usr/lib/).
- The - CPack DEB Generatorlearned how to generate dependencies between Debian packages if multi-component setup is used and- CPACK_COMPONENT_<compName>_DEPENDSvariables are set. For backward compatibility this feature is disabled by default. See- CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS.
- The - CPack DEB Generatorlearned how to set custom package file names including how to generate properly-named Debian packages:- <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb - For backward compatibility this feature is disabled by default. See - CPACK_DEBIAN_FILE_NAMEand- CPACK_DEBIAN_<COMPONENT>_FILE_NAME.
- The - CPack DEB Generatorlearned how to set the package release number (- DebianRevisionNumberin package file name when used in combination with- DEB-DEFAULTvalue set by- CPACK_DEBIAN_FILE_NAME). See- CPACK_DEBIAN_PACKAGE_RELEASE.
- The - CPack DEB Generatorlearned how to set the package architecture per-component. See- CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE.
- The - CPack DragNDrop Generatorlearned a new option to skip the- /Applicationssymlink. See the- CPACK_DMG_DISABLE_APPLICATIONS_SYMLINKvariable.
- The - CPackIFWmodule gained a new- cpack_ifw_update_repository()command to update a QtIFW-specific repository from a remote repository.
- The - CPack RPM Generatorlearned how to set RPM- disttag as part of RPM- Release:tag when enabled (mandatory on some Linux distributions for e.g. on Fedora). See- CPACK_RPM_PACKAGE_RELEASE_DIST.
- The - CPack RPM Generatorlearned how to set default values for owning user/group and file/directory permissions of package content. See- CPACK_RPM_DEFAULT_USER,- CPACK_RPM_DEFAULT_GROUP,- CPACK_RPM_DEFAULT_FILE_PERMISSIONS,- CPACK_RPM_DEFAULT_DIR_PERMISSIONSand their per component counterparts.
- The - CPack RPM Generatorlearned how to set user defined package file names, how to specify that rpmbuild should decide on file name format as well as handling of multiple rpm packages generated by a single user defined spec file. See- CPACK_RPM_PACKAGE_NAMEand- CPACK_RPM_<component>_PACKAGE_NAME.
- The - CPack RPM Generatorlearned how to correctly handle symlinks that are pointing outside generated packages.
Other¶
- The - Compile Featuresfunctionality is now aware of features supported by Intel C++ compilers versions 12.1 through 16.0 on UNIX platforms.
Deprecated and Removed Features¶
- The - CMakeForceCompilermodule and its macros are now deprecated. See module documentation for an explanation.
- The - find_library(),- find_path(), and- find_file()commands no longer search in installation prefixes derived from the- PATHenvironment variable on non-Windows platforms. This behavior was added in CMake 3.3 to support Windows hosts but has proven problematic on UNIX hosts. Users that keep some- <prefix>/bindirectories in the- PATHjust for their tools do not necessarily want any supporting- <prefix>/libdirectories searched. One may set the- CMAKE_PREFIX_PATHenvironment variable with a semicolon-separated list of prefixes that are to be searched.
- The - Visual Studio 7 .NET 2003generator is now deprecated and will be removed in a future version of CMake.
- The - Visual Studio 7generator (for VS .NET 2002) has been removed. It had been deprecated since CMake 3.3.
- The - Visual Studio 6generator has been removed. It had been deprecated since CMake 3.3.
Other Changes¶
- The precompiled OS X binary provided on - cmake.orgnow requires OS X 10.7 or newer.
- On Linux and FreeBSD platforms, when building CMake itself from source and not using a system-provided libcurl, OpenSSL is now used by default if it is found on the system. This enables SSL/TLS support for commands supporting network communication via - https, such as- file(DOWNLOAD),- file(UPLOAD), and- ctest_submit().
- The - cmake(1)- --buildcommand-line tool now rejects multiple- --targetoptions with an error instead of silently ignoring all but the last one.
- AUTOMOCnow diagnoses name collisions when multiple source files in different directories use- #include <moc_foo.cpp>with the same name (because the generated- moc_foo.cppfiles would collide).
- The - FindBISONmodule- BISON_TARGETmacro now supports special characters by passing the- VERBATIMoption to internal- add_custom_command()calls. This may break clients that added escaping manually to work around the bug.
- The - FindFLEXmodule- FLEX_TARGETmacro now supports special characters by passing the- VERBATIMoption to internal- add_custom_command()calls. This may break clients that added escaping manually to work around the bug.
- The - FindProtobufmodule input and output variables were all renamed from- PROTOBUF_to- Protobuf_for consistency with other find modules. Input variables of the old case will be honored if provided, and output variables of the old case are always provided.
- The - CPack RPM Generatornow supports upper cased component names in per component CPackRPM specific variables. E.g. component named- foonow expects component specific variable to be- CPACK_RPM_FOO_PACKAGE_NAMEwhile before it expected- CPACK_RPM_foo_PACKAGE_NAME. Upper cased component name part in variables is compatible with convention used for other CPack variables. For back compatibility old format of variables is still valid and preferred if both versions of variable are set, but the preferred future use is upper cased component names in variables. New variables that will be added to CPackRPM in later versions will only support upper cased component variable format.
- The CPack NSIS generator's configuration file template was fixed to quote the path to the uninstaller tool used by the - CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALLoption. This avoids depending on an insecure Windows feature to run an uninstaller tool with a space in the path.
