CMake 3.8 Release Notes¶
Changes made since CMake 3.7 include the following.
CMake learned to support
CSharp(C#) as a first-class language that can be enabled via the
enable_language()commands. It is currently supported by the Visual Studio Generators for VS 2010 and above.
C# assemblies and programs can be added just like common C++ targets using the
add_executable()commands. References between C# targets in the same source tree may be specified by
target_link_libraries()like for C++. References to system or 3rd-party assemblies may be specified by the target properties
More fine tuning of C# targets may be done using target and source file properties. Specifically the target properties related to Visual Studio (
VS_*) are worth a look (for setting toolset versions, root namespaces, assembly icons, ...).
CMake learned to support
CUDAas a first-class language that can be enabled via the
CUDAis currently supported by the Makefile Generators and the
Ninjagenerator on Linux, macOS, and Windows. Support for the Visual Studio IDE is under development but not included in this release.
The NVIDIA CUDA Toolkit compiler (
nvcc) is supported.
C & C++¶
Compile Featuresfunctionality now offers meta-features that request compiler modes for specific language standard levels (e.g.
Compile Featuresfunctionality is now aware of C++ 17. No specific features are yet enumerated besides the
Compile Featuresfunctionality is now aware of the availability of C99 in gcc since version 3.4.
A new minimal platform file for
CodeBlocksextra generator may now be used to generate with
NMake Makefiles JOM.
The Visual Studio Generators for VS 2013 and above learned to support a
host=x64option in the
CMAKE_GENERATOR_TOOLSETvalue (e.g. via the
-Toption) to request use of a VS 64-bit toolchain on 64-bit hosts.
The Visual Studio Generators learned to treat files passed to
target_link_libraries()whose names end in
.targetsas MSBuild "targets" files to be imported into generated project files.
add_custom_target()commands learned the option
COMMAND_EXPAND_LISTSwhich causes lists in the
COMMANDargument to be expanded, including lists created by generator expressions.
execute_process()command gained an
ENCODINGoption to specify on Windows which encoding is used for output from child process.
math(EXPR)command gained support for unary
PREFIXoptions to add groups following source tree directory structure.
string(TIMESTAMP)command learned to treat
%%as a way to encode plain
string(TIMESTAMP)command will now honor the
SOURCE_DATE_EPOCHenvironment variable and use its value instead of the current time.
try_compile()command source file signature gained new options to specify the language standard to use in the generated test project.
try_compile()command source file signature now honors language standard variables like
CMAKE_CXX_STANDARD. See policy
CMAKE_CODELITE_USE_TARGETSvariable was added to tell the
CodeLiteextra generator to change the generated project to have target-centric organization. The
CodeLitethen work on a selected target rather than the whole workspace. (Note that the
Ninjaclean operation on a target includes its dependencies, though.)
CMAKE_SUBLIME_TEXT_2_ENV_SETTINGSvariable was added to tell the
Sublime Text 2extra generator to place specified environment variables in the generated
CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREEvariable was added to tell the
Sublime Text 2extra generator whether to exclude the build tree from the
.sublime-projectwhen it is inside the source tree.
CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILDvariable was added to tell Visual Studio Generators for VS 2010 and above to include the
PACKAGEtarget in the default build, similar to the existing
CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILDvariable for the
BUILD_RPATHtarget property and corresponding
CMAKE_BUILD_RPATHvariable were added to support custom
RPATHlocations to be added to binaries in the build tree.
COMPILE_FLAGSsource file property learned to support
FRAMEWORKtarget property may now also be applied to static libraries on Apple targets. It will result in a proper Framework but with a static library inside.
Imported Interface Libraries learned new
IMPORTED_LIBNAME_<CONFIG>target properties to specify a link library name since interface libraries do not build their own library files.
<LANG>_CPPLINTtarget property and supporting
CMAKE_<LANG>_CPPLINTvariable were introduced to tell the Makefile Generators and the
Ninjagenerator to run the
cpplintstyle checker along with the compiler for
MANUALLY_ADDED_DEPENDENCIEStarget property has been added. It provides a read-only list of dependencies that have been added with the
MAP_IMPORTED_CONFIG_<CONFIG>target property learned to interpret empty list elements as referring to the configuration-less imported location specified by
NO_SYSTEM_FROM_IMPORTEDtarget property is now supported on Imported Interface Libraries.
New source file properties
SKIP_AUTOGENwere added to allow source files to be excluded from processing by
VS_COPY_TO_OUT_DIRsource file property was added to tell Visual Studio Generators for VS 2010 and above whether or not a file should e copied to the output directory.
VS_DEBUGGER_WORKING_DIRECTORYtarget property was added to tell Visual Studio Generators for VS 2010 and above what debugger working directory should be set for the target.
VS_DOTNET_REFERENCES_COPY_LOCALtarget property was added to specify whether to copy referenced assemblies to the output directory.
VS_DOTNET_REFERENCE_<refname>target property was added to tell Visual Studio Generators for VS 2010 and above to add a .NET reference with a given hint path.
VS_INCLUDE_IN_VSIXsource file property was added to tell Visual Studio Generators for VS 2010 and above whether to include the file in a Visual Studio extension package.
VS_RESOURCE_GENERATORsource file property was added to give Visual Studio Generators for VS 2010 and above a setting for the resource generator (
VS_USER_PROPStarget property was added to tell Visual Studio Generators for VS 2010 and above to use a custom MSBuild user
XCODE_EMIT_EFFECTIVE_PLATFORM_NAMEglobal property was added to tell the
Xcodegenerator whether to emit the
EFFECTIVE_PLATFORM_NAMEvariable. This is useful when building with multiple SDKs like
XCODE_EXPLICIT_FILE_TYPEtarget properties were created to tell the
Xcodegenerator to use custom values of the corresponding attributes for a target in the generated Xcode project.
CSharpUtilitiesmodule was added to aid parameterization of Visual Studio C# targets. It provides functions to allow automated setting of source file properties to support Windows Forms, WPF/XAML or other technologies as needed.
ExternalDatamodule learned to support multiple content links for one data file using different hashes, e.g.
img.png.sha1. This allows objects to be fetched from sources indexed by different hash algorithms.
ExternalProjectmodule gained the
GIT_PROGRESSoption to force Git to show progress when cloning repositories.
ExternalProjectmodule gained a
GIT_CONFIGoption to pass
--configoptions to Git when cloning repositories.
feature_summary()command now accepts a new
QUIET_ON_EMPTYoption that suppresses the output when the list of packages that belong to the selected category is empty.
add_feature_info()command now accepts lists of dependencies for deciding whether a feature is enabled or not.
The package types accepted by the
FeatureSummarymodule can now be tweaked by changing the
FindOpenGLmodule now provides imported targets
OpenGL::GLUwhen the libraries are found.
UseSWIGmodule gained a
swig_add_librarycommand to give more flexibility over the old
swig_add_source_to_modulecommand learned a new
SWIG_OUTFILE_DIRoption to control the output file location (
WriteCompilerDetectionHeadermodule gained the
ALLOW_UNKNOWN_COMPILER_VERSIONSoptions that allow creation of headers that will work also with unknown or old compilers by simply assuming they do not support any of the requested features.
ctest_memcheck()command gained a
DEFECT_COUNT <var>option to capture the number of memory defects detected.
ctest_memcheck()command learned to read the location of suppressions files for sanitizers from the
ctest_memcheck()command learned to support
CDASH_UPLOADsignature was taught to honor the
CPackIFWConfigureFilemodule was added to define a new
cpack_ifw_configure_file()command to configure file templates prepared in QtIFW/SDK/Creator style.
cpack_ifw_configure_component_group()commands gained a new
TRANSLATIONSoptions to more specific configuration.
cpack_ifw_configure_component()command gained a new
cpack_ifw_configure_component_group()command gained a new
DEPENDENCIESalias also added.
PRIORITYoption now is deprecated and will be removed in a future version of CMake. Please use new
CPack IFW Generatorgained new
CPACK_IFW_PACKAGE_TITLE_COLORvariables to customize a QtIFW installer look.
CPack productbuild Generatorgained options to sign packages. See the variables
CPack RPM Generatorlearned to omit tags that are not supported by provided
rpmbuildtool. If unsupported tags are set they are ignored and a developer warning is printed out.
CPack RPM Generatorlearned to generate main component package which forces generation of a rpm for defined component without component suffix in filename and package name. See
CPack RPM Generatorlearned to generate a single
debuginfopackage on demand even if components packaging is used. See
CPack RPM Generatorlearned to support multiple directives per file when using
CMake functionality using cryptographic hashes now supports SHA-3 algorithms.
A new generator expression
$<IF:cond,true-value,false-value>was added. It resolves to the true-value if the condition is
1and resolves to the false-value if the condition is
Deprecated and Removed Features¶
print_disabled_features()are now deprecated.
swig_add_modulecommand is now deprecated in favor of
If a command specified by the
<LANG>_CLANG_TIDYtarget property returns non-zero at build time this is now treated as an error instead of silently ignored.
ctest_memcheck()command no longer automatically adds
leak_check=1to the options used by
AddressSanitizer. The default behavior of
AddressSanitizeris to run LeakSanitizer to check leaks unless
ctest_memcheck()command was fixed to correctly append extra sanitizer options read from the
CTEST_MEMORYCHECK_SANITIZER_OPTIONSvariable to the environment variables used internally by the sanitizers.
set_package_properties()command no longer forces the package type to
OPTIONALwhen the type is not explicitly set.
Compile Featuresfunctionality is now aware of features supported by Intel C++ compilers versions 12.1 through 17.0 on UNIX and Windows platforms.
Calls to the
pkg_check_modules()command following a successful call learned to re-evaluate the cached values for a given prefix after changes to the parameters to the command for that prefix.
ui_*are placed in the
<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/includedirectory which is automatically added to the target's
INCLUDE_DIRECTORIES. It is therefore not necessary anymore to have
CMAKE_CURRENT_BINARY_DIRin the target's
Sublime Text 2generator no longer runs the native build command (e.g.
make) with verbose build output enabled.
try_compile()command source file signature now honors the
CMAKE_WARN_DEPRECATEDvariable value in the generated test project.
The Visual Studio Generators for VS 2010 and above now place per-source file flags after target-wide flags when they are classified as raw flags with no project file setting (
AdditionalOptions). This behavior is more consistent with the ordering of flags produced by other generators, and allows flags on more-specific properties (per-source) to override those on more general ones (per-target).
The precompiled Windows binary MSI package provided on
cmake.orgnow records the installation directory in the Windows Registry under the key
HKLM\Software\Kitware\CMakewith a value named