2 min read

CMake 3.12.0 is now available for download. The new release includes changes in generators, command lines, variables, modules and other updates.

Let’s have a look at major changes and new features in CMake 3.12.0

Key Updates

Here are the new features added in the latest release:

Generators

The Visual Studio Generators for VS 2017 now offers support for version=14.## option in the CMAKE_GENERATOR_TOOLSET value (e.g. via the cmake(1) -T option). This helps in specifying a toolset version number.

Command Line

The cmake(1) Build Tool Mode (cmake –build) gained –parallel [<jobs>] and -j [<jobs>] options. This helps to specify a parallel build level. They also help map to the corresponding options in the native build tool.

Commands

The add_compile_definitions() command is now added to set the preprocessor definitions at a directory level. This supersedes add_definitions(). Also, the cmake_minimum_required() and cmake_policy(VERSION) commands can now accept a version range using the form <min>[…<max>]. The list() command offers a SUBLIST sub-command to get a sublist of the list.

Variables

The CMAKE_SUPPRESS_REGENERATION variable is extended and now provides support to the Ninja and Makefile Generators. The CMAKE_FOLDER variable has been added to initialize the FOLDER property on all targets.

Properties

VS_SHADER_DISABLE_OPTIMIZATIONS and VS_SHADER_ENABLE_DEBUG, which are the properties of HLSL source file now offer support for generator expressions. HLSL source file property VS_SHADER_OBJECT_FILE_NAME has been added to the Visual Studio Generators for VS 2010 and above. The property helps to specify the file name of the compiled shader object.

Modules

The FindALSA module is now capable of providing imported targets. The FindMatlab module offers support for the Matlab Runtime Compiler (MCR) for compiling and linking matlab extensions. The UseSWIG module has also gained support now for CSHARP variant wrapper files.

Generator Expressions

A new $<GENEX_EVAL:…> and $<TARGET_GENEX_EVAL:target,…> generator expression is now added to allow consumption of generator expressions. Their evaluation itself delivers generator expressions. Added a new $<TARGET_NAME_IF_EXISTS:…> generator expression.

Other changes

The Visual Studio 8 2005 generator has been deprecated. Fortran dependency scanning now provides support for dependencies implied by Fortran Submodules. The Compile Features functionality will now make use of C features in MSVC since VS 2010.

For more information on the latest updates and features, check out the official CMake 3.12.0 release notes.

Read Next

Qt for Python 5.11 released!

Apache NetBeans 9.0 RC1 released!

 

Tech writer at the Packt Hub. Dreamer, book nerd, lover of scented candles, karaoke, and Gilmore Girls.

LEAVE A REPLY

Please enter your comment!
Please enter your name here