# CMake 3.16.0 available for download

**URL:** https://discourse.cmake.org/t/cmake-3-16-0-available-for-download/262
**Category:** Announcements
**Created:** [November 26, 2019, 3:44pm UTC](https://discourse.cmake.org/t/cmake-3-16-0-available-for-download/262 "2019-11-26T15:44:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![robert.maynard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/robert.maynard/32/4_2.png) [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)
#### Post date: [November 26, 2019, 3:44pm UTC](https://discourse.cmake.org/t/cmake-3-16-0-available-for-download/262/1 "2019-11-26T15:44:34Z")

</div>

I am happy to announce that CMake 3.16.0 is now available for download at:  
[https://cmake.org/download/](https://cmake.org/download/)

Documentation is available at:  
[https://cmake.org/cmake/help/v3.16](https://cmake.org/cmake/help/v3.16)

Release notes appear below and are also published at  
[https://cmake.org/cmake/help/v3.16/release/3.16.html](https://cmake.org/cmake/help/v3.16/release/3.16.html)

Some of the more significant changes in CMake 3.16 are:

- CMake learned to support the Objective C (“OBJC”) and Objective  
C++ (“OBJCXX”) languages. They may be enabled via the “project()”  
and “enable\_language()” commands. When “OBJC” or “OBJCXX” is  
enabled, source files with the “.m” or “.mm”, respectively, will be  
compiled as Objective C or C++. Otherwise they will be treated as  
plain C++ sources as they were before.

- The “target\_precompile\_headers()” command was added to specify a  
list of headers to precompile for faster compilation times.

- The “UNITY\_BUILD” target property was added to tell generators to  
batch include source files for faster compilation times.

- The “find\_file()”, “find\_library()”, “find\_path()”,  
“find\_package()”, and “find\_program()” commands have learned to  
check the following variables to control searching

- The “file()” command learned a new sub-command,  
“GET\_RUNTIME\_DEPENDENCIES”, which allows you to recursively get the  
list of libraries linked by an executable or library. This sub-  
command is intended as a replacement for “GetPrerequisites”.

- “ctest(1)” now has the ability to serialize tests based on  
resource requirements for each test. See Resource Allocation for  
details.

- On AIX, executables using the “ENABLE\_EXPORTS” target property now  
produce a linker import file with a “.imp” extension in addition to  
the executable file. Plugins (created via “add\_library()” with the  
“MODULE” option) that use “target\_link\_libraries()” to link to the  
executable for its symbols are now linked using the import file. The  
“install(TARGETS)” command now installs the import file as an  
“ARCHIVE” artifact.

- On AIX, runtime linking is no longer enabled by default. CMake  
provides the linker enough information to resolve all symbols up  
front. One may manually enable runtime linking for shared libraries  
and/or loadable modules by adding “-Wl,-G” to their link flags (e.g.  
in the “CMAKE\_SHARED\_LINKER\_FLAGS” or “CMAKE\_MODULE\_LINKER\_FLAGS”  
variable). One may manually enable runtime linking for executables  
by adding “-Wl,-brtl” to their link flags (e.g. in the  
“CMAKE\_EXE\_LINKER\_FLAGS” variable).

- “cmake(1)” “-E” now supports “true” and “false” commands, which do  
nothing while returning exit codes of 0 and 1, respectively.

- “cmake(1)” gained a “–trace-redirect=” command line option  
that can be used to redirect “–trace” output to a file instead of  
“stderr”.

- The “cmake(1)” “–loglevel” command line option has been renamed  
to “–log-level” to make it consistent with the naming of other  
command line options. The “–loglevel” option is still supported to  
preserve backward compatibility.

- The “CMAKE\_FIND\_PACKAGE\_NO\_PACKAGE\_REGISTRY” variable has been  
deprecated. Use the “CMAKE\_FIND\_USE\_PACKAGE\_REGISTRY” variable  
instead.

- The “GetPrerequisites” module has been deprecated, as it has been  
superceded by “file(GET\_RUNTIME\_DEPENDENCIES)”.

# CMake 3.16 Release Notes

Changes made since CMake 3.15 include the following.

# New Features

## Languages

- CMake learned to support the Objective C (“OBJC”) and Objective  
C++ (“OBJCXX”) languages. They may be enabled via the “project()”  
and “enable\_language()” commands. When “OBJC” or “OBJCXX” is  
enabled, source files with the “.m” or “.mm”, respectively, will be  
compiled as Objective C or C++. Otherwise they will be treated as  
plain C++ sources as they were before.

## Compilers

- The “Clang” compiler is now supported on “Solaris”.

## Platforms

- On AIX, executables using the “ENABLE\_EXPORTS” target property now  
produce a linker import file with a “.imp” extension in addition to  
the executable file. Plugins (created via “add\_library()” with the  
“MODULE” option) that use “target\_link\_libraries()” to link to the  
executable for its symbols are now linked using the import file. The  
“install(TARGETS)” command now installs the import file as an  
“ARCHIVE” artifact.

- On AIX, runtime linking is no longer enabled by default. CMake  
provides the linker enough information to resolve all symbols up  
front. One may manually enable runtime linking for shared libraries  
and/or loadable modules by adding “-Wl,-G” to their link flags (e.g.  
in the “CMAKE\_SHARED\_LINKER\_FLAGS” or “CMAKE\_MODULE\_LINKER\_FLAGS”  
variable). One may manually enable runtime linking for executables  
by adding “-Wl,-brtl” to their link flags (e.g. in the  
“CMAKE\_EXE\_LINKER\_FLAGS” variable).

## Command-Line

- “cmake(1)” “-E” now supports “true” and “false” commands, which do  
nothing while returning exit codes of 0 and 1, respectively.

- “cmake(1)” gained a “–trace-redirect=” command line option  
that can be used to redirect “–trace” output to a file instead of  
“stderr”.

- The “cmake(1)” “–loglevel” command line option has been renamed  
to “–log-level” to make it consistent with the naming of other  
command line options. The “–loglevel” option is still supported to  
preserve backward compatibility.

## Commands

- The “add\_test()” command learned the option “COMMAND\_EXPAND\_LISTS”  
which causes lists in the “COMMAND” argument to be expanded,  
including lists created by generator expressions.

- The “file()” command learned a new sub-command,  
“GET\_RUNTIME\_DEPENDENCIES”, which allows you to recursively get the  
list of libraries linked by an executable or library. This sub-  
command is intended as a replacement for “GetPrerequisites”.

- The “find\_file()”, “find\_library()”, “find\_path()”,  
“find\_package()”, and “find\_program()” commands have learned to  
check the following variables to control searching

- The “find\_package()” command has learned to check the following  
variables to control searching

- The “message()” command learned indentation control with the new  
“CMAKE\_MESSAGE\_INDENT” variable.

- The “target\_precompile\_headers()” command was added to specify a  
list of headers to precompile for faster compilation times.

## Variables

- The “CMAKE\_CUDA\_RESOLVE\_DEVICE\_SYMBOLS” variable has been  
introduced to optionally initialize the  
“CUDA\_RESOLVE\_DEVICE\_SYMBOLS” target property.

- The “CMAKE\_ECLIPSE\_RESOURCE\_ENCODING” variable was added to  
specify the resource encoding for the the “Eclipse CDT4” extra  
generator.

## Properties

- The “BUILD\_RPATH” and “INSTALL\_RPATH” target properties now  
support “generator expressions”.

- The “INSTALL\_REMOVE\_ENVIRONMENT\_RPATH” target property was added  
to remove compiler-defined “RPATH” entries from a target. This  
property is initialized by the  
“CMAKE\_INSTALL\_REMOVE\_ENVIRONMENT\_RPATH” variable.

- The “PRECOMPILE\_HEADERS” target property was added to specify a  
list of headers to precompile for faster compilation times. Set it  
using the “target\_precompile\_headers()” command.

- The “UNITY\_BUILD” target property was added to tell generators to  
batch include source files for faster compilation times.

- The “VS\_CONFIGURATION\_TYPE” target property now supports  
“generator expressions”.

- The “VS\_DPI\_AWARE” target property was added to tell Visual Studio  
Generators to set the “EnableDpiAwareness” property in “.vcxproj”  
files.

- The “XCODE\_SCHEME\_DEBUG\_DOCUMENT\_VERSIONING” target property was  
added to tell the “Xcode” generator to set the value of the “Allow  
debugging when using document Versions Browser” schema option.

## Modules

- The “FindDoxygen” module “doxygen\_add\_docs()” command gained a new  
“USE\_STAMP\_FILE” option. When this option present, the custom  
target created by the command will only re-run Doxygen if any of the  
source files have changed since the last successful run.

- The “FindGnuTLS” module now provides an imported target.

- The “FindPackageHandleStandardArgs” module  
“find\_package\_handle\_standard\_args()” command gained a new  
“REASON\_FAILURE\_MESSAGE” option to specify a message giving the  
reason for the failure.

- The “FindPkgConfig” module “pkg\_search\_module()” macro now defines  
a “\_MODULE\_NAME” result variable containing the first  
matching module name.

- The “FindPython3” and “FindPython” modules gained options to  
control which “ABIs” will be searched.

- The “FindPython3”, “FindPython2”, and “FindPython” modules now  
support direct specification of artifacts via cache entries.

## Autogen

- When using “AUTOMOC”, CMake now generates the “-p” path prefix  
option for “moc”. This ensures that “moc” output files are  
identical on different build setups (given, that the headers  
compiled by “moc” are in an “include directory”). Also it ensures  
that “moc” output files will compile correctly when the source  
and/or build directory is a symbolic link.

## CTest

- “ctest(1)” now has the ability to serialize tests based on  
resource requirements for each test. See Resource Allocation for  
details.

- A new test property, “SKIP\_REGULAR\_EXPRESSION”, has been added.  
This property is similar to “FAIL\_REGULAR\_EXPRESSION” and  
“PASS\_REGULAR\_EXPRESSION”, but with the same meaning as  
“SKIP\_RETURN\_CODE”. This is useful, for example, in cases where the  
user has no control over the return code of the test. For example,  
in Catch2, the return value is the number of assertion failed,  
therefore it is impossible to use it for “SKIP\_RETURN\_CODE”.

## CPack

- “cpack(1)” learned support for multiple configurations for “-C” option.

- The “CPack DEB Generator” is now able to format generic text  
(usually used as the description for multiple CPack generators)  
according to the Debian Policy Manual. See the  
“CPACK\_PACKAGE\_DESCRIPTION\_FILE” and  
“CPACK\_DEBIAN\_\_DESCRIPTION” variables.

- The “CPack Archive Generator” learned to generate “.tar.zst”  
packages with Zstandard compression.

# Deprecated and Removed Features

- An explicit deprecation diagnostic was added for policy “CMP0067”  
(“CMP0066” and below were already deprecated). The “cmake-  
policies(7)” manual explains that the OLD behaviors of all policies  
are deprecated and that projects should port to the NEW behaviors.

- The “CMAKE\_FIND\_PACKAGE\_NO\_PACKAGE\_REGISTRY” variable has been  
deprecated. Use the “CMAKE\_FIND\_USE\_PACKAGE\_REGISTRY” variable  
instead.

- The “GetPrerequisites” module has been deprecated, as it has been  
superceded by “file(GET\_RUNTIME\_DEPENDENCIES)”.

- The “CPACK\_INSTALL\_SCRIPT” variable has been deprecated in favor  
of the new, more accurately named “CPACK\_INSTALL\_SCRIPTS” variable.

# Other Changes

- The “cmake(1)” "-C " option now evaluates the  
initial cache script with “CMAKE\_SOURCE\_DIR” and “CMAKE\_BINARY\_DIR”  
set to the top-level source and build trees.

- The “cmake(1)” “-E remove\_directory” command-line tool, when given  
the path to a symlink to a directory, now removes just the symlink.  
It no longer removes content of the linked directory.

- The “ctest(1)” “–build-makeprogram” command-line option now  
specifies the make program used when configuring a project with the  
“Ninja” generator or the Makefile Generators.

- The “ExternalProject” module “ExternalProject\_Add()” command has  
been updated so that “GIT\_SUBMODULES “”” initializes no submodules.  
See policy “CMP0097”.

- The “FindGTest” module has been updated to recognize MSVC build  
trees generated by GTest 1.8.1.

- The “project()” command no longer strips leading zeros in version  
components. See policy “CMP0096”.

- The Qt Compressed Help file is now named “CMake.qch”, which no  
longer contains the release version in the file name. When CMake is  
upgraded in-place, the name and location of this file will remain  
constant. Tools such as IDEs, help viewers, etc. should now be able  
to refer to this file at a fixed location that remains valid across  
CMake upgrades.

- “RPATH” entries are properly escaped in the generated CMake  
scripts used for installation. See policy “CMP0095”.

- When using “CMAKE\_WINDOWS\_EXPORT\_ALL\_SYMBOLS” on Windows the auto-  
generated exports are now updated only when the object files  
providing the symbols are updated.

* * *

# Changes made since CMake 3.16.0-rc4:

Brad King (4):

- Xcode: Set source file type for Objective C/C++
- FindwxWidgets: Fix finding both release and debug libs
- CMakeParseImplicitIncludeInfo: Remove all CR chars from compiler output
- CMake 3.16.0

Craig Sturdy (1):

- FindwxWidgets: Find wxQt debug libraries

Cristian Adam (2):

- Unity: No repeated path for internal generated unity files
- FindODBC: Add library name for MinGW toolchains

Kyle Edwards (3):

- CTest: Add version field to resource spec file
- CTest: Clarify that resource requirements can be split
- Help: Clarify how tests are run if no resource spec file is specified

---

<div class="post-metadata">

### Author: ![madscientist](https://discourse.cmake.org/user_avatar/discourse.cmake.org/madscientist/32/109_2.png) [@madscientist](https://discourse.cmake.org/u/madscientist)
#### Post date: [November 30, 2019, 12:41am UTC](https://discourse.cmake.org/t/cmake-3-16-0-available-for-download/262/2 "2019-11-30T00:41:05Z")

</div>

I tested this with my system and it MOSTLY worked but there is some  
kind of bug around using OBJECT libraries with UNITY builds.

I’ve filed a bug with a repro case here:

[https://gitlab.kitware.com/cmake/cmake/issues/20051](https://gitlab.kitware.com/cmake/cmake/issues/20051)

Since it seems to be kind of random on my system (some OBJECT libraries  
work, some don’t) I’ll be interested to know if others can reproduce  
this.

Cheers!
